Skip to content

Upgrade IDE dependencies, release vscode-dotty 0.1.5 #4828

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 2 commits into from
Jul 25, 2018

Conversation

smarter
Copy link
Member

@smarter smarter commented Jul 23, 2018

On the server side, uses of lsp4j.MarkedString were replaced by
lsp4j.MarkupContent since the former is deprecated (and seems to cause
some rendering bugs with the updated dependencies).

@smarter smarter requested a review from allanrenucci July 23, 2018 20:41
@smarter smarter force-pushed the release/vscode-dotty-0.1.5 branch from cbf2209 to 030a2f8 Compare July 23, 2018 20:41
Copy link
Contributor

@allanrenucci allanrenucci left a comment

Choose a reason for hiding this comment

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

I'll defer to @Duhemm for the code that has to do with rendering and testing the comments in the IDE

markup.setValue(
s"""```scala
|$typeInfo
|$docMarkup```""".stripMargin.stripLineEnd)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why stripLineEnd? Also shouldn't the ``` be on a new line?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, fixed.

else {
val symbol = Interactive.enclosingSourceSymbol(trees, pos)
val docComment = ctx.docCtx.flatMap(_.docstring(symbol))
val markedStrings = docMarkedStrings(docComment, tpw.show.toString)
new Hover(markedStrings.map(JEither.forRight(_)).asJava, null)
val content = hoverContent(tpw.show.toString, docComment)
Copy link
Contributor

Choose a reason for hiding this comment

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

toString redundant after show?

On the server side, uses of lsp4j.MarkedString were replaced by
lsp4j.MarkupContent since the former is deprecated (and seems to cause
some rendering bugs with the updated dependencies).
@smarter smarter force-pushed the release/vscode-dotty-0.1.5 branch from 030a2f8 to e626618 Compare July 23, 2018 21:23
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.

Apart from that, LGTM.

s"""```scala
|$typeInfo
|$comment
|```"""
Copy link
Contributor

Choose a reason for hiding this comment

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

There used to be a thin line that separated the type info from the comment. It would be nice to re-introduce it, since it makes the hover information easier to read:

case Some(comment) =>
  s"""```scala
     |$typeInfo
     |```
     |---
     |```scala
     |$comment
     |```"""

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried that but that's not equivalent to the thin line we had before: it adds a really thick line which I find distracting

Copy link
Member Author

Choose a reason for hiding this comment

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

There's an issue for this: microsoft/language-server-protocol#518

@smarter
Copy link
Member Author

smarter commented Jul 24, 2018

I'm going to merge this, however I won't release 0.1.5 until the next Dotty release: it looks like recent version of vscode-languageclient do not agree with LSP4J on how to read the content of MarkedString in hover responses, the result is that when using vscode-dotty 0.1.5 with Dotty 0.9.0-RC1, the hover messages just displays [object Object]. We could try to figure out if this is a bug in vscode-languageclient but it won't matter once we release a version of the Dotty Language Server with this PR in, since I removed usages of MarkedString, so it doesn't seem worth the effort. We could release 0.9.0-RC2 with this PR backported but that also doesn't seem worth it.

@smarter smarter merged commit 859c5db into scala:master Jul 25, 2018
@allanrenucci allanrenucci deleted the release/vscode-dotty-0.1.5 branch July 25, 2018 13:56
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.

3 participants