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

Extra info now checks doc#424

Merged
lukehoban merged 2 commits intomicrosoft:masterfrom
abarisain:hover
Aug 16, 2016
Merged

Extra info now checks doc#424
lukehoban merged 2 commits intomicrosoft:masterfrom
abarisain:hover

Conversation

@abarisain
Copy link
Copy Markdown
Contributor

@abarisain abarisain commented Aug 11, 2016

This patch enables godoc provided documentation on function hover.

capture

I have no idea why this was implemented but not enabled. Was there any reason?
This may not be desirable since it runs two programs on hover, and can be improved in a followup PR to use gogetdoc. That said, these processes are called everytime the developer writes a function call, which happens (at least for me) way less often than hovering a method.

It's also better than the documentation on parenthesis open, since it is not truncated.
Note that this does not enable the godoc in resolveCompletionItem, that may come in another PR :)

Fixes #87

@msftclas
Copy link
Copy Markdown

Hi @abarisain, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by Microsoft and real humans are currently evaluating your PR.

TTYL, MSBOT;

This will possibly break if Println's documentation ever changes
Comment thread test/go.test.ts
standard output. Spaces are always added between operands and a newline
is appended. It returns the number of bytes written and any write error
encountered.
`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I really like how templates strings break indentation, but it does not destroy the file's column count that way

@abarisain
Copy link
Copy Markdown
Contributor Author

The only failing tests are gometalinter's

@mattetti
Copy link
Copy Markdown
Contributor

+1 I tested it locally and it works great. I believe that's the expected behavior and the way it works when editing TS.

Comment thread src/goExtraInfo.ts
let hover = new Hover({ language: 'go', value: text });
let hoverTexts = [];
if (definitionInfo.doc != null) {
hoverTexts.push({ language: null, value: definitionInfo.doc});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that passing this as a string will format in a slightly different way which matches what other extensions do: https://github.com/Microsoft/vscode/search?utf8=%E2%9C%93&q=%22new+Hover%22

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that, didn't notice that there was a simple string constructor for this

@lukehoban lukehoban merged commit 97da99d into microsoft:master Aug 16, 2016
@lukehoban
Copy link
Copy Markdown
Member

Thanks for this - big improvement.

@abarisain
Copy link
Copy Markdown
Contributor Author

Thanks for merging :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add godoc to hover provider

4 participants