Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for function docs in hover #495

Merged
merged 5 commits into from
Jan 28, 2022

Conversation

TwitchBronBron
Copy link
Member

@TwitchBronBron TwitchBronBron commented Jan 26, 2022

This shows the function documentation comments when hovering over a function.

Here's an example:
image

All comments will be parsed as markdown.

@TwitchBronBron TwitchBronBron marked this pull request as ready for review January 27, 2022 21:34
@@ -893,16 +893,6 @@ export class LanguageServer {

//return the first non-falsey hover. TODO is there a way to handle multiple hover results?
let hover = hovers.filter((x) => !!x)[0];

//TODO improve this to support more than just .brs files
Copy link
Member Author

Choose a reason for hiding this comment

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

This was forcing all hovers to be brightscript...but we need to support any documentation information provided, so force the underlying files to provide the full markdown text instead of casting it all here.

@TwitchBronBron TwitchBronBron merged commit 406b736 into master Jan 28, 2022
@TwitchBronBron TwitchBronBron deleted the feat/hover-func-markdown branch January 28, 2022 14:58
@livecano
Copy link

@TwitchBronBron, does the documentation has to be in a specific format? do you have a code snippet with a sample?

@TwitchBronBron
Copy link
Member Author

@livecano as of right now, it just reads every comment statement between functions. For example:

'I'm shown for one()
sub one()
end sub
' I'm shown for two()
' I'm shown also for two()

'I'm shown for two() as well
sub two()
end sub

Copy link

@livecano livecano left a comment

Choose a reason for hiding this comment

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

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants