Skip to content

Commit eb5d94e

Browse files
committed
fix(lsp): cache definition
1 parent fcb9b3a commit eb5d94e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lang/lsp/lsp.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,11 @@ func (cli *LSPClient) Definition(ctx context.Context, uri DocumentURI, pos Posit
387387
if err != nil {
388388
return nil, err
389389
}
390+
if f.Definitions != nil {
391+
if locations, ok := f.Definitions[pos]; ok {
392+
return locations, nil
393+
}
394+
}
390395

391396
// call
392397
req := lsp.TextDocumentPositionParams{

0 commit comments

Comments
 (0)