Skip to content

Commit

Permalink
Add stubs for inlay hint methods (LSP 3.17)
Browse files Browse the repository at this point in the history
The following are added manually to the generated code:
* inlayHint/resolve
* textDocument/inlayHint

Generating this code is currently not possible since the upstream gopls
generator was migrated from Typescript to Go just before the 3.17 LSP
release. Using the new generator requires some more work and adaptions
on our side.
  • Loading branch information
mliszcz committed Sep 28, 2023
1 parent 19df547 commit 22bdd83
Show file tree
Hide file tree
Showing 3 changed files with 212 additions and 5 deletions.
161 changes: 161 additions & 0 deletions internal/lsp/protocol/tsprotocol.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 41 additions & 3 deletions internal/lsp/protocol/tsserver.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions internal/lsp/server_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ import (
"github.com/nokia/ntt/internal/lsp/protocol"
)

func (s *Server) Resolve(ctx context.Context, params *protocol.InlayHint) (*protocol.InlayHint, error) {
return nil, notImplemented("Resolve")
}

func (s *Server) InlayHint(ctx context.Context, params *protocol.InlayHintParams) ([]protocol.InlayHint, error) {
return nil, notImplemented("InlayHint")
}

func (s *Server) CodeAction(context.Context, *protocol.CodeActionParams) ([]protocol.CodeAction, error) {
return nil, notImplemented("CodeAction")
}
Expand Down Expand Up @@ -168,8 +176,8 @@ func (s *Server) Rename(context.Context, *protocol.RenameParams) (*protocol.Work
return nil, notImplemented("Rename")
}

func (s *Server) Resolve(context.Context, *protocol.CompletionItem) (*protocol.CompletionItem, error) {
return nil, notImplemented("Resolve")
func (s *Server) ResolveCompletionItem(context.Context, *protocol.CompletionItem) (*protocol.CompletionItem, error) {
return nil, notImplemented("ResolveCompletionItem")
}

func (s *Server) ResolveCodeAction(context.Context, *protocol.CodeAction) (*protocol.CodeAction, error) {
Expand Down

0 comments on commit 22bdd83

Please sign in to comment.