vscode-scala-syntax icon indicating copy to clipboard operation
vscode-scala-syntax copied to clipboard

vscode: Using "Selection->Expand Selection" selects wrong scope

Open fkoehler opened this issue 6 years ago • 3 comments

I am not sure if this issue belongs to this repo or should live somewhere else. I am using metals with vscode and find the expand selection for scala code to be quite greedy. Here is an example snippet:

object Test {
  val foo = "bar"
  def call(s: String, s: String): Unit = ???
}

object Scope {
  Test.call(Test.foo, Test.foo)
}

Putting the cursor on the Test object name inside the Test.call call and using Selection->Expand Selection it selects first the Test object which is correct, but then the entire parentheses block and not just the member foo.

Result: image

Expected: image

If it is in this repo where is a starting point to look? Maybe I can figure the error out

fkoehler avatar Sep 04 '19 11:09 fkoehler

This is probably an issue with the language sever. Check the issue could come from

  • https://github.com/scalameta/metals
  • https://github.com/lampepfl/dotty/tree/master/vscode-dotty

nicolasstucki avatar Sep 17 '19 13:09 nicolasstucki

Otherwise could be related with https://github.com/scala/vscode-scala-syntax/blob/master/language-configuration.json

nicolasstucki avatar Sep 17 '19 13:09 nicolasstucki

This is quite annoying,do we have any updates now?

doofin avatar Feb 06 '22 23:02 doofin