Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Intellisense filters comments from structure definitions; should be optional #1550

Closed
dmick opened this issue Mar 2, 2018 · 8 comments
Closed

Comments

@dmick
Copy link
Contributor

dmick commented Mar 2, 2018

I see that https://github.com/Microsoft/vscode-go/blob/master/src/goExtraInfo.ts#L32 intentionally filters lines starting with "\t//", which means comments in structure definitions don't show up on rollover. I think this behavior is undesirable and would like to petition for it to be made optional; the comments are what define the behavior and use of the fields, which is important info, especially in unfamiliar code where Intellisense does the most good.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Mar 4, 2018

Fair enough. Feel free to send a PR to remove that line. I wouldn't make it optional though. Let's make the change and see if there is user feedback to go back to the old model of not wanting to see the comments

By default we use a combination of godef+godoc tools to get the information that is shown on hover. Users can change this by either setting go.docsTool to gogetdoc or by setting go.languageServer to true

godef does not return the lines that have only comments. So even if you make change removing https://github.com/Microsoft/vscode-go/blob/master/src/goExtraInfo.ts#L32, there won't be any difference. But, if you choose to use gogetdoc, your change will result in the comments showing up on hover. If you choose to use the language server, it already shows the comments on hover

@dmick
Copy link
Contributor Author

dmick commented Mar 5, 2018

Yes, I noticed the behavior after trying to circumvent it with go.docsTool == gogetdoc, although, the comment filtering seems to be independent of tool?... I don't know anything about the language server so will look.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Mar 5, 2018

The comment filtering done in this extension is independent of the tool, so you can just remove it.
The language server doesnt need any changes, it already shows the line with comments

More on language server here: https://github.com/Microsoft/vscode-go#go-language-server-experimental

@dmick
Copy link
Contributor Author

dmick commented Mar 5, 2018

OK, concur, removing the filtering will only affect 'gogetdoc'.

@dmick
Copy link
Contributor Author

dmick commented Mar 6, 2018

I can't seem to run the tests, even on the unmodified master, and I'm not sure what I'm doing wrong. Either launching from within 'code .' as documented or running 'npm test', I get "TypeError: Path must be a string. Received undefined"

I'm sure it's something to do with my environment, but, how to tell what?

@dmick
Copy link
Contributor Author

dmick commented Mar 6, 2018

(and is there an appropriate chat forum for such difficulties?)

@ramya-rao-a
Copy link
Contributor

TypeError: Path must be a string. Received undefined

Do you have GOPATH set as an env var? The tests dont run if there is no GOPATH set as env var.

(and is there an appropriate chat forum for such difficulties?)

You can either ask the question here or on gitter or on the vscode channel in Gophers Slack

@ramya-rao-a
Copy link
Contributor

This feature is now available in the latest update (0.6.78) to the Go extension

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants