Skip to content

Commit

Permalink
Rename files
Browse files Browse the repository at this point in the history
  • Loading branch information
appilon committed Oct 2, 2020
1 parent 9702004 commit b6267ec
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
19 changes: 19 additions & 0 deletions internal/lsp/diagnostics.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package lsp

import (
"github.com/hashicorp/hcl/v2"
lsp "github.com/sourcegraph/go-lsp"
)

func HCLSeverityToLSP(severity hcl.DiagnosticSeverity) lsp.DiagnosticSeverity {
var sev lsp.DiagnosticSeverity
switch severity {
case hcl.DiagError:
sev = lsp.Error
case hcl.DiagWarning:
sev = lsp.Warning
case hcl.DiagInvalid:
panic("invalid diagnostic")
}
return sev
}
13 changes: 0 additions & 13 deletions internal/lsp/convert.go → internal/lsp/range.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,3 @@ func lspRangeToHCL(lspRng lsp.Range, f File) (*hcl.Range, error) {
End: endPos,
}, nil
}

func HCLSeverityToLSP(severity hcl.DiagnosticSeverity) lsp.DiagnosticSeverity {
var sev lsp.DiagnosticSeverity
switch severity {
case hcl.DiagError:
sev = lsp.Error
case hcl.DiagWarning:
sev = lsp.Warning
case hcl.DiagInvalid:
panic("invalid diagnostic")
}
return sev
}
File renamed without changes.

0 comments on commit b6267ec

Please sign in to comment.