diff --git a/internal/lsp/cache/view.go b/internal/lsp/cache/view.go index a6a02bfb4f..b2648157cf 100644 --- a/internal/lsp/cache/view.go +++ b/internal/lsp/cache/view.go @@ -247,6 +247,8 @@ func (v *View) FileKind(fh source.FileHandle) source.FileKind { return source.Mod case ".sum": return source.Sum + case ".work": + return source.Work } exts := v.Options().TemplateExtensions for _, ext := range exts { diff --git a/internal/lsp/source/util.go b/internal/lsp/source/util.go index 56974f22d1..a8fb592255 100644 --- a/internal/lsp/source/util.go +++ b/internal/lsp/source/util.go @@ -173,6 +173,8 @@ func FileKindForLang(langID string) FileKind { return Sum case "tmpl", "gotmpl": return Tmpl + case "go.work": + return Work default: return UnknownKind } @@ -188,6 +190,8 @@ func (k FileKind) String() string { return "go.sum" case Tmpl: return "tmpl" + case Work: + return "go.work" default: return fmt.Sprintf("unk%d", k) } diff --git a/internal/lsp/source/view.go b/internal/lsp/source/view.go index d7f4db1a71..08477e1e34 100644 --- a/internal/lsp/source/view.go +++ b/internal/lsp/source/view.go @@ -534,6 +534,8 @@ const ( Sum // Tmpl is a template file. Tmpl + // Work is a go.work file. + Work ) // Analyzer represents a go/analysis analyzer with some boolean properties