Closed ckipp01 closed 1 year ago
Thanks for reporting. Can you consistently reproduce it? I wasn't able to do that:
Just checked and yea, I can reproduce this consistently. Here is the exact trace:
[Trace - 04:50:34 PM] Received request 'textDocument/documentHighlight - (15)'
Params: {
"textDocument": {
"uri": "file:///Users/ckipp/Documents/scala-workspace/minimal/.metals/readonly/dependencies/scala-library-2.13.10-sources.jar/scala/concurrent/Future.scala"
},
"position": {
"line": 448,
"character": 11
}
}
[Trace - 04:50:34 PM] Sending response 'textDocument/documentHighlight - (15)'. Processing request took 13ms
Result: [
{
"range": {
"start": {
"line": 448,
"character": 10
},
"end": {
"line": 449,
"character": 5
}
},
"kind": 3
}
]
Does it look the same in VS Code? Maybe it's just a highlighting thing and VS Code doesn't actually highlight the space so you never noticed?
Might be the same issue as https://github.com/scalameta/metals/issues/5840 :thinking: Let me double check if anything is sent.
It looks like VS Code doesn't even send a request in that case. I think we have some kind of synthetic there, that we should ignore.
Describe the bug
I noticed today while browsing some code in
Future.scala
in the standard lib that thedocumentHighlight
response wasn't really what I was expecting. The range that was returned was more than just the=>
causing highlighting in my editor to look a bit funky. I have a screenshot below explaining what I mean.The actual response looks like this:
You can reproduce this by navigating to
fallBackTo
inFuture.scala
.Expected behavior
I would expect the range to only include
=>
and not to go onto the next line.Operating system
macOS
Editor/Extension
Nvim (nvim-metals)
Version of Metals
1.1.0+69-c68474d9-SNAPSHOT
Extra context or search terms
No response