Skip to content

Commit ecdb19c

Browse files
committed
fix: java wont need nested symbols
1 parent 6ad1121 commit ecdb19c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lang/lsp/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func NewLSPClient(repo string, openfile string, wait time.Duration, opts ClientO
5656
return nil, err
5757
}
5858

59-
cli, err := initLSPClient(context.Background(), svr, NewURI(repo), opts.Verbose, opts.InitializationOptions)
59+
cli, err := initLSPClient(context.Background(), svr, NewURI(repo), opts.Verbose, opts.Language, opts.InitializationOptions)
6060
if err != nil {
6161
return nil, err
6262
}
@@ -122,7 +122,7 @@ func (c *LSPClient) InitFiles() {
122122
}
123123
}
124124

125-
func initLSPClient(ctx context.Context, svr io.ReadWriteCloser, dir DocumentURI, verbose bool, InitializationOptions interface{}) (*LSPClient, error) {
125+
func initLSPClient(ctx context.Context, svr io.ReadWriteCloser, dir DocumentURI, verbose bool, language uniast.Language, InitializationOptions interface{}) (*LSPClient, error) {
126126
h := newLSPHandler()
127127
stream := jsonrpc2.NewBufferedStream(svr, jsonrpc2.VSCodeObjectCodec{})
128128
conn := jsonrpc2.NewConn(ctx, stream, h)
@@ -143,7 +143,7 @@ func initLSPClient(ctx context.Context, svr io.ReadWriteCloser, dir DocumentURI,
143143
},
144144
"textDocument": map[string]interface{}{
145145
"documentSymbol": map[string]interface{}{
146-
"hierarchicalDocumentSymbolSupport": true,
146+
"hierarchicalDocumentSymbolSupport": (language != uniast.Java),
147147
},
148148
},
149149
}

0 commit comments

Comments
 (0)