Don't write preferredLocation into workspace settings for find file references

This commit is contained in:
Matt Bierner 2021-01-26 16:17:14 -08:00
parent 0ede524326
commit a56bc0c671

View file

@ -67,13 +67,13 @@ class FileReferencesCommand implements Command {
typeConverters.Location.fromTextSpan(this.client.toResource(reference.file), reference));
const config = vscode.workspace.getConfiguration('references');
const existingSetting = config.get('preferredLocation', undefined);
const existingSetting = config.inspect<string>('preferredLocation');
await config.update('preferredLocation', 'view');
try {
await vscode.commands.executeCommand('editor.action.showReferences', resource, new vscode.Position(0, 0), locations);
} finally {
await config.update('preferredLocation', existingSetting);
await config.update('preferredLocation', existingSetting?.workspaceFolderValue ?? existingSetting?.workspaceValue);
}
});
}