jaredly / jaredly/reason-language-server
Jump to definition is broken (Windows)
- Dominant language
- OCaml
- Stars
- 649
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
Trying to Ctrl+Click on any function shows up an error like this on Windows:

Here's the logs for immediately opening a file and Ctrl+Click
(I'm guessing it's because `:` is encoded as `%3A` in the URI property of the message from the server?)
```
Hello - from c:\Users\sharno\.vscode\extensions\jaredly.reason-vscode-1.7.8\bin.native.exe.hot.exe
Previous log location: C:\Users\sharno\AppData\Local\Temp\lsp.log
Sending notification {"jsonrpc": "2.0", "method": "client/registerCapability", "params": {"registrations": [{"id": "watching", "method": "workspace/didChangeWatchedFiles", "registerOptions": {"watchers": [{"globPattern": "**/bsconfig.json"}, {"globPattern": "**/.merlin"}]}}]}}
Sending response {"id": 0, "jsonrpc": "2.0", "result": {"capabilities": {"textDocumentSync": 1, "hoverProvider": true, "completionProvider": {"resolveProvider": true, "triggerCharacters": ["."]}, "signatureHelpProvider": {"triggerCharacters": ["("]}, "definitionProvider": true, "typeDefinitionProvider": true, "referencesProvider": true, "documentSymbolProvider": true, "codeActionProvider": true, "executeCommandProvider": {"commands": ["reason-language-server.add_to_interface_inner"]}, "codeLensProvider": {"resolveProvider": true}, "documentHighlightProvider": true, "documentRangeFormattingProvider": true, "documentFormattingProvider": true, "renameProvider": true}}}
Read message
{"jsonrpc":"2.0","method":"initialized","params":{}}
Read message
{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"reason_language_server":{"location":"","build_system_override_by_root":{},"refmt":"","lispRefmt":"","mlfmt":"","format_width":80,"per_value_codelens":false,"dependencies_codelens":true,"opens_codelens":true,"show_module_path_on_hover":true,"reloadOnChange":false,"show_debug_errors":false,"autoRebuild":true}}}}
Read message
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re","languageId":"reason","version":8,"text":"[@react.component]\nlet make = (~children) => {\n let (show, setShow) = React.useState(() => true);\n\n // Notice that instead of `useEffect`, we have `useEffect0`. See\n // reasonml.github.io/reason-react/docs/en/components#hooks for more info\n React.useEffect0(() => {\n let id =\n Js.Global.setInterval(\n () => setShow(previousShow => !previousShow),\n 1000,\n );\n\n Some(() => Js.Global.clearInterval(id));\n });\n\n let style =\n if (show) {\n ReactDOMRe.Style.make(~opacity=\"1\", ~transition=\"opacity 1s\", ());\n } else {\n ReactDOMRe.Style.make(~opacity=\"0\", ~transition=\"opacity 1s\", ());\n };\n\n
📣 📣 NEW BSB PACKAGE 📣 📣
- location: c:\Users\sharno\projects\mockingbird\client
- bsPlatform: c:\Users\sharno\projects\mockingbird\client\node_modules\bs-platform
- buildSystem: bsb version 7.2.2
- build command: c:\Users\sharno\projects\mockingbird\client\node_modules\bs-platform\win32\bsb.exe -make-world
>> Build system running: c:\Users\sharno\projects\mockingbird\client\node_modules\bs-platform\win32\bsb.exe -make-world
>>> stdout
bsb: no work to do.
bsb: no work to do.
>>> stderr
Affected files:
Cleaning bsconfig.json
Sending notification {"jsonrpc": "2.0", "method": "textDocument/publishDiagnostics", "params": {"uri": "file://c:/Users/sharno/projects/mockingbird/client/bsconfig.json", "diagnostics": []}}
Deps reason-react
Dep loc c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\bsconfig.json
Compiled base: c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\lib\bs
Source directories: c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src
Source files found: c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\React.re : c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReactDOMRe.re : c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReactDOMServerRe.re : c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReactEvent.re : c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReactEvent.rei : c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReactEventRe.re : c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReactEventRe.rei : c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReasonReact.re : c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReasonReact.rei : c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReasonReactCompat.re : c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReasonReactCompat.rei : c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReasonReactOptimizedCreateClass.re : c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReasonReactRouter.re : c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReasonReactRouter.rei
Adding intf c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReactEvent.rei
Adding intf c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReactEventRe.rei
Adding intf c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReasonReact.rei
Adding intf c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReasonReactCompat.rei
Adding intf c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReasonReactRouter.rei
Bad source file (extension) c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReactEvent.rei
Bad source file (extension) c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReactEventRe.rei
Bad source file (extension) c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReasonReact.rei
Bad source file (extension) c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReasonReactCompat.rei
Bad source file (extension) c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\ReasonReactRouter.rei
Got source directories .\src - .\src\BlinkingGreeting - .\src\FetchedDogPictures - .\src\ReasonUsingJSUsingReason - .\src\ReducerFromReactJSDocs
Source directories: c:\Users\sharno\projects\mockingbird\client\src - c:\Users\sharno\projects\mockingbird\client\src\BlinkingGreeting - c:\Users\sharno\projects\mockingbird\client\src\FetchedDogPictures - c:\Users\sharno\projects\mockingbird\client\src\ReasonUsingJSUsingReason - c:\Users\sharno\projects\mockingbird\client\src\ReducerFromReactJSDocs
Source files found: c:\Users\sharno\projects\mockingbird\client\src\BlinkingGreeting\BlinkingGreeting.re : c:\Users\sharno\projects\mockingbird\client\src\ExampleStyles.re : c:\Users\sharno\projects\mockingbird\client\src\FetchedDogPictures\FetchedDogPictures.re : c:\Users\sharno\projects\mockingbird\client\src\Index.re : c:\Users\sharno\projects\mockingbird\client\src\ReasonUsingJSUsingReason\ReasonReactCard.re : c:\Users\sharno\projects\mockingbird\client\src\ReasonUsingJSUsingReason\ReasonUsingJSUsingReason.re : c:\Users\sharno\projects\mockingbird\client\src\ReducerFromReactJSDocs\ReducerFromReactJSDocs.re
adding namespace ReasonReactExamples : ReasonReactExamples : c:\Users\sharno\projects\mockingbird\client\lib\bs\ReasonReactExamples.cmt
-- All local modules found: 8
ReasonReactExamples
impl c:\Users\sharno\projects\mockingbird\client\lib\bs\ReasonReactExamples.cmt
BlinkingGreeting-ReasonReactExamples
impl c:\Users\sharno\projects\mockingbird\client\lib\bs\src\BlinkingGreeting\BlinkingGreeting-ReasonReactExamples.cmt
ExampleStyles-ReasonReactExamples
impl c:\Users\sharno\projects\mockingbird\client\lib\bs\src\ExampleStyles-ReasonReactExamples.cmt
FetchedDogPictures-ReasonReactExamples
impl c:\Users\sharno\projects\mockingbird\client\lib\bs\src\FetchedDogPictures\FetchedDogPictures-ReasonReactExamples.cmt
Index-ReasonReactExamples
impl c:\Users\sharno\projects\mockingbird\client\lib\bs\src\Index-ReasonReactExamples.cmt
ReasonReactCard-ReasonReactExamples
impl c:\Users\sharno\projects\mockingbird\client\lib\bs\src\ReasonUsingJSUsingReason\ReasonReactCard-ReasonReactExamples.cmt
ReasonUsingJSUsingReason-ReasonReactExamples
impl c:\Users\sharno\projects\mockingbird\client\lib\bs\src\ReasonUsingJSUsingReason\ReasonUsingJSUsingReason-ReasonReactExamples.cmt
ReducerFromReactJSDocs-ReasonReactExamples
impl c:\Users\sharno\projects\mockingbird\client\lib\bs\src\ReducerFromReactJSDocs\ReducerFromReactJSDocs-ReasonReactExamples.cmt
############ Namespaced as ReasonReactExamples at c:\Users\sharno\projects\mockingbird\client\lib\bs\ReasonReactExamples.cmt
Dependency dirs c:\Users\sharno\projects\mockingbird\client\node_modules\bs-platform\lib\ocaml c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\lib\bs\src
Running diagnostics for file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re
➡️ running compiler c:\Users\sharno\projects\mockingbird\client\node_modules\bs-platform\win32\bsc.exe -c -I "c:\Users\sharno\projects\mockingbird\client\lib\bs" -I "c:\Users\sharno\projects\mockingbird\client\lib\bs\src" -I "c:\Users\sharno\projects\mockingbird\client\lib\bs\src\BlinkingGreeting" -I "c:\Users\sharno\projects\mockingbird\client\lib\bs\src\FetchedDogPictures" -I "c:\Users\sharno\projects\mockingbird\client\lib\bs\src\ReasonUsingJSUsingReason" -I "c:\Users\sharno\projects\mockingbird\client\lib\bs\src\ReducerFromReactJSDocs" -I "c:\Users\sharno\projects\mockingbird\client\node_modules\bs-platform\lib\ocaml" -I "c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\lib\bs\src" -I "c:\Users\sharno\projects\mockingbird\client\node_modules\bs-platform\lib\ocaml" -bin-annot -bs-no-builtin-ppx -open ReasonReactExamples -ppx "c:\Users\sharno\projects\mockingbird\client\node_modules\bs-platform\win32\bsc.exe -as-ppx -bs-jsx 3" -w +a-4-9-40-41-42-50-61-102 -bs-re-out -impl c:\Users\sharno\projects\mockingbird\client\node_modules\.lsp\BlinkingGreeting-ReasonReactExamples.ast with pwd c:\Users\sharno\projects\mockingbird\client
<< Replacing lastDefinitions for file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re
Sending notification {"jsonrpc": "2.0", "method": "textDocument/publishDiagnostics", "params": {"uri": "file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re", "diagnostics": []}}
Read message
{"jsonrpc":"2.0","id":1,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":[]}}}
[server] Got a method textDocument/codeAction
[server] processing took 0.ms
Sending response {"id": 1, "jsonrpc": "2.0", "result": null}
Read message
{"jsonrpc":"2.0","id":2,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re"}}}
[server] Got a method textDocument/documentSymbol
[server] processing took 0.ms
Sending response {"id": 2, "jsonrpc": "2.0", "result": [{"name": "make", "kind": 12, "location": {"range": {"start": {"line": 0, "character": 0}, "end": {"line": 24, "character": 1}}, "uri": "file://"}}]}
Read message
{"jsonrpc":"2.0","id":3,"method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re"},"position":{"line":2,"character":32}}}
[server] Got a method textDocument/documentHighlight
[server] processing took 0.ms
[ref] Got a loc for pos
Sending response {"id": 3, "jsonrpc": "2.0", "result": [{"range": {"start": {"line": 2, "character": 30}, "end": {"line": 2, "character": 38}}, "kind": 2}]}
Read message
{"jsonrpc":"2.0","id":4,"method":"textDocument/codeLens","params":{"textDocument":{"uri":"file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re"}}}
[server] Got a method textDocument/codeLens
[server] processing took 0.ms
Sending response {"id": 4, "jsonrpc": "2.0", "result": [{"range": {"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}}, "command": {"title": "Dependencies: React, ReactDOMRe, Js, Js_internalOO, Pervasives", "command": ""}}]}
Read message
{"jsonrpc":"2.0","id":5,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re"},"range":{"start":{"line":2,"character":32},"end":{"line":2,"character":32}},"context":{"diagnostics":[]}}}
[server] Got a method textDocument/codeAction
[server] processing took 0.ms
Sending response {"id": 5, "jsonrpc": "2.0", "result": null}
Read message
{"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":1}}
Read message
{"jsonrpc":"2.0","id":6,"method":"textDocument/definition","params":{"textDocument":{"uri":"file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re"},"position":{"line":2,"character":37}}}
[server] Got a method textDocument/definition
[server] processing took 0.ms
[ref] Got a loc for pos
[ref] Global defn React useState : Value
FINDING docs for module Impl(c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\lib\bs\src\React.cmt, c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\React.re)
FINDING c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\lib\bs\src\React.cmt src c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\React.re
[ref] Got stamp 1126
[ref] Inner uri file://c:/Users/sharno/projects/mockingbird/client/node_modules/reason-react/src/React.re
Sending response {"id": 6, "jsonrpc": "2.0", "result": {"uri": "file://c:/Users/sharno/projects/mockingbird/client/node_modules/reason-react/src/React.re", "range": {"start": {"line": 128, "character": 9}, "end": {"line": 128, "character": 17}}}}
Read message
{"jsonrpc":"2.0","id":7,"method":"textDocument/definition","params":{"textDocument":{"uri":"file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re"},"position":{"line":2,"character":34}}}
[server] Got a method textDocument/definition
[server] processing took 0.ms
[ref] Got a loc for pos
[ref] Global defn React useState : Value
FINDING docs for module Impl(c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\lib\bs\src\React.cmt, c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\React.re)
FINDING c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\lib\bs\src\React.cmt src c:\Users\sharno\projects\mockingbird\client\node_modules\reason-react\src\React.re
[ref] Got stamp 1126
[ref] Inner uri file://c:/Users/sharno/projects/mockingbird/client/node_modules/reason-react/src/React.re
Sending response {"id": 7, "jsonrpc": "2.0", "result": {"uri": "file://c:/Users/sharno/projects/mockingbird/client/node_modules/reason-react/src/React.re", "range": {"start": {"line": 128, "character": 9}, "end": {"line": 128, "character": 17}}}}
Read message
{"jsonrpc":"2.0","id":8,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re"}}}
[server] Got a method textDocument/documentSymbol
[server] processing took 0.ms
Sending response {"id": 8, "jsonrpc": "2.0", "result": [{"name": "make", "kind": 12, "location": {"range": {"start": {"line": 0, "character": 0}, "end": {"line": 24, "character": 1}}, "uri": "file://"}}]}
Read message
{"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":8}}
Read message
{"jsonrpc":"2.0","id":9,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re"}}}
[server] Got a method textDocument/documentSymbol
[server] processing took 0.985622406006ms
Sending response {"id": 9, "jsonrpc": "2.0", "result": [{"name": "make", "kind": 12, "location": {"range": {"start": {"line": 0, "character": 0}, "end": {"line": 24, "character": 1}}, "uri": "file://"}}]}
Read message
{"jsonrpc":"2.0","id":10,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///c%3A/Users/sharno/projects/mockingbird/client/src/BlinkingGreeting/BlinkingGreeting.re"},"range":{"start":{"line":2,"character":34},"end":{"line":2,"character":34}},"context":{"diagnostics":[]}}}
[server] Got a method textDocument/codeAction
[server] processing took 0.ms
Sending response {"id": 10, "jsonrpc": "2.0", "result": null}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the Windows Ctrl+Click failure using the logged file URIs and definition-related LSP requests, then trace how Windows file URIs are parsed and returned. Done means jumping to a function definition works on Windows without producing the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100