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

Advertise proper exectution location #989

Merged
merged 2 commits into from
Mar 15, 2022
Merged

Conversation

jpogran
Copy link
Contributor

@jpogran jpogran commented Mar 9, 2022

Specify the workspace execution location so that VS Code prefers to install this extension in the remote host when using Remote Extensions like the Remote Container, SSH, or WSL extensions. VS Code will still install this extension locally when working on the local machine.

For more inforamtion see:

Install to local:

image

Install to WSL:

image

Specify the workspace execution location so that VS Code prefers to install this extension in the remote host when using Remote Extensions like the Remote Container, SSH, or WSL extensions. VS Code will still install this extension locally when working on the local machine.

For more inforamtion see:

- https://code.visualstudio.com/api/advanced-topics/remote-extensions#incorrect-execution-location
- https://code.visualstudio.com/api/advanced-topics/extension-host#preferred-extension-location
@jpogran jpogran self-assigned this Mar 9, 2022
@jpogran jpogran added the bug Something isn't working label Mar 9, 2022
@jpogran jpogran linked an issue Mar 9, 2022 that may be closed by this pull request
2 tasks
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://code.visualstudio.com/api/advanced-topics/extension-host#preferred-extension-location

👍🏻 thank you for identifying the problem and for the fix

Do you reckon this would affect #768 in any way?

@jpogran
Copy link
Contributor Author

jpogran commented Mar 9, 2022

Do you reckon this would affect #768 in any way?

In the short term, no. Longer term we have to modify the manifest and extension to support web browser only deployment, so this change doesn't prevent that.

The extensionKind setting determines where the extension is loaded. The workspace value indicates:

"extensionKind": ["workspace"] — Indicates the extension requires access to workspace contents and therefore needs to run where the workspace is located. That can be on the local machine or on the remote machine or Codespace. Most extensions fall into this category.

The extension relies on terraform-ls to provide most of the advanced language features and terraform-ls needs to run where the files are physically located to build a context for all features it provides. This means the extension needs to run where the workspace is located.

We could specify "extensionKind": ["workspace","ui"] so that the ui is a fallback, but I didn't test that combination. This might be a good idea to pursue before we merge this.

As for the web extension, in order for us to run there we have to either WASM the terraform-ls binary or modify the extension manifest to declare its a web extension, which will be pretty involved for us. I don't think that is a concern for us until we start to work on that.

Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@jpogran
Copy link
Contributor Author

jpogran commented Mar 9, 2022

Updated the PR with ui and tested it out locally and in WSL. I don't have a SSH host up to check ATM and don't yet know how to test Codespaces.

@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@jpogran jpogran added this to the 2.21.0 milestone Mar 14, 2022
@jpogran jpogran merged commit e224c9f into main Mar 15, 2022
@jpogran jpogran deleted the gh-988-remote-ext-install branch March 15, 2022 13:53
@radeksimko radeksimko modified the milestones: 2.21.0, v2.20.1 Mar 17, 2022
@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, 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 Apr 17, 2022
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 this pull request may close these issues.

Wrong terraform language server binary
4 participants