Doesn't work in multi-folder workspaces
See original GitHub issuevscode-terraform: 2.13.0 terraform-ls: 0.19.0
Scenario 1, have following VSCode workspace structure:
{
"folders": [
{
"name": "TF Project 1",
"path": "tf1"
},
{
"name": "TF Project 2",
"path": "tf2"
},
{
"name": "TF Project 3",
"path": "tf3"
}
]
}
Result:: doesn’t work in anything but TF Project 1. I.e. it works only for the first folder, if i reorder and move Project 2 to the top, it’s starting to work here, but not in Project 1
Scenario 2:
{
"folders": [
{
"name": "NON TF Project",
"path": "nontf"
},
{
"name": "TF Project 1",
"path": "tf1"
},
{
"name": "TF Project 2",
"path": "tf2"
},
{
"name": "TF Project 3",
"path": "tf3"
}
]
}
Result:": Doesn’t work anywhere
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (6 by maintainers)
Top Results From Across the Web
${workspaceFolder} can not be resolved in a multi folder ...
This worked out nice using workspaceFolder scoping, but now it suddenly doesn't work anymore and I get this error message: ${workspaceFolder} ...
Read more >Multi-root Workspaces in Visual Studio Code
You can work with multiple project folders in Visual Studio Code with multi-root workspaces. This can be helpful when you are working on...
Read more >'${workspaceFolder}' can not be resolved. Please open a ...
In VScode go to file --> Add folder to workspace and select the folder where the program files are located.
Read more >How to use Workspaces in Visual Studio Code - YouTube
How to add folders to workspaces using vscode. ... How to use Workspaces in Visual Studio Code | Open Multiple Folders and Projects...
Read more >How to fix this error in Visual Studio Code - YouTube
In this video we will fix this error: Open a folder or workspace... (File -- Open Folder ), caused in VS Code (Visual...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@radeksimko I confirm that
v2.13.1fixes the issue. Thank you!I can confirm that this affects workspaces where the first folder is not parent folder of the other folders which contain Terraform code.
The main root cause is the document selector
https://github.com/hashicorp/vscode-terraform/blob/583bdf59a19d46a0f5e2325f0d7a11379e0bd337/src/extension.ts#L284-L285
I’m working on a fix.