-
Notifications
You must be signed in to change notification settings - Fork 645
Use the newly added receiver output from godef to get the correct documentation #2223
Conversation
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.
If -r
is not supported by the user's version of godef
, then we should fall back to running godef
without it. See https://github.com/Microsoft/vscode-go/blob/latest/src/goDeclaration.ts#L170 as a reference of how we do something similar when the -tags
flag of gogetdoc
is not supported.
Since this code path is very often visited (hover info and go to definition feature are most commonly used features), we can also look at having a variable that tracks if the -r
flag is supported so that we can avoid seeing the error each time in the same VS Code session.
Regarding the prompt to update the tool, I do have it in all other cases of unsupported flags, but I wonder if we should skip it in this case.
In other cases, the missing flag was important to the feature in question.
Here, this flag is only important when the user is dealing with receivers.
Also, the unit tests are failing. Can you take a look at that?
Receivers are really common, I think it's best to have the user update IMHO. A variable will cause us to not use |
a1f0200
to
e2ec688
Compare
About https://github.com/Microsoft/vscode-go/blob/latest/src/goDeclaration.ts#L170... Does that even work?, It's a return inside the |
I do recall testing this but now that I look at the code, I am doubtful. It should most likely be
|
I take back my objection for keeping the prompt for updating the tool. At this point, But we do need the fallback to running without |
11df4b5
to
b8c0491
Compare
@ramya-rao-a Oh noes.... The PR for godef wasn't merged yet! Like this, it's just going to request people to update godef ad nauseum... |
@segevfiner I trusted you!!!! Lol, kidding. I should have checked if the upstream PR was merged or not. |
I did add a warning about this in the PR description, guess it didn't stand out enough enough. 🤷♂️ |
Use the newly added receiver output from godef to get the correct documentation
See rogpeppe/godef#105
Part of #2107