Skip to content

gopls: treat custom build tags as standaloneTags - #1379

Merged
visualfc merged 1 commit into
masterfrom
feat/gopls-standalone-tags
Nov 14, 2026
Merged

visualfc merged 1 commit into
masterfrom
feat/gopls-standalone-tags

Conversation

@visualfc

Copy link
Copy Markdown
Owner

Summary

  • Collect custom //go:build and // +build tags from open Go files and send them to gopls as standaloneTags.
  • Advertise workspace applyEdit / configuration capabilities and answer workspace/configuration with the current gopls settings.
  • When gopls reports no package metadata for file, add that file's tags, update configuration, and reopen the document.

Test plan

  • Open a Go file with a custom tag such as //go:build tools or //go:build ignore.
  • Confirm gopls log shows standaloneTags including that tag and no repeated no package metadata spam.
  • Confirm completion and diagnostics still work for ordinary package files.

Parse //go:build and // +build constraints, send them to gopls as
standaloneTags, and reopen files after missing package metadata so
tagged files still get completion and diagnostics.
@visualfc
visualfc merged commit c44b054 into master Nov 14, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant