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

Update to workspace folder settings does not work #49258

Closed
DonJayamanne opened this issue May 5, 2018 · 1 comment
Closed

Update to workspace folder settings does not work #49258

DonJayamanne opened this issue May 5, 2018 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug config VS Code configuration, set up issues verified Verification succeeded
Milestone

Comments

@DonJayamanne
Copy link
Contributor

DonJayamanne commented May 5, 2018

Issue Type: Bug

This is very similar to a previously reported issue #36448
Unfortunately we (Python Extension) didn't catch this bug as our CI tests run against the stable versions of VS Code and we released our extension a day before VSC. Once a new version of VS Code was released our CI tests started to fail.

In light of this issue we'll consider either running our tests against VSC insiders or releasing after VSC (TBD).

Here are the steps to replicate the issue:

  • Use VSC Insiders or latest stable version (Version 1.23.0)
  • Create a multiroot workspace folder name workspace1
  • Create workspace settings file with the setting editor.autoIndent = false
  • Create a workspace folder settings file with the same settings
  • Execute the following code inside VS Code (via an extension)
  • You'll see that the last update fails, expected value is false, but we get true.
  • Note, uncommenting the setTimeout (delay) will get around this issue. (same as Updates to workspace settings not available immediately in multi-root workspaces #36448)
        const workspaceUri = Uri.file('full path to workspace1');

        let settings = workspace.getConfiguration('editor', workspaceUri);
        await settings.update('autoIndent', false, ConfigurationTarget.Workspace);
        settings = workspace.getConfiguration('editor', workspaceUri);
        await settings.update('autoIndent', true, ConfigurationTarget.WorkspaceFolder);

        settings = workspace.getConfiguration('editor', workspaceUri);
        console.log(`editor.autoIndent is ${settings.get('autoIndent')}, and expected true`);

        settings = workspace.getConfiguration('editor', workspaceUri);
        await settings.update('autoIndent', true, ConfigurationTarget.Workspace);
        settings = workspace.getConfiguration('editor', workspaceUri);
        await settings.update('autoIndent', false, ConfigurationTarget.WorkspaceFolder);

        // Trick, place a delay and the values get loaded
        // await new Promise(resolve => setTimeout(resolve, 2000))

        settings = workspace.getConfiguration('editor', workspaceUri);
        console.log(`editor.autoIndent is ${settings.get('autoIndent')}, and expected false`);

VS Code version: Code - Insiders 1.24.0-insider (2404210, 2018-05-04T08:05:15.549Z)
OS version: Darwin x64 17.5.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 2900)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 4, 4, 4
Memory (System) 16.00GB (0.82GB free)
Process Argv /Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron -psn_0_21140520
Screen Reader no
VM 0%
Extensions (27)
Extension Author (truncated) Version
vscode-generate-getter-setter DSK 0.5.0
xml Dot 1.9.2
gc-virtualdocumentspy Gra 1.0.1
vscode-docker Pet 0.0.26
application-insights Vis 0.4.2
django-html bib 1.2.0
django-snippets bib 1.1.0
gitignore cod 0.5.0
vscode-eslint dba 1.4.8
githistory don 0.4.0
gitlens eam 8.2.4
tslint eg2 1.0.28
vscode-npm-script eg2 0.3.4
docthis joe 0.6.0
Go ms- 0.6.79
MagicPython mag 1.0.12
dotenv mik 1.0.1
extension-manifest-editor ms- 0.1.5
python ms- 2018.5.0-alpha
vsliveshare ms- 0.3.93
debugger-for-chrome msj 4.4.1
autodocstring njp 0.2.1
typescript-hero rbb 2.3.2
vscode-yaml red 0.0.11
vscode-icons rob 7.23.0
cython tcw 0.1.0
jinja who 0.0.8
@SchoofsKelvin
Copy link
Contributor

I have a similar issue, also in VSCode 1.23.0, but in my case, updating the global settings seems to have no effect until a reload or until workspace settings are changed:

  • The global setting 'sshfs.configs' looks something like this:
"sshfs.configs": [
	{
		"root": "/var/www",
		"putty": "server2",
		"label": "My 2nd server",
		"name": "server2"
	}
]
  • The Workspace setting also looks that way. If the setting is missing there, the bug doesn't happen
  • I change that array (adding/modifying/removing entries) either using the editor, .update() or both
    (Code-wise, I update using vscode.ConfigurationTarget.Global as third parameter)
  • getConfiguration('sshfs').inspect('configs') keeps returning the old values
  • Only when I reload the window or change the Workspace settings does it update
    (as in, .inspect('configs').globalValue now returns the updated settings)
    (somehow changing the Workspace settings busts the "global settings cache")
  • At this point, changing the global settings has again no effect until the above step is repeated

Both tested with and without any extensions (including built-in ones)

VS Code version: Code 1.23.0 (7c7da59, 2018-05-03T16:44:55.614Z)
OS version: Windows_NT x64 10.0.15063

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz (8 x 2594)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 7.91GB (0.84GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe C:\Users\schoo_000\Workspaces\NPM\NPM.code-workspace
Screen Reader no
VM 0%

@roblourens roblourens added the verified Verification succeeded label May 31, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug config VS Code configuration, set up issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants