Skip to content

Commit efb762d

Browse files
committed
store initializeParams on initailisation
Signed-off-by: Tobias Guggenmos <[email protected]>
1 parent 463023c commit efb762d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

langserver/codeLens.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ import (
2020

2121
// CodeLens is required by the protocol.Server interface.
2222
func (s *server) CodeLens(_ context.Context, _ *protocol.CodeLensParams) ([]protocol.CodeLens, error) {
23-
// As of version 0.4.0 of gopls it is not possible to instruct the language
24-
// client to stop asking for Code Lenses and Document Links. To prevent
25-
// VS Code from showing error messages, this feature is implemented by
26-
// returning empty values.
23+
2724
return nil, nil
2825
}

langserver/general.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
// Initialize handles a call from the client to initialize the server.
2525
// Required by the protocol.Server interface.
26-
func (s *server) Initialize(_ context.Context, _ *protocol.ParamInitialize) (*protocol.InitializeResult, error) {
26+
func (s *server) Initialize(_ context.Context, paramInitialize *protocol.ParamInitialize) (*protocol.InitializeResult, error) {
2727
s.stateMu.Lock()
2828
defer s.stateMu.Unlock()
2929

@@ -35,6 +35,8 @@ func (s *server) Initialize(_ context.Context, _ *protocol.ParamInitialize) (*pr
3535

3636
s.cache.Init()
3737

38+
s.initializeParams = paramInitialize.InitializeParams
39+
3840
return &protocol.InitializeResult{
3941
Capabilities: protocol.ServerCapabilities{
4042
TextDocumentSync: &protocol.TextDocumentSyncOptions{

langserver/server.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ type server struct {
5454
Conn *jsonrpc2.Conn
5555
client protocol.Client
5656

57-
state serverState
58-
stateMu sync.Mutex
57+
state serverState
58+
stateMu sync.Mutex
59+
initializeParams protocol.InitializeParams
5960

6061
cache cache.DocumentCache
6162

0 commit comments

Comments
 (0)