Skip to content

Jump-to-definition not working on Windows #98

Closed
rescript-lang/rescript-editor-support
#83
@mewhhaha

Description

@mewhhaha

(I didn't see an issue for this, so I guess it might be Windows specific?)

Given the following in a file Demo.res where Test is the module Test.res

Js.log(Test.x)

When doing CTRL + Mouse left click on Test I get:

Unable to open 'Test.res': Unable to read file '\\c:\Projects\rescript-project-template\src\Test.res' (Unknown (FileSystemError): Error: UNKNOWN: unknown error, stat '\\c:\Projects\rescript-project-template\src\Test.res').

I tried debugging in and got that in the definition case

} else if (msg.method === p.DefinitionRequest.method) {

I get the uri being sent

uri: result.definition.uri || msg.params.textDocument.uri,

to be
result.definition.uri = file://c:/Projects/rescript-project-template/src/Test.res
msg.params.textDocument.uri = file:///c%3A/Projects/rescript-project-template/src/Demo.res.

If I add an extra slash to the result.definition.uri so that it becomes file:/// (like the other uri) then it jumps to the definition properly.

I don't know what the best way to resolve this is, though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions