-
Notifications
You must be signed in to change notification settings - Fork 645
Conversation
@theSoenke, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code at present has linting errors which is breaking the build. Run npm run lint
and you can see the list of errors.
For the guru errors you are seeing, see #726 (comment)
src/goCodelens.ts
Outdated
includeDeclaration: false | ||
}; | ||
let position = symbol.location.range.start; | ||
if (symbol.kind === vscode.SymbolKind.Function) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here as to why 5 is being added? Helps the next person reading this code :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point :)
src/goReferences.ts
Outdated
@@ -19,7 +19,7 @@ export class GoReferenceProvider implements vscode.ReferenceProvider { | |||
}); | |||
} | |||
|
|||
private doFindReferences(document: vscode.TextDocument, position: vscode.Position, options: { includeDeclaration: boolean }, token: vscode.CancellationToken): Thenable<vscode.Location[]> { | |||
public doFindReferences(document: vscode.TextDocument, position: vscode.Position, options: { includeDeclaration: boolean }, token: vscode.CancellationToken): Thenable<vscode.Location[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am guessing the reason you are using doFindReferences
instead of provideReferences
is because the latter does a saveAll
before finding the references.
My another guess for why saveAll
was put in place was because guru
was made to run on saved files.
Now that we have guru
working on unsaved files as well (with the -modified flag), lets remove the saveAll
that happens in provideReferences
and you can use it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, saveAll was the reason for that. Removed saveAll
and set provideReferences
back to private
For the slowness issue, have you considered using resolveCodeLens ? |
Looks like resolveCodeLens could make a lot sense here. I will look into it. |
@theSoenke I have merged the PR, but please continue looking at the |
@ramya-rao-a Great! I've submitted a PR to use |
This PR adds support for reference codelenses as discussed in #726
There are still a few issues: