Skip to content

vscode-dotty: Fix hover functionality with old language server #5162

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

Merged
merged 3 commits into from
Sep 26, 2018

Conversation

smarter
Copy link
Member

@smarter smarter commented Sep 25, 2018

No description provided.

@smarter smarter requested a review from Duhemm September 25, 2018 19:28
@smarter
Copy link
Member Author

smarter commented Sep 25, 2018

This can be easily tested by running in sbt:

vscode-dotty/run /path/to/dotty-example-project

and trying to hover over something

@smarter smarter added this to the 0.10 Tech Preview milestone Sep 26, 2018
Copy link
Contributor

@Duhemm Duhemm left a comment

Choose a reason for hiding this comment

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

LGTM, feel free address or ignore my nitpick.

The current unreleased version of vscode-dotty depends on a new version
of vscode-languageclient which parses hover messages in a stricter way,
and Dotty Language Server <= 0.9.x sends incorrect hover messages due to
a bug in lsp4j. The end result is that when using the current
vscode-dotty on a project with an old version of dotty, the hover shows
"[object Object]" instead of showing the type and documentation.

This commit works around this by manually parsing the hover message when
the server version is too old.
@smarter smarter merged commit 5e91f77 into scala:master Sep 26, 2018
@allanrenucci allanrenucci deleted the fix-vscode-compat branch September 26, 2018 21:34
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