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

Extra info now checks doc #424

Merged
merged 2 commits into from
Aug 16, 2016
Merged

Extra info now checks doc #424

merged 2 commits into from
Aug 16, 2016

Conversation

abarisain
Copy link
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

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
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
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
Contributor Author

The only failing tests are gometalinter's

@mattetti
Copy link
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.

let hover = new Hover({ language: 'go', value: text });
let hoverTexts = [];
if (definitionInfo.doc != null) {
hoverTexts.push({ language: null, value: definitionInfo.doc});
Copy link
Contributor

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
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
Contributor

Thanks for this - big improvement.

@abarisain
Copy link
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