Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let serverOptions = {
run: { module: serverModule },
debug: { module: serverModule, options: debugOptions}
};
let clientOptions: LanguageClientOptions = {
documentSelector: ['javascript', 'javascriptreact'],
synchronize: {
configurationSection: 'jscs',
fileEvents: workspace.createFileSystemWatcher('**/.jscsrc')
}
}
let client = new LanguageClient('JSCS', serverOptions, clientOptions);
context.subscriptions.push(new SettingMonitor(client, 'jscs.enable').start());
// commands.registerCommand('jscs.fixFile', () => {
// client.sendRequest(MyCommandRequest.type, { command: "jscs-quickfix"}).then((result) => {
// window.showInformationMessage(result.message);
// });
// });
}
options: {
execArgv: ['--nolazy', '--debug=6004']
}
}
};
const client = new LanguageClient(
'doiuse',
'doiuse language server',
serverOptions,
clientOptions
);
// Go to the world
context.subscriptions.push(
new SettingMonitor(client, 'doiuse.enable').start()
);
}
// Synchronize the setting section "c-cpp-flylint" to the server.
configurationSection: "c-cpp-flylint",
fileEvents: workspace.createFileSystemWatcher("**/{c_cpp_properties.json,.clang_complete,.flexelint.lnt}")
}
};
const client = new LanguageClient("c-cpp-flylint", "C/C++ Flylint", serverOptions, clientOptions);
client.onReady()
.then(() => {
client.onRequest('activeTextDocument', () => {
return window.activeTextEditor!.document;
});
});
context.subscriptions.push(new SettingMonitor(client, "c-cpp-flylint.enable").start());
}
let languages: string[] = config.get('documentSelector');
let documentSelector = languages.map(language => ({ language, scheme: 'file' }));
// Set options
let clientOptions: LanguageClientOptions = {
documentSelector,
diagnosticCollectionName: 'htmlhint',
synchronize: {
configurationSection: 'htmlhint',
fileEvents: workspace.createFileSystemWatcher('**/.htmlhintrc')
}
}
let forceDebug = false;
let client = new LanguageClient('HTML-hint', serverOptions, clientOptions, forceDebug);
context.subscriptions.push(new SettingMonitor(client, 'htmlhint.enable').start());
}
synchronize: {
configurationSection: 'jshint',
fileEvents: [workspace.createFileSystemWatcher('**/.jshint{rc,ignore}'), workspace.createFileSystemWatcher('**/package.json')]
},
initializationOptions: () => {
const configuration = workspace.getConfiguration('jshint');
return {
nodePath: configuration && configuration.nodePath,
packageManager: configuration && configuration.packageManager
};
}
};
let client = new LanguageClient('jshint', serverOptions, clientOptions);
context.subscriptions.push(
new SettingMonitor(client, 'jshint.enable').start(),
commands.registerCommand('jshint.showOutputChannel', () => client.outputChannel.show())
);
}
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.',
);
});
}),
);
subscriptions.push(new SettingMonitor(client, 'stylelint.enable').start());
};
context.subscriptions.push(activeDecorations.disposables);
client.onNotification(StatusNotification.type, (params) => {
const { state, uri } = params;
updateStatus(state);
showNotificationIfNeeded(params);
activeDecorations.updateDecorations(uri);
});
client.onNotification(exitCalled, (params) => {
serverCalledProcessExit = true;
client.error(`Server process exited with code ${params[0]}. This usually indicates a misconfigured setup.`, params[1]);
vscode.window.showErrorMessage(`DeepScan server shut down. See 'DeepScan' output channel for details.`);
});
});
const disposable = new SettingMonitor(client, 'deepscan.enable').start();
context.subscriptions.push(disposable);
let rules = [];
try {
const rulesObj = JSON.parse(fs.readFileSync(context.asAbsolutePath(path.join('client', 'resources', 'deepscan-rules.json'))).toString());
rules = rulesObj.rules;
} catch (e) {
vscode.window.showWarningMessage(`Can't read or parse rule definitions: ${e.message}`);
}
let style: string = '';
try {
style = fs.readFileSync(context.asAbsolutePath(path.join('client', 'resources', 'style.css'))).toString();
} catch (e) {
vscode.window.showWarningMessage(`Can't read a style: ${e.message}`);
}
execArgv: ['--nolazy', '--debug=6004']
}
}
};
const serverOptions = {
documentSelector: ['css', 'less', 'stylus', 'scss', 'sass', 'sass-indented'],
synchronize: {
configurationSection: 'doiuse'
},
diagnosticCollectionName: 'doiuse'
};
const client = new LanguageClient('doiuse', clientOptions, serverOptions);
context.subscriptions.push(new SettingMonitor(client, 'doiuse.enable').start());
}
module: serverModule,
transport: TransportKind.ipc,
options: {
execArgv: ['--nolazy', '--debug=6004']
}
}
},
{
documentSelector: ['css'],
synchronize: {
configurationSection: 'csstree'
}
}
);
context.subscriptions.push(new SettingMonitor(client, 'csstree.enable').start());
};