-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
WokspaceConfiguration.update() writes machine setting to user settings.json #102543
Labels
*duplicate
Issue identified as a duplicate of another issue(s)
Comments
/duplicate |
justinmk3
added a commit
to aws/aws-toolkit-vscode
that referenced
this issue
Aug 15, 2020
We can define a config value as "machine" scope. But note the lack of `vscode.ConfigurationTarget.Machine` scope, it is expected that we use `vscode.ConfigurationTarget.Global`. Then VSCode will resolve the config value depending on "User" and "Remote" settings, and depending on whether the current session is a Local or Remote instance. NOTE: - Current behavior of `scope=machine` is such that VSCode expects the user to enter a value: writeSetting() does not update the machine-local config. - `scope=machine` has a known bug (issue is closed but NOT resolved): microsoft/vscode#102543 - Long-term solution is to use a passive warning combined with just-in-time detection, rather than fighting VSCode (and the user) to auto-update a user setting. if the user config value is invalid: #1242 REFERENCE: For reference, `Workspace` and `WorkspaceFolder` scopes require a workspace{folder} to write a setting, else writeSetting() fails: await this._configuration.writeSetting(k, detectedLocation, vscode.ConfigurationTarget.Workspace) 2020-08-15 01:50:45 [ERROR]: failed to set config: 'samcli.location'='/home/linuxbrew/.linuxbrew/bin/sam', error: Error: Unable to write aws.samcli.location to Workspace Settings. This setting can be written only into User settings. at D.reject (file:///…/vs/workbench/workbench.desktop.main.js:5544:245) at D.resolveAndValidate (file:///…/vs/workbench/workbench.desktop.main.js:5547:622) at D.doWriteConfiguration (file:///…/vs/workbench/workbench.desktop.main.js:5541:414) at Object.factory (file:///…/vs/workbench/workbench.desktop.main.js:5541:190) at u.consume (file:///…/vs/workbench/workbench.desktop.main.js:130:421) at file:///…/vs/workbench/workbench.desktop.main.js:130:236 at new Promise (<anonymous>) at u.queue (file:///…/vs/workbench/workbench.desktop.main.js:130:160) at D.writeConfiguration (file:///…/vs/workbench/workbench.desktop.main.js:5541:175) at C.writeConfigurationValue (file:///…/vs/workbench/workbench.desktop.main.js:5569:356) at file:///…/vs/workbench/workbench.desktop.main.js:5557:594 at processTicksAndRejections (internal/process/task_queues.js:85:5) { name: 'Error', message: 'Unable to write aws.samcli.location to Workspace ' + 'Settings. This setting can be written only into User ' + 'settings.' } await this._configuration.writeSetting(k, detectedLocation, vscode.ConfigurationTarget.WorkspaceFolder) 2020-08-15 01:50:45 [ERROR]: failed to set config: 'samcli.location'='/home/linuxbrew/.linuxbrew/bin/sam', error: Error: Unable to write to Folder Settings because no resource is provided. at D.reject (file:///…/vs/workbench/workbench.desktop.main.js:5544:245) at D.resolveAndValidate (file:///…/vs/workbench/workbench.desktop.main.js:5547:673) at D.doWriteConfiguration (file:///…/vs/workbench/workbench.desktop.main.js:5541:414) at Object.factory (file:///…/vs/workbench/workbench.desktop.main.js:5541:190) at u.consume (file:///…/vs/workbench/workbench.desktop.main.js:130:421) at file:///…/vs/workbench/workbench.desktop.main.js:130:236 at new Promise (<anonymous>) at u.queue (file:///…/vs/workbench/workbench.desktop.main.js:130:160) at D.writeConfiguration (file:///…/vs/workbench/workbench.desktop.main.js:5541:175) at C.writeConfigurationValue (file:///…/vs/workbench/workbench.desktop.main.js:5569:356) at file:///…/vs/workbench/workbench.desktop.main.js:5557:594 at processTicksAndRejections (internal/process/task_queues.js:85:5) { name: 'Error', message: 'Unable to write to Folder Settings because no resource is provided.' }
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When WorkspaceConfiguration.update() is used with ConfigurationTarget.Global to update a setting with machine scope, I expect the remote machine's global settings to be updated, but instead the local machine's settings are.
Steps to Reproduce:
Expected result:
"foo.bar": {"test": "object"}
is written into the remote machine settings.Actual result: it is written into the local machine's user settings (and shown grayed out in settings.json with a message "this setting cannot be applied in this window. It will be applied when you open a local window.")
Does this issue occur when all extensions are disabled?: No. (This requires using one of the remote development extensions for the issue to occur.)
The text was updated successfully, but these errors were encountered: