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

v2.0.0-rc1 Task error: [-32601] no such method "workspace/didChangeWatchedFiles" #137

Closed
pgreda opened this issue Jun 4, 2020 · 13 comments
Labels
editor/vscode https://code.visualstudio.com/ question Further information is requested workspace/didChangeWatchedFiles

Comments

@pgreda
Copy link

pgreda commented Jun 4, 2020

Hi,

I'm running:

VSCode 1.45.1
Terraform v0.12.26
Plugin version 2.0.0-rc.1
WSL2

Following code:

terraform {
  required_version = ">=0.12.0"
}

provider "aws" {
  profile = "default"
  region  = var.region
}

resxvxvcx

Doesn't produce any error in VSCode on "resxvxvcx". The plugin doesn't catch any errors. Every detected change ends with following error:

Launching language server: /home/pgreda/.vscode-server/extensions/hashicorp.terraform-2.0.0-rc.1/lsp/terraform-ls serve
2020/06/04 23:20:03 service.go:63: Preparing new session ...
2020/06/04 23:20:03 langserver.go:79: Starting server (pid 3835) ...
2020/06/04 23:20:03 server.go:469: Received 1 new requests
2020/06/04 23:20:03 server.go:165: Processing 1 requests
2020/06/04 23:20:03 server.go:223: Checking request for "initialize": {"processId":3789,"rootPath":"/home/pgreda/ttt","rootUri":"file:///home/pgreda/ttt","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"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]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":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]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}}},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"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]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true}}},"trace":"off","workspaceFolders":[{"uri":"file:///home/pgreda/ttt","name":"ttt"}]}
2020/06/04 23:20:03 rpc_logger.go:29: Incoming request for "initialize" (ID 0): {"processId":3789,"rootPath":"/home/pgreda/ttt","rootUri":"file:///home/pgreda/ttt","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"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]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":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]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}}},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"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]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true}}},"trace":"off","workspaceFolders":[{"uri":"file:///home/pgreda/ttt","name":"ttt"}]}
2020/06/04 23:20:03 exec.go:182: Starting /usr/local/bin/terraform ["terraform" "version"] in "/tmp"...
2020/06/04 23:20:03 exec.go:148: Waiting for command to finish ...
2020/06/04 23:20:03 exec.go:174: terraform run (/usr/local/bin/terraform ["terraform" "version"], in "/tmp", pid 3843) finished with exit code 0
2020/06/04 23:20:03 initialize.go:90: Found compatible Terraform version (0.12.26) at /usr/local/bin/terraform
2020/06/04 23:20:03 schema_storage.go:334: Adding workspace for watching: "/home/pgreda/ttt"
2020/06/04 23:20:03 watcher.go:88: Adding "/home/pgreda/ttt/.terraform/plugins/linux_amd64/lock.json" for watching...
2020/06/04 23:20:03 schema_storage.go:124: Acquiring semaphore before retrieving schema for "/home/pgreda/ttt" ...
2020/06/04 23:20:03 schema_storage.go:133: Retrieving schemas for "/home/pgreda/ttt" ...
2020/06/04 23:20:03 schema_storage.go:310: Watching for plugin changes ...
2020/06/04 23:20:03 exec.go:182: Starting /usr/local/bin/terraform ["terraform" "providers" "schema" "-json"] in "/home/pgreda/ttt"...
2020/06/04 23:20:03 rpc_logger.go:50: Response to "initialize" (ID 0): {"capabilities":{"textDocumentSync":{"openClose":true,"change":2},"completionProvider":{},"documentFormattingProvider":true}}
2020/06/04 23:20:03 server.go:204: Completed 1 requests [34.3276ms elapsed]
2020/06/04 23:20:03 exec.go:148: Waiting for command to finish ...
2020/06/04 23:20:03 server.go:469: Received 1 new requests
2020/06/04 23:20:03 server.go:165: Processing 1 requests
2020/06/04 23:20:03 server.go:223: Checking request for "initialized": {}
2020/06/04 23:20:03 rpc_logger.go:29: Incoming notification for "initialized": {}
2020/06/04 23:20:03 server.go:469: Received 1 new requests
2020/06/04 23:20:03 server.go:165: Processing 1 requests
2020/06/04 23:20:03 server.go:223: Checking request for "textDocument/didOpen": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","languageId":"terraform","version":1,"text":"terraform {\n  required_version = \">=0.12.0\"\n}\n\nprovider \"aws\" {\n  profile = \"default\"\n  region  = var.region\n}"}}
2020/06/04 23:20:03 rpc_logger.go:29: Incoming notification for "textDocument/didOpen": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","languageId":"terraform","version":1,"text":"terraform {\n  required_version = \">=0.12.0\"\n}\n\nprovider \"aws\" {\n  profile = \"default\"\n  region  = var.region\n}"}}
2020/06/04 23:20:05 exec.go:174: terraform run (/usr/local/bin/terraform ["terraform" "providers" "schema" "-json"], in "/home/pgreda/ttt", pid 3866) finished with exit code 0
2020/06/04 23:20:05 schema_storage.go:140: Schemas retrieved in 1.7616088s
2020/06/04 23:20:17 server.go:469: Received 1 new requests
2020/06/04 23:20:17 server.go:165: Processing 1 requests
2020/06/04 23:20:17 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":2},"contentChanges":[{"range":{"start":{"line":7,"character":1},"end":{"line":7,"character":1}},"rangeLength":0,"text":"\n"}]}
2020/06/04 23:20:17 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":2},"contentChanges":[{"range":{"start":{"line":7,"character":1},"end":{"line":7,"character":1}},"rangeLength":0,"text":"\n"}]}
2020/06/04 23:20:18 server.go:469: Received 1 new requests
2020/06/04 23:20:18 server.go:165: Processing 1 requests
2020/06/04 23:20:18 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":3},"contentChanges":[{"range":{"start":{"line":8,"character":0},"end":{"line":8,"character":0}},"rangeLength":0,"text":"\n"}]}
2020/06/04 23:20:18 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":3},"contentChanges":[{"range":{"start":{"line":8,"character":0},"end":{"line":8,"character":0}},"rangeLength":0,"text":"\n"}]}
2020/06/04 23:20:19 server.go:469: Received 1 new requests
2020/06/04 23:20:19 server.go:165: Processing 1 requests
2020/06/04 23:20:19 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":4},"contentChanges":[{"range":{"start":{"line":9,"character":0},"end":{"line":9,"character":0}},"rangeLength":0,"text":"r"}]}
2020/06/04 23:20:19 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":4},"contentChanges":[{"range":{"start":{"line":9,"character":0},"end":{"line":9,"character":0}},"rangeLength":0,"text":"r"}]}
2020/06/04 23:20:19 server.go:469: Received 1 new requests
2020/06/04 23:20:19 server.go:165: Processing 1 requests
2020/06/04 23:20:19 server.go:223: Checking request for "textDocument/completion": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf"},"position":{"line":9,"character":1},"context":{"triggerKind":1}}
2020/06/04 23:20:19 rpc_logger.go:29: Incoming request for "textDocument/completion" (ID 1): {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf"},"position":{"line":9,"character":1},"context":{"triggerKind":1}}
2020/06/04 23:20:19 complete.go:37: Finding block at position lsp.TextDocumentPositionParams{TextDocument:lsp.TextDocumentIdentifier{URI:"file:///home/pgreda/ttt/test.tf"}, Position:lsp.Position{Line:9, Character:1}}
2020/06/04 23:20:19 rpc_logger.go:50: Response to "textDocument/completion" (ID 1): {"isIncomplete":false,"items":[{"label":"resource","kind":5,"documentation":"A resource block declares a resource of a given type with a given local name. The name is used to refer to this resource from elsewhere in the same Terraform module, but has no significance outside of the scope of a module.","insertTextFormat":2,"textEdit":{"range":{"start":{"line":9,"character":0},"end":{"line":9,"character":1}},"newText":"resource \"${1}\" \"${2:name}\" {\n  ${3}\n}"}}]}
2020/06/04 23:20:19 server.go:204: Completed 1 requests [718.9µs elapsed]
2020/06/04 23:20:19 server.go:469: Received 1 new requests
2020/06/04 23:20:19 server.go:165: Processing 1 requests
2020/06/04 23:20:19 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":5},"contentChanges":[{"range":{"start":{"line":9,"character":1},"end":{"line":9,"character":1}},"rangeLength":0,"text":"e"}]}
2020/06/04 23:20:19 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":5},"contentChanges":[{"range":{"start":{"line":9,"character":1},"end":{"line":9,"character":1}},"rangeLength":0,"text":"e"}]}
2020/06/04 23:20:19 server.go:469: Received 1 new requests
2020/06/04 23:20:19 server.go:165: Processing 1 requests
2020/06/04 23:20:19 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":6},"contentChanges":[{"range":{"start":{"line":9,"character":2},"end":{"line":9,"character":2}},"rangeLength":0,"text":"s"}]}
2020/06/04 23:20:19 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":6},"contentChanges":[{"range":{"start":{"line":9,"character":2},"end":{"line":9,"character":2}},"rangeLength":0,"text":"s"}]}
2020/06/04 23:20:21 server.go:469: Received 1 new requests
2020/06/04 23:20:21 server.go:165: Processing 1 requests
2020/06/04 23:20:21 server.go:223: Checking request for "workspace/didChangeWatchedFiles": {"changes":[{"uri":"file:///home/pgreda/ttt/test.tf","type":2}]}
2020/06/04 23:20:21 server.go:245: Task error: [-32601] no such method "workspace/didChangeWatchedFiles"
2020/06/04 23:20:27 server.go:469: Received 1 new requests
2020/06/04 23:20:27 server.go:165: Processing 1 requests
2020/06/04 23:20:27 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":7},"contentChanges":[{"range":{"start":{"line":9,"character":3},"end":{"line":9,"character":3}},"rangeLength":0,"text":"x"}]}
2020/06/04 23:20:27 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":7},"contentChanges":[{"range":{"start":{"line":9,"character":3},"end":{"line":9,"character":3}},"rangeLength":0,"text":"x"}]}
2020/06/04 23:20:28 server.go:469: Received 1 new requests
2020/06/04 23:20:28 server.go:165: Processing 1 requests
2020/06/04 23:20:28 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":8},"contentChanges":[{"range":{"start":{"line":9,"character":4},"end":{"line":9,"character":4}},"rangeLength":0,"text":"v"}]}
2020/06/04 23:20:28 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":8},"contentChanges":[{"range":{"start":{"line":9,"character":4},"end":{"line":9,"character":4}},"rangeLength":0,"text":"v"}]}
2020/06/04 23:20:28 server.go:469: Received 1 new requests
2020/06/04 23:20:28 server.go:165: Processing 1 requests
2020/06/04 23:20:28 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":9},"contentChanges":[{"range":{"start":{"line":9,"character":5},"end":{"line":9,"character":5}},"rangeLength":0,"text":"x"}]}
2020/06/04 23:20:28 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":9},"contentChanges":[{"range":{"start":{"line":9,"character":5},"end":{"line":9,"character":5}},"rangeLength":0,"text":"x"}]}
2020/06/04 23:20:28 server.go:469: Received 1 new requests
2020/06/04 23:20:28 server.go:165: Processing 1 requests
2020/06/04 23:20:28 server.go:223: Checking request for "textDocument/completion": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf"},"position":{"line":9,"character":6},"context":{"triggerKind":1}}
2020/06/04 23:20:28 rpc_logger.go:29: Incoming request for "textDocument/completion" (ID 2): {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf"},"position":{"line":9,"character":6},"context":{"triggerKind":1}}
2020/06/04 23:20:28 complete.go:37: Finding block at position lsp.TextDocumentPositionParams{TextDocument:lsp.TextDocumentIdentifier{URI:"file:///home/pgreda/ttt/test.tf"}, Position:lsp.Position{Line:9, Character:6}}
2020/06/04 23:20:28 rpc_logger.go:50: Response to "textDocument/completion" (ID 2): {"isIncomplete":false,"items":[]}
2020/06/04 23:20:28 server.go:204: Completed 1 requests [674.9µs elapsed]
2020/06/04 23:20:28 server.go:469: Received 1 new requests
2020/06/04 23:20:28 server.go:165: Processing 1 requests
2020/06/04 23:20:28 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":10},"contentChanges":[{"range":{"start":{"line":9,"character":6},"end":{"line":9,"character":6}},"rangeLength":0,"text":"v"}]}
2020/06/04 23:20:28 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":10},"contentChanges":[{"range":{"start":{"line":9,"character":6},"end":{"line":9,"character":6}},"rangeLength":0,"text":"v"}]}
2020/06/04 23:20:28 server.go:469: Received 1 new requests
2020/06/04 23:20:28 server.go:165: Processing 1 requests
2020/06/04 23:20:28 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":11},"contentChanges":[{"range":{"start":{"line":9,"character":7},"end":{"line":9,"character":7}},"rangeLength":0,"text":"c"}]}
2020/06/04 23:20:28 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":11},"contentChanges":[{"range":{"start":{"line":9,"character":7},"end":{"line":9,"character":7}},"rangeLength":0,"text":"c"}]}
2020/06/04 23:20:28 server.go:469: Received 1 new requests
2020/06/04 23:20:28 server.go:165: Processing 1 requests
2020/06/04 23:20:28 server.go:223: Checking request for "textDocument/completion": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf"},"position":{"line":9,"character":8},"context":{"triggerKind":1}}
2020/06/04 23:20:28 rpc_logger.go:29: Incoming request for "textDocument/completion" (ID 3): {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf"},"position":{"line":9,"character":8},"context":{"triggerKind":1}}
2020/06/04 23:20:28 complete.go:37: Finding block at position lsp.TextDocumentPositionParams{TextDocument:lsp.TextDocumentIdentifier{URI:"file:///home/pgreda/ttt/test.tf"}, Position:lsp.Position{Line:9, Character:8}}
2020/06/04 23:20:28 rpc_logger.go:50: Response to "textDocument/completion" (ID 3): {"isIncomplete":false,"items":[]}
2020/06/04 23:20:28 server.go:204: Completed 1 requests [606µs elapsed]
2020/06/04 23:20:28 server.go:469: Received 1 new requests
2020/06/04 23:20:28 server.go:165: Processing 1 requests
2020/06/04 23:20:28 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":12},"contentChanges":[{"range":{"start":{"line":9,"character":8},"end":{"line":9,"character":8}},"rangeLength":0,"text":"x"}]}
2020/06/04 23:20:28 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":12},"contentChanges":[{"range":{"start":{"line":9,"character":8},"end":{"line":9,"character":8}},"rangeLength":0,"text":"x"}]}
2020/06/04 23:20:28 server.go:469: Received 1 new requests
2020/06/04 23:20:28 server.go:165: Processing 1 requests
2020/06/04 23:20:28 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":13},"contentChanges":[{"range":{"start":{"line":9,"character":9},"end":{"line":9,"character":9}},"rangeLength":0,"text":"\n"}]}
2020/06/04 23:20:28 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":13},"contentChanges":[{"range":{"start":{"line":9,"character":9},"end":{"line":9,"character":9}},"rangeLength":0,"text":"\n"}]}
2020/06/04 23:20:28 server.go:469: Received 1 new requests
2020/06/04 23:20:28 server.go:165: Processing 1 requests
2020/06/04 23:20:28 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":14},"contentChanges":[{"range":{"start":{"line":10,"character":0},"end":{"line":10,"character":0}},"rangeLength":0,"text":"\n"}]}
2020/06/04 23:20:28 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/ttt/test.tf","version":14},"contentChanges":[{"range":{"start":{"line":10,"character":0},"end":{"line":10,"character":0}},"rangeLength":0,"text":"\n"}]}
2020/06/04 23:20:30 server.go:469: Received 1 new requests
2020/06/04 23:20:30 server.go:165: Processing 1 requests
2020/06/04 23:20:30 server.go:223: Checking request for "workspace/didChangeWatchedFiles": {"changes":[{"uri":"file:///home/pgreda/ttt/test.tf","type":2}]}
2020/06/04 23:20:30 server.go:245: Task error: [-32601] no such method "workspace/didChangeWatchedFiles"
@paultyng paultyng transferred this issue from hashicorp/vscode-terraform Jun 4, 2020
@paultyng paultyng added bug Something isn't working editor/vscode https://code.visualstudio.com/ labels Jun 4, 2020
@radeksimko radeksimko added enhancement New feature or request question Further information is requested and removed bug Something isn't working enhancement New feature or request labels Jun 5, 2020
@radeksimko
Copy link
Member

radeksimko commented Jun 5, 2020

Hi @pgreda ,
Thank you for the report and for trying out the new extension!

Doesn't produce any error in VSCode on "resxvxvcx". The plugin doesn't catch any errors.

What is it that you expect to happen here? I'm aware the old extension used to underline invalid keywords - this is something we plan to implement as part of #27

Every detected change ends with following error:

That error should be mostly harmless in this context and unrelated to the problem you're most likely describing. It just means that the language server currently lacks a way of synchronizing content of files when they get changed outside of VSCode/IDE. This would usually happen when you switch branches in git. This will be implemented as part of #15

Do you remember if you or any other program could've triggered this? i.e. anything changed files within the workspace outside of VSCode?

Is there anything else I missed?

@pgreda
Copy link
Author

pgreda commented Jun 5, 2020

I'm aware the old extension used to underline invalid keywords - this is something we plan to implement as part of #27

Thank you for the clarification. I’ve jumped to 2.0.0-rc.1 due to bug #324. In 1.4.0 some/most of the syntax checking worked. I will keep my fingers crossed for #27 and #15.

What is it that you expect to happen here?

When you combine the fact that the syntax is not being highlighted on warnings and errors with a verbose terraform-ls output producing an error on every keystroke the user gets the feeling that something is broken. I started troubleshooting the installation and even purged my VSCode config to start from scratch. This is a bad user experience.

Do you remember if you or any other program could've triggered this? i.e. anything changed files within the workspace outside of VSCode?

No, the error is generated on every single keystroke.

Best regards,

PG

@radeksimko
Copy link
Member

When you combine the fact that the syntax is not being highlighted on warnings and errors with a verbose terraform-ls output producing an error on every keystroke the user gets the feeling that something is broken. I started troubleshooting the installation and even purged my VSCode config to start from scratch. This is a bad user experience.

Is it possible that you still have the old extension installed alongside this rc.1? Then I assume you would have two extensions both listening for the same events, but perhaps somehow conflicting with each other in a way that one doesn't receive all the updates the usual way (didChange), but instead just a notification that something changed "outside of the editor"? I'm not sure this is actually what's happening - I'm just guessing.

@pgreda
Copy link
Author

pgreda commented Jun 5, 2020

Is it possible that you still have the old extension installed alongside this rc.1? Then I assume you would have two extensions both listening for the same events, but perhaps somehow conflicting with each other in a way that one doesn't receive all the updates the usual way (didChange), but instead just a notification that something changed "outside of the editor"? I'm not sure this is actually what's happening - I'm just guessing.

I have just double checked this (full purge). There is only LS v3.0 included in 2.0.0.rc-1 running. Maybe it’s related to the fact that I’m using it on WSL2?

@radeksimko
Copy link
Member

I meant the version of the VSCode extension rather than language server, which should come up in the extension list here:

Screenshot 2020-06-05 at 10 22 35

Also do you mind checking your VSCode settings for any options which start with terraform.languageServer? You can get to settings by opening the command palette (Cmd+Shift+P on macOS or Ctrl+Shift+P on Windows/Linux) and selecting Open Settings (JSON)

Screenshot 2020-06-05 at 10 23 41

Maybe it’s related to the fact that I’m using it on WSL2?

That is good to know - I'm unsure if we tested the whole setup on WSL2 yet, but in theory it should work. I can try to reproduce in a Windows VM once we rule out the conflict of extensions.

@pgreda
Copy link
Author

pgreda commented Jun 5, 2020

No other versions present:
obraz

Things related to terraform in settings:

  "[terraform]": {},
  "terraform.languageServer": {
  
    "external": true,
    "args": [
      "serve"
    ]
  },

@aprice
Copy link

aprice commented Jun 18, 2020

I'm seeing the same error with v2.0.1 of the plugin under

Version: 1.46.0
Commit: a5d1cc28bb5da32ec67e86cc50f84c67cc690321
Date: 2020-06-10T08:59:04.923Z
Electron: 7.3.1
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.3.11-100.fc29.x86_64

It's the only error I can find that explains why VS Code cannot seem to save Terraform files now; it hangs on "Running 'HashiCorp Terraform' Formatter..." and won't actually save changes until I cancel that operation. After cancelling so it can save, I can then terraform fmt the same file from the command-line without issue. This started after updating to v2.

@radeksimko
Copy link
Member

Generally this error should in most "happy-path" circumstances (when files don't change outside of VSCode) be informative. That said it is certainly something we plan to fix/implement.

It's the only error I can find that explains why VS Code cannot seem to save Terraform files now; it hangs on "Running 'HashiCorp Terraform' Formatter..." and won't actually save changes until I cancel that operation.

@aprice I would say that's most likely unrelated - can you open a new issue and attach the log?

Thanks.

@Shandur
Copy link

Shandur commented Jun 19, 2020

I've got the same issue.
Terraform version is 0.12.6.

Task error: [-32601] no such method "workspace/didChangeWatchedFiles"

@woz5999
Copy link

woz5999 commented Jun 19, 2020

Same issue. The language server is pretty much unusable and actively prevents development while it is enabled.

@hcharley
Copy link

Happening to me as well on 0.13:

2020/08/16 11:36:59 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///xxxxxxx/new/_providers.tf","version":8},"contentChanges":[{"range":{"start":{"line":69,"character":28},"end":{"line":69,"character":28}},"rangeLength":0,"text":" "}]}
2020/08/16 11:36:59 root_module_manager.go:149: direct root module lookup succeeded: /xxxxxxx/new
2020/08/16 11:36:59 root_module.go:351: 9 provider references found for /xxxxxxx/new
2020/08/16 11:37:02 service.go:81: Root modules waiting to be loaded: 0
2020/08/16 11:37:04 server.go:559: Received 1 new requests
2020/08/16 11:37:04 server.go:174: Processing 1 requests
2020/08/16 11:37:04 server.go:256: Checking request for "workspace/didChangeWatchedFiles": {"changes":[{"uri":"file:///xxxxxxx/new/_providers.tf","type":2}]}
2020/08/16 11:37:04 server.go:284: Task error: [-32601] no such method "workspace/didChangeWatchedFiles"

Screen Shot 2020-08-16 at 11 38 57 AM

@radeksimko
Copy link
Member

Hi folks,
The official Terraform VS Code extension no longer sends updates since v2.2.0 so this error should no longer be relevant for anyone who uses any recent version of that extension. Therefore I'm going to close this issue.

We plan to re-introduce synchronization, but only once this is actually supported on the server side.

See relevant planned work at

@github-actions
Copy link

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 details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor/vscode https://code.visualstudio.com/ question Further information is requested workspace/didChangeWatchedFiles
Projects
None yet
Development

No branches or pull requests

7 participants