question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't work in multi-folder workspaces

See original GitHub issue

vscode-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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
asvetliakovcommented, Jul 16, 2021

@radeksimko I confirm that v2.13.1 fixes the issue. Thank you!

2reactions
radeksimkocommented, Jul 14, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found