-
Notifications
You must be signed in to change notification settings - Fork 332
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
Expand Selection in comments for Scala 2 #6109
Expand Selection in comments for Scala 2 #6109
Conversation
the tests are successful, but how do I manually test it? Error downloading org.scalameta:mtags_2.12.18:1.2.1-SNAPSHOT |
I'm guessing you're referring to this: https://scalameta.org/metals/docs/contributors/getting-started/#manually-testing-an-lspsuite ? |
@kasiaMarek thanks, no I want to test metals plugin it in vscode for 2.13 and 3, does quick-publish-local make it work for major versions like 2.12, 2.13, 3? |
You can find all the quick publish versions here: Line 136 in e65409f
2.12.18 , 2.13.12 , and 3.3.1 are included.
|
thanks @kasiaMarek , able to test in 2.13 with Now it's weird that expand Selection in comments doesn't seem to work in vscode for manual testing while other tests are successful. I print some logs for ranges and it looks correct . @tgodzik could you help me verify if it works on your side? |
seems like a bug in vscode extention from vscode Devtools:
related to vscode API provideSelectionRanges |
@kasiaMarek @tgodzik shall we merge this first? unit test passed for this ,just that there's sth in the vscode plugin side that needs to be fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you generally clean this up a bit? There are some println
s and commented code left.
override def ignoreScalaVersion: Option[IgnoreScalaVersion] = | ||
None // Some(IgnoreScala2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's by default None
so you can delete that whole thing.
rg | ||
} | ||
|
||
def commentRangesFromTokens( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused?
thanks @kasiaMarek I cleaned them up, forget to do so previously |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just nitpicks, otherwise lgtm
.collect { case x: Comment => | ||
(x.start, x.end, x.pos) | ||
} | ||
.collect { | ||
case (commentStart, commentEnd, _) | ||
if commentStart <= cursorStartShifted && cursorStartShifted <= commentEnd => | ||
(commentStart + offsetStart, commentEnd + offsetStart) | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can merge this into a single collect.
mtags/src/main/scala-2/scala/meta/internal/pc/SelectionRangeProvider.scala
Outdated
Show resolved
Hide resolved
mtags/src/main/scala-2/scala/meta/internal/pc/SelectionRangeProvider.scala
Outdated
Show resolved
Hide resolved
…ovider.scala Co-authored-by: Katarzyna Marek <kasia@marek.net>
thanks @kasiaMarek I fix some of the nits, but some other tests from main failed so I can't merge:
|
fix #3615 for Scala 2