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

.inspect does not return the updated setting but .get does #135121

Closed
karrtikr opened this issue Oct 14, 2021 · 6 comments
Closed

.inspect does not return the updated setting but .get does #135121

karrtikr opened this issue Oct 14, 2021 · 6 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@karrtikr
Copy link
Contributor

karrtikr commented Oct 14, 2021

Does this issue occur when all extensions are disabled?: Yes

Version: 1.61.0 (user setup)
OS: Windows_NT x64 10.0.22471

Steps to Reproduce:

Started happening after VSCode release. FYI we haven't been able to reproduce this issue locally, happens with Github action: microsoft/vscode-python#17708 cc @karthiknadig

  1. Update a setting, for eg.
    const pythonConfig = vscode.workspace.getConfiguration('python');
    await pythonConfig.update('defaultInterpreterPath', 'pythonPath', false);
  1. Wait for the change event to fire via workspace.onDidChangeConfiguration.
  2. Query configuration via .inspect and .get:
    const currentConfig = this.workspace.getConfiguration('python', this.workspaceRoot);
    console.log(`Changed path [default]: ${currentConfig.get<string>('defaultInterpreterPath')}`);
    console.log('Inspect path [default]', JSON.stringify(currentConfig.inspect('defaultInterpreterPath')));
  1. Notice .get returns the correct info and inspect doesn't.
@kieferrm
Copy link
Member

@sandy081 does this constitute a breaking API change?

@sandy081
Copy link
Member

It seems to work for me. I am using following sample

vscode.commands.registerCommand('testExtension.helloWorld', async (arg) => {
		vscode.workspace.getConfiguration().update('testExtension.testSetting', !vscode.workspace.getConfiguration().get('testExtension.testSetting'), vscode.ConfigurationTarget.Global);
	});
	vscode.workspace.onDidChangeConfiguration(e => {
		console.log('get', vscode.workspace.getConfiguration().get('testExtension.testSetting'));
		console.log('inspect', vscode.workspace.getConfiguration().inspect('testExtension.testSetting'));
	});

console log statement for inspect is returning the expected value.

Can you please provide the sample using which you are able to repro?

@sandy081 sandy081 added the info-needed Issue requires more information from poster label Oct 21, 2021
@karrtikr
Copy link
Contributor Author

karrtikr commented Oct 28, 2021

It happens with extension but only on Github actions: microsoft/vscode-python#17708. We'll see if we can shrink down the sample for you to use, and provide it here soon.

@karrtikr karrtikr reopened this Oct 28, 2021
@karthiknadig
Copy link
Member

Still working on getting a minimal repro.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

5 participants
@karthiknadig @kieferrm @sandy081 @karrtikr and others