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

Initialization broken on Windows #72

Closed
radeksimko opened this issue Apr 29, 2020 · 3 comments · Fixed by #73
Closed

Initialization broken on Windows #72

radeksimko opened this issue Apr 29, 2020 · 3 comments · Fixed by #73
Labels
bug Something isn't working
Milestone

Comments

@radeksimko
Copy link
Member

Server Version

0.1.0

Terraform Version

Terraform v0.12.24

OS Version

Windows 10 Pro (1909) x64

Client Version

Sublime Text (LSP plugin) v0.9.8

Terraform Configuration Files

provider "aws" {
}

resource "aws_instance" {
}

Log Output

2020/04/29 09:02:09 rpc_logger.go:29: Incoming request for "initialize" (ID 1): {"rootPath":"C:\\Users\\Radek Simko\\tf-test","capabilities":{"workspace":{"applyEdit":true,"executeCommand":{},"workspaceFolders":true,"didChangeConfiguration":{},"symbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"configuration":true},"textDocument":{"declaration":{"linkSupport":true},"documentHighlight":{},"synchronization":{"willSaveWaitUntil":true,"willSave":true,"didSave":true},"rename":{},"signatureHelp":{"signatureInformation":{"parameterInformation":{"labelOffsetSupport":true},"documentationFormat":["markdown","plaintext"]}},"hover":{"contentFormat":["markdown","plaintext"]},"publishDiagnostics":{"relatedInformation":true},"typeDefinition":{"linkSupport":true},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":[]}}},"implementation":{"linkSupport":true},"definition":{"linkSupport":true},"references":{},"rangeFormatting":{},"colorProvider":{},"completion":{"completionItem":{"snippetSupport":true},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"documentSymbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"formatting":{}}},"rootUri":"file:///C:/Users/Radek%20Simko/tf-test","initializationOptions":{},"workspaceFolders":[{"name":"tf-test","uri":"file:///C:/Users/Radek%20Simko/tf-test"}],"clientInfo":{"name":"Sublime Text LSP"},"processId":5256}
2020/04/29 09:02:09 exec.go:114: Running C:\ProgramData\chocolatey\bin\terraform.exe ["version"] in "\\C:\\Users\\Radek Simko\\tf-test"...
2020/04/29 09:02:09 rpc_logger.go:45: Error for "initialize" (ID 1): [-32098] failed to get version: chdir \C:\Users\Radek Simko\tf-test: The filename, directory name, or volume label syntax is incorrect.

Expected Behavior

LS starts and initializes the directory correctly.

Actual Behavior

LS failed to finish initialization due to Windows-style paths being interpreted incorrectly.

Steps to Reproduce

  1. Open a folder in Sublime Text on Windows with the above config
  2. Open file with the above config from that folder
  3. Watch LS log
@radeksimko radeksimko added the bug Something isn't working label Apr 29, 2020
@radeksimko radeksimko added this to the v0.2.0 milestone Apr 29, 2020
@radeksimko radeksimko changed the title Make initialization work on Windows Initialization broken on Windows Apr 29, 2020
@radeksimko
Copy link
Member Author

This appears to be related to the fact that the client (Sublime Text LSP in this case) sends a URI which has an extra (IMO meaningless) slash / on Windows:

file:///C:/Users/Radek%20Simko/tf-test

which then resolves to

\C:\Users\Radek Simko\tf-test

when we'd expect it to be resolved to

C:\Users\Radek Simko\tf-test

I will try to understand how does the third slash get added to the URI in case of Sublime Text and check if other popular clients behave the same way - then in theory we could just use a different prefix on Windows (file:///).

@radeksimko
Copy link
Member Author

Confirmed the same behaviour (path with extra slash) being returned from NeoVim CoC plugin, IntelliJ, and the VSCode Extension.

@ghost
Copy link

ghost commented Jun 12, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the context necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Jun 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant