haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 210 forks source link

Request error on Windows #288

Closed Friede80 closed 6 years ago

Friede80 commented 7 years ago

Error thrown when running on Windows:

haskell-lsp:Starting up server ...
2017-08-15 16:08:53 [ThreadId 3] - ---> {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":100468,"rootPath":"e:\\Coding\\haskell-ide-engine","rootUri":"file:///e%3A/Coding/haskell-ide-engine","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true},"didChangeConfiguration":{"dynamicRegistration":false},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true}},"textDocument":{"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"completionItem":{"snippetSupport":true}},"hover":{"dynamicRegistration":true},"signatureHelp":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"definition":{"dynamicRegistration":true},"codeAction":{"dynamicRegistration":true},"codeLens":{"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true}}},"trace":"off"}}
2017-08-15 16:09:00 [ThreadId 3] - haskell-lsp:initializeRequestHandler: setting current dir to project root:/e%3A/Coding/haskell-ide-engine
2017-08-15 16:09:00 [ThreadId 4] - <--2--{"error":{"code":-32603,"message":"request error. RequestMessage {_jsonrpc = \"2.0\", _id = IdInt 0, _method = Initialize, _params = InitializeParams {_processId = Just 100468, _rootPath = Just \"e:\\\\Coding\\\\haskell-ide-engine\", _rootUri = Just (Uri {getUri = \"file:///e%3A/Coding/haskell-ide-engine\"}), _initializationOptions = Nothing, _capabilities = ClientCapabilities {_workspace = Just (WorkspaceClientCapabilities {_applyEdit = Just True, _workspaceEdit = Just (WorkspaceEditClientCapabilities {_documentChanges = Just True}), _didChangeConfiguration = Just (DidChangeConfigurationClientCapabilities {_dynamicRegistration = Just False}), _didChangeWatchedFiles = Just (DidChangeWatchedFilesClientCapabilities {_dynamicRegistration = Just True}), _symbol = Just (SymbolClientCapabilities {_dynamicRegistration = Just True}), _executeCommand = Just (ExecuteClientCapabilities {_dynamicRegistration = Just True})}), _textDocument = Just (TextDocumentClientCapabilities {_synchronization = Just (SynchronizationTextDocumentClientCapabilities {_dynamicRegistration = Just True, _willSave = Just True, _willSaveWaitUntil = Just True, _didSave = Just True}), _completion = Just (CompletionClientCapabilities {_dynamicRegistration = Just True, _completionItem = Just (CompletionItemClientCapabilities {_snippetSupport = Just True})}), _hover = Just (HoverClientCapabilities {_dynamicRegistration = Just True}), _signatureHelp = Just (SignatureHelpClientCapabilities {_dynamicRegistration = Just True}), _references = Just (ReferencesClientCapabilities {_dynamicRegistration = Just True}), _documentHighlight = Just (DocumentHighlightClientCapabilities {_dynamicRegistration = Just True}), _documentSymbol = Just (DocumentSymbolClientCapabilities {_dynamicRegistration = Just True}), _formatting = Just (FormattingClientCapabilities {_dynamicRegistration = Just True}), _rangeFormatting = Just (RangeFormattingClientCapabilities {_dynamicRegistration = Just True}), _onTypeFormatting = Just (OnTypeFormattingClientCapabilities {_dynamicRegistration = Just True}), _definition = Just (DefinitionClientCapabilities {_dynamicRegistration = Just True}), _codeAction = Just (CodeActionClientCapabilities {_dynamicRegistration = Just True}), _codeLens = Just (CodeLensClientCapabilities {_dynamicRegistration = Just True}), _documentLink = Just (DocumentLinkClientCapabilities {_dynamicRegistration = Just True}), _rename = Just (RenameClientCapabilities {_dynamicRegistration = Just True})}), _experimental = Nothing}, _trace = Just TraceOff}} SetCurrentDirectory \"/e%3A/Coding/haskell-ide-engine\": does not exist (The system cannot find the path specified.)"},"jsonrpc":"2.0","id":0}
2017-08-15 16:09:00 [ThreadId 4] - <--2--{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":1,"message":"request error. RequestMessage {_jsonrpc = \"2.0\", _id = IdInt 0, _method = Initialize, _params = InitializeParams {_processId = Just 100468, _rootPath = Just \"e:\\\\Coding\\\\haskell-ide-engine\", _rootUri = Just (Uri {getUri = \"file:///e%3A/Coding/haskell-ide-engine\"}), _initializationOptions = Nothing, _capabilities = ClientCapabilities {_workspace = Just (WorkspaceClientCapabilities {_applyEdit = Just True, _workspaceEdit = Just (WorkspaceEditClientCapabilities {_documentChanges = Just True}), _didChangeConfiguration = Just (DidChangeConfigurationClientCapabilities {_dynamicRegistration = Just False}), _didChangeWatchedFiles = Just (DidChangeWatchedFilesClientCapabilities {_dynamicRegistration = Just True}), _symbol = Just (SymbolClientCapabilities {_dynamicRegistration = Just True}), _executeCommand = Just (ExecuteClientCapabilities {_dynamicRegistration = Just True})}), _textDocument = Just (TextDocumentClientCapabilities {_synchronization = Just (SynchronizationTextDocumentClientCapabilities {_dynamicRegistration = Just True, _willSave = Just True, _willSaveWaitUntil = Just True, _didSave = Just True}), _completion = Just (CompletionClientCapabilities {_dynamicRegistration = Just True, _completionItem = Just (CompletionItemClientCapabilities {_snippetSupport = Just True})}), _hover = Just (HoverClientCapabilities {_dynamicRegistration = Just True}), _signatureHelp = Just (SignatureHelpClientCapabilities {_dynamicRegistration = Just True}), _references = Just (ReferencesClientCapabilities {_dynamicRegistration = Just True}), _documentHighlight = Just (DocumentHighlightClientCapabilities {_dynamicRegistration = Just True}), _documentSymbol = Just (DocumentSymbolClientCapabilities {_dynamicRegistration = Just True}), _formatting = Just (FormattingClientCapabilities {_dynamicRegistration = Just True}), _rangeFormatting = Just (RangeFormattingClientCapabilities {_dynamicRegistration = Just True}), _onTypeFormatting = Just (OnTypeFormattingClientCapabilities {_dynamicRegistration = Just True}), _definition = Just (DefinitionClientCapabilities {_dynamicRegistration = Just True}), _codeAction = Just (CodeActionClientCapabilities {_dynamicRegistration = Just True}), _codeLens = Just (CodeLensClientCapabilities {_dynamicRegistration = Just True}), _documentLink = Just (DocumentLinkClientCapabilities {_dynamicRegistration = Just True}), _rename = Just (RenameClientCapabilities {_dynamicRegistration = Just True})}), _experimental = Nothing}, _trace = Just TraceOff}} SetCurrentDirectory \"/e%3A/Coding/haskell-ide-engine\": does not exist (The system cannot find the path specified.)"}}
2017-08-15 16:09:00 [ThreadId 3] - ---> {"jsonrpc":"2.0","id":1,"method":"shutdown","params":null}
2017-08-15 16:09:00 [ThreadId 4] - <--2--{"result":"ok","jsonrpc":"2.0","id":1}
2017-08-15 16:09:00 [ThreadId 3] - ---> {"jsonrpc":"2.0","method":"exit","params":null}
2017-08-15 16:09:00 [ThreadId 3] - haskell-lsp:Got exit, exiting
alanz commented 7 years ago

This looks like the windows path with e: is not being handled properly.

Windows devs?

arrowd commented 7 years ago

"rootPath":"e:\Coding\haskell-ide-engine"

Shouldn't that be an URI (that is, start with file://) too?

alanz commented 7 years ago

No, rootPath is the previous requirement, superseded by rootUri. Vscode sends both.

So "rootUri":"file:///e%3A/Coding/haskell-ide-engine"

arrowd commented 7 years ago

Ok, then %3A should be a culprit. I guess, uriToFilePath should not just drop "file://" prefix, but also URL-decode the string?

alanz commented 7 years ago

@arrowd I think is is resolved via https://github.com/alanz/haskell-lsp/pull/53

Anrock commented 6 years ago

@alanz works for me, no error, path is proper.

nponeccop commented 6 years ago

This is a duplicate of #329, it should work now.

@Friede80 can you confirm?

nponeccop commented 6 years ago

Closing as it seems fixed, just there's no confirmation from the original reporter.