Skip to content
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 is broken (Windows) #445

Open
sharno opened this issue Apr 24, 2020 · 2 comments
Open

Jump to definition is broken (Windows) #445

sharno opened this issue Apr 24, 2020 · 2 comments

Comments

@sharno
Copy link

sharno commented Apr 24, 2020

Trying to Ctrl+Click on any function shows up an error like this on Windows:
image

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  <div style> children </div>;\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}

@evelant
Copy link

evelant commented Jul 10, 2020

This also affects jumping to errors (in some cases). Can't jump to errors in node_modules.

@hariroshan
Copy link

hariroshan commented Nov 25, 2020

I'm having the same issue. Is there a fix?. Also why is there " \\ " in the beginning of the path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants