-
Notifications
You must be signed in to change notification settings - Fork 24
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
Jump to definition doesn't work on Windows #688
Comments
Here is the kiama code that computes the source file location: def locationOfNode(node: N): Location = {
(positions.getStart(node), positions.getFinish(node)) match {
case (start @ Some(st), finish @ Some(_)) =>
st.source match {
case StringSource(_, name) =>
val s = convertPosition(start)
val f = convertPosition(finish)
new Location(name, new LSPRange(s, f))
case _ =>
null
}
case _ =>
null
}
} It just returns the path and shouldn't mess with it. The constructor of The URI should be introduced here: @JsonNotification("textDocument/didSave")
def didSave(params: DidSaveTextDocumentParams): Unit = {
process(params.getTextDocument.getUri, params.getText)
} which ends up invoking def compileString(name: String, input: String, config: C): Unit = {
compileSource(StringSource(input, name), config)
} which in turn ends up calling
on the string source. |
Here is a gem, that I didn't know about: effekt/effekt/jvm/src/main/scala/effekt/Server.scala Lines 99 to 107 in 898c86c
Not sure this is related to the bug, though. However, this should be a source of bugs on windows since it doesn't use path separator, but literal |
@jiribenes do you know whether this also happens when jumping to definition within the same file? |
Jumping to definitions within the same file works without a problem |
On Windows, jumping to definition in VSCode doesn't work correctly.
When it should jump to file:
it instead tries to jump to file with a trailing slash:
Unfortunately, this tends to confuse VSCode so that it thinks it's an invalid folder.
I'm not sure it's a VSCode bug per se, that's why I'm filing the issue here (since I think it might be an LSP issue).
As a workaround, we could just always remove trailing slashes, I think? 🤔
The text was updated successfully, but these errors were encountered: