-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Closed
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugconfigVS Code configuration, settingsVS Code configuration, settingsverifiedVerification succeededVerification succeeded
Milestone
Description
- Create an extension that writes tasks configuration.
export function activate(context: vscode.ExtensionContext) {
vscode.commands.registerCommand('extension.sayHello', async () => {
if (!vscode.window.activeTextEditor) {
vscode.window.showInformationMessage('Open an editor');
return;
}
let config = vscode.workspace.getConfiguration(undefined, vscode.window.activeTextEditor.document.uri);
try {
await config.update('tasks', { 'abc': true }, vscode.ConfigurationTarget.WorkspaceFolder);
} catch (e) {
console.error(e);
}
});
}
Above code should write into the tasks file of the workspace folder of the current active editor in a multi root workspace. But it is throwing an error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugconfigVS Code configuration, settingsVS Code configuration, settingsverifiedVerification succeededVerification succeeded