Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The language server isn't able to do anything with invalid/unsupported URIs, such as the ones listed in hashicorp/vscode-terraform#1159
There's a broader question of whether these URIs should even be send to LS. Given that the known majority of such URIs come from VS Code, I created a separate ticket hashicorp/vscode-terraform#1159 to discuss the problem there.
Prior to this patch it would crash when encountered such a URI during
initialize
,textDocument/didOpen
orworkspace/didChangeWorkspaceFolders
, as reported in #959We already handle this gracefully in custom commands:
terraform-ls/internal/langserver/handlers/command/module_calls.go
Lines 42 to 44 in 000cb53
terraform-ls/internal/langserver/handlers/command/module_callers.go
Lines 30 to 32 in 000cb53
terraform-ls/internal/langserver/handlers/command/module_providers.go
Lines 39 to 41 in 000cb53
terraform-ls/internal/langserver/handlers/command/init.go
Lines 23 to 25 in 000cb53
terraform-ls/internal/langserver/handlers/command/validate.go
Lines 25 to 27 in 000cb53