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

Set proper scope for machine based settings #1164

Merged
merged 1 commit into from
Jul 1, 2022
Merged

Conversation

jpogran
Copy link
Contributor

@jpogran jpogran commented Jun 29, 2022

This sets the following settings to machine-overridable scope. This ensures these settings will be read in the correct location whether the user is using the extension locally or in a remote context like the Remote Extensions or Codespaces.

It is set to machine-overridable instead of just machine, to still allow users to have these settings set inside a Workspace file or in the Workspace folder. If we set it to just machine, the settings would not be modifiable in the Workspace file or in the Workspace folder scopes.

terraform.languageServer.path
terraform.languageServer.args
terraform.languageServer.terraform.path
terraform.languageServer.terraform.timeout
terraform.languageServer.terraform.logFilePath
terraform.languageServer.rootModules
terraform.languageServer.excludeRootModules
terraform.languageServer.ignoreDirectoryNames

For all other settings, this sets the scope to the default window. This removes the error messages being logged in the extension host about accessing a resource scoped setting using a non resource scoped method:

[2022-06-29 12:40:41.683] [exthost] [warning] [hashicorp.terraform] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for 'terraform.languageServer.enable', provide the URI of a resource or 'null' for any resource.

This sets the following settings to `machine-overridable` scope. This ensures these settings will be read in the correct location whether the user is using the extension locally or in a remote context like the Remote Extensions or Codespaces.

It is set to `machine-overridable` instead of just `machine`, to still allow users to have these settings set inside a Workspace file or in the Workspace folder. If we set it to just `machine`, the settings would not be modifiable in the Workspace file or in the Workspace folder scopes.

```
terraform.languageServer.path
terraform.languageServer.args
terraform.languageServer.terraform.path
terraform.languageServer.terraform.timeout
terraform.languageServer.terraform.logFilePath
terraform.languageServer.rootModules
terraform.languageServer.excludeRootModules
terraform.languageServer.ignoreDirectoryNames
```
@jpogran jpogran added the enhancement New feature or request label Jun 29, 2022
@jpogran jpogran self-assigned this Jun 29, 2022
@jpogran jpogran marked this pull request as ready for review June 29, 2022 16:41
@jpogran jpogran requested a review from a team as a code owner June 29, 2022 16:41
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.

Looks like a sensible choice of scopes to me. We could remove `"scope": "window", since it's the default. But I'm also okay with being explicit here.

@github-actions
Copy link

github-actions bot commented Aug 1, 2022

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 Aug 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants