Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return languageClient.onReady().then(async () => {
const params: ExecuteCommandParams = {
command: 'SonarLint.RefreshDiagnostics',
arguments: refreshArgs
};
return languageClient.sendRequest(ExecuteCommandRequest.type, params);
});
}
registerCommand(params.command, () => {
client.sendRequest(ExecuteCommandRequest.type, {
command: params.command
});
});
}
}))
.then(uris => uris.map(uri => uri.path))
mapPromise = window.showQuickPick(items)
}
let mappath = await mapPromise;
if (!mappath) {
return Promise.reject("No map selected.");
}
let request: ExecuteCommandParams = {
command: "wurst.buildmap",
arguments: [{
'mappath': mappath
}]
};
return client.sendRequest(ExecuteCommandRequest.type, request)
};
const textEditor = Window.activeTextEditor;
if (!textEditor) {
return;
}
const textDocument = {
uri: textEditor.document.uri.toString(),
version: textEditor.document.version,
};
const params = {
command: 'stylelint.applyAutoFix',
arguments: [textDocument],
};
client.sendRequest(ExecuteCommandRequest.type, params).then(undefined, () => {
Window.showErrorMessage(
'Failed to apply styleint fixes to the document. Please consider opening an issue with steps to reproduce.',
);
});
}),
);
let reloadMap = async (args: any[]) => {
let config = vscode.workspace.getConfiguration("wurst");
let request: ExecuteCommandParams = {
command: "wurst.hotreload",
arguments: [{
}]
};
return client.sendRequest(ExecuteCommandRequest.type, request)
};
Commands.registerCommand('eslint.executeAutofix', () => {
const textEditor = Window.activeTextEditor;
if (!textEditor) {
return;
}
const textDocument: VersionedTextDocumentIdentifier = {
uri: textEditor.document.uri.toString(),
version: textEditor.document.version
};
const params: ExecuteCommandParams = {
command: 'eslint.applyAllFixes',
arguments: [textDocument]
};
client.sendRequest(ExecuteCommandRequest.type, params).then(undefined, () => {
Window.showErrorMessage('Failed to apply ESLint fixes to the document. Please consider opening an issue with steps to reproduce.');
});
}),
Commands.registerCommand('eslint.showOutputChannel', () => { client.outputChannel.show(); }),
registerCommand("metals-echo-command", (arg: string) => {
client.sendRequest(ExecuteCommandRequest.type, {
command: arg
});
});