The gopls protocol package includes logic that would be useful for other language server implementations. There is already a go.lsp.dev/protocol package that contains significant overlap with the version of protocol included in gopls, and is depended on by several other LSP implementations for other languages that are written in Go.
Proposal would be to align gopls/internal/lsp/protocol with go.lsp.dev/protocol:
go.lsp.dev/protocol appears to be manually maintained. The auto generation logic in gopls/internal/lsp/protocol could be moved there and go.lsp.dev/protocol becomes the single source of truth for all type and interface definitions.
- mappers and other logic for manipulating LSP related types could also be consolidated with
go.lsp.dev/protocol as long as they are not go-specific
- What's left should mainly be go-specific and could then become a "go-protocol" package that is make external
The gopls
protocolpackage includes logic that would be useful for other language server implementations. There is already a go.lsp.dev/protocol package that contains significant overlap with the version of protocol included in gopls, and is depended on by several other LSP implementations for other languages that are written in Go.Proposal would be to align
gopls/internal/lsp/protocolwithgo.lsp.dev/protocol:go.lsp.dev/protocolappears to be manually maintained. The auto generation logic ingopls/internal/lsp/protocolcould be moved there andgo.lsp.dev/protocolbecomes the single source of truth for all type and interface definitions.go.lsp.dev/protocolas long as they are not go-specific