Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
run: { module: serverModule, transport: TransportKind.ipc },
debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions }
};
const clientOptions: LanguageClientOptions = {
documentSelector: [
{ scheme: 'file', language: 'cpp' },
{ scheme: 'file', language: 'c'},
],
synchronize: {
fileEvents: workspace.createFileSystemWatcher('**/*'),
}
};
// Create the language client and start the client.
client = new LanguageClient('clangTidy', 'Clang Tidy Linter Client',
serverOptions, clientOptions);
console.log('start');
client.start();
}
// Notify the server about file changes to '.clientrc files contain in the workspace.
fileEvents: workspace.createFileSystemWatcher('**/.clientrc')
},
diagnosticCollectionName: langName,
revealOutputChannelOn: RevealOutputChannelOn.Never,
outputChannel,
outputChannelName: langName,
middleware: {
provideHover: DocsBrowser.hoverLinksMiddlewareHook
},
// Set the current working directory, for HIE, to be the workspace folder.
workspaceFolder: folder
};
// Create the LSP client.
const langClient = new LanguageClient(langName, langName, serverOptions, clientOptions, true);
// Register ClientCapabilities for stuff like window/progress
langClient.registerProposedFeatures();
if (workspace.getConfiguration('languageServerHaskell', uri).showTypeForSelection.onHover) {
context.subscriptions.push(ShowTypeHover.registerTypeHover(clients));
}
// Register editor commands for HIE, but only register the commands once.
if (!hieCommandsRegistered) {
context.subscriptions.push(InsertType.registerCommand(clients));
const showTypeCmd = ShowTypeCommand.registerCommand(clients);
if (showTypeCmd !== null) {
showTypeCmd.forEach(x => context.subscriptions.push(x));
}
context.subscriptions.push(ImportIdentifier.registerCommand());
registerHiePointCommand('hie.commands.demoteDef', 'hare:demote', context);
export function activate(context: ExtensionContext) {
const debugOptions = {execArgv: ['--nolazy', '--debug=6004']};
const settings = workspace.getConfiguration('kytheLanguageServer');
const serverOptions: ServerOptions = {
command: settings.get('bin') || 'kythe_languageserver',
args: settings.get('args'),
};
const clientOptions: LanguageClientOptions = {
// Activate on all files and defer to the server to ignore stuff
documentSelector: [{pattern: '**/*'}]
}
const disposable = new LanguageClient(
'kytheLanguageServer', 'Kythe Language Server',
serverOptions, clientOptions)
.start();
context.subscriptions.push(disposable);
}
}
// Options to control the language client
let clientOptions: LanguageClientOptions = {
// Register the server for plain text documents
documentSelector: ['plaintext'],
synchronize: {
// Synchronize the setting section 'languageServerExample' to the server
configurationSection: 'languageServerExample',
// Notify the server about file changes to '.clientrc files contain in the workspace
fileEvents: workspace.createFileSystemWatcher('**/.clientrc')
}
}
// Create the language client and start the client.
let disposable = new LanguageClient('languageServerExample', 'Language Server Example', serverOptions, clientOptions).start();
// Push the disposable to the context's subscriptions so that the
// client can be deactivated on extension deactivation
context.subscriptions.push(disposable);
}
async function startLsp(logger: Logger, sdks: Sdks): Promise {
const clientOptions: LanguageClientOptions = {
initializationOptions: {
// onlyAnalyzeProjectsWithOpenFiles: true,
closingLabels: config.closingLabels,
},
outputChannelName: "LSP",
};
lspClient = new LanguageClient(
"dartAnalysisLSP",
"Dart Analysis Server",
() => spawn(logger, sdks),
clientOptions,
);
return lspClient.start();
}
isVscode: true
};
// Options to control the language client
let clientOptions: LanguageClientOptions = {
documentSelector: [
{ language: PHP_LANGUAGE_ID, scheme: 'file' },
{ language: PHP_LANGUAGE_ID, scheme: 'untitled' }
],
initializationOptions: initializationOptions,
revealOutputChannelOn: RevealOutputChannelOn.Never,
middleware: middleware
}
// Create the language client and start the client.
languageClient = new LanguageClient('intelephense', 'intelephense', serverOptions, clientOptions);
languageClient.onReady().then(() => {
registerNotificationListeners();
showStartMessage(context);
});
return languageClient;
}
// Otherwise the run options are used
let serverOptions: ServerOptions = {
run: { module: serverModule, transport: TransportKind.ipc },
debug: {
module: serverModule,
transport: TransportKind.ipc,
options: debugOptions
}
};
// Options to control the language client
let clientOptions: LanguageClientOptions = {
};
// Create the language client and start the client.
client = new LanguageClient(
'lsif',
'Language Server Index Format',
serverOptions,
clientOptions
);
// Start the client. This will also launch the server
client.start();
let clientPromise = new Promise((resolve, reject) => {
client.onReady().then(() => {
resolve(client);
}, (error) => {
reject(error);
})
});
function startLangServer() {
const serverOptions: ServerOptions = {
command: "htmlclangsvr"
};
const clientOptions: LanguageClientOptions = {
documentSelector: ["html"]
}
client = new LanguageClient("htmlc", serverOptions, clientOptions);
client.start();
}
{
primaryWorkspaceFolder = vscode.workspace.workspaceFolders[0];
}
//uncomment to allow a debugger to attach to the language server
//args.unshift("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,quiet=y");
let executable: Executable =
{
command: javaExecutablePath,
args: args,
options:
{
cwd: primaryWorkspaceFolder ? vscode.workspace.workspaceFolders[0].uri.fsPath : undefined
}
};
isLanguageClientReady = false;
savedLanguageClient = new LanguageClient("actionscript", "ActionScript & MXML Language Server", executable, clientOptions);
savedLanguageClient.onReady().then(() =>
{
resolve();
isLanguageClientReady = true;
savedLanguageClient.onNotification("as3mxml/logCompilerShellOutput", (notification: string) =>
{
logCompilerShellOutput(notification, false, false);
});
savedLanguageClient.onNotification("as3mxml/clearCompilerShellOutput", () =>
{
logCompilerShellOutput(null, false, true);
});
if(pendingQuickCompileAndDebug)
{
vscode.commands.executeCommand("as3mxml.quickCompileAndDebug");
}
public async run(): Promise {
const initializationOptions: InitializationOptions = {};
const lintMode = config.hhastLintMode;
if (lintMode) {
initializationOptions.lintMode = lintMode;
}
const hhast = new LanguageClient(
'hack',
'HHAST',
{
command: remote.getCommand(this.hhastPath),
args: remote.getArgs(this.hhastPath, [...config.hhastArgs, '--mode', 'lsp', '--from', 'vscode-hack'])
},
{
documentSelector: [{ language: 'hack', scheme: 'file' }],
initializationOptions: initializationOptions,
uriConverters: { code2Protocol: utils.mapFromWorkspaceUri, protocol2Code: utils.mapToWorkspaceUri },
middleware: {
handleDiagnostics: this.handleDiagnostics
}
}
);
this.context.subscriptions.push(hhast.start());