Skip to content

Commit

Permalink
cuepls: support .cue filetype
Browse files Browse the repository at this point in the history
The initial skeleton of cuepls is based on gopls. Which means that there
is already support for .go, go.mod, and go.work files.

This CL adds support for .cue files alongside the existing file types.

More vestiges of Go (gopls) code will be removed in later CLs.

For #142

Signed-off-by: Paul Jolly <[email protected]>
Change-Id: Ia5028fbf7e27b3d48c9865ec803e3f73f0278f34
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1174176
Reviewed-by: Daniel Martí <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
myitcv committed Feb 14, 2024
1 parent 1ae88a6 commit 55f965d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/golangorgx/gopls/cache/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ func fileKind(fh file.Handle) file.Kind {
return file.Sum
case ".work":
return file.Work
case ".cue":
return file.CUE
}
return file.UnknownKind
}
Expand Down
6 changes: 6 additions & 0 deletions internal/golangorgx/gopls/file/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const (
Tmpl
// Work is a go.work file.
Work
// CUE is a CUE source file
CUE
)

func (k Kind) String() string {
Expand All @@ -38,6 +40,8 @@ func (k Kind) String() string {
return "tmpl"
case Work:
return "go.work"
case CUE:
return "cue"
default:
return fmt.Sprintf("internal error: unknown file kind %d", k)
}
Expand All @@ -58,6 +62,8 @@ func KindForLang(langID string) Kind {
return Tmpl
case "go.work":
return Work
case "cue":
return CUE
default:
return UnknownKind
}
Expand Down

0 comments on commit 55f965d

Please sign in to comment.