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

Implement show hover #577

Merged
merged 3 commits into from
Aug 5, 2022
Merged

Implement show hover #577

merged 3 commits into from
Aug 5, 2022

Conversation

sneznaj
Copy link
Contributor

@sneznaj sneznaj commented Aug 5, 2022

Fixes #199

@5nord 5nord requested a review from moosq August 5, 2022 09:58
internal/lsp/hover.go Outdated Show resolved Hide resolved
log.Debug(fmt.Sprintf("No expression at %s:%d:%d\n", file, line, col))
}

comment := ast.FirstToken(x).Comments()
Copy link
Member

Choose a reason for hiding this comment

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

Using the first token of the cursor position is sufficient for an initial hover implementation.

A nice followup PR would be using the first token of the parent ast.Stmt, *ast.ModuleDef, *ast.Module.

internal/lsp/hover.go Outdated Show resolved Hide resolved
internal/lsp/server_gen.go Outdated Show resolved Hide resolved
@5nord 5nord merged commit f2f9dfd into nokia:master Aug 5, 2022
@5nord
Copy link
Member

5nord commented Aug 5, 2022

Thank you very much, @sneznaj

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.

Implement show hover
3 participants