本文整理汇总了TypeScript中vscode-languageclient.LanguageClient.createDefaultErrorHandler方法的典型用法代码示例。如果您正苦于以下问题:TypeScript LanguageClient.createDefaultErrorHandler方法的具体用法?TypeScript LanguageClient.createDefaultErrorHandler怎么用?TypeScript LanguageClient.createDefaultErrorHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vscode-languageclient.LanguageClient
的用法示例。
在下文中一共展示了LanguageClient.createDefaultErrorHandler方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: realActivate
//.........这里部分代码省略.........
directory = directory;
}
else if (workspaceFolderPath && directory) {
directory = path.join(workspaceFolderPath, directory);
}
else {
directory = undefined;
}
let filePath = document.uri.scheme === 'file' ? document.uri.fsPath : undefined;
if (filePath && directory && filePath.startsWith(directory)) {
if (workingDirectory) {
if (workingDirectory.directory.length < directory.length) {
workingDirectory.directory = directory;
workingDirectory.changeProcessCWD = changeProcessCWD;
}
}
else {
workingDirectory = { directory, changeProcessCWD };
}
}
}
}
settings.workingDirectory = workingDirectory;
}
result.push(settings);
}
return result;
}
} as WorkspaceMiddleware
}
};
let client = new LanguageClient(linterName, serverOptions, clientOptions);
client.registerProposedFeatures();
defaultErrorHandler = client.createDefaultErrorHandler();
const running = `${linterName} server is running.`;
const stopped = `${linterName} server stopped.`;
client.onDidChangeState((event) => {
if (event.newState === ClientState.Running) {
client.info(running);
statusBarItem.tooltip = running;
serverRunning = true;
} else {
client.info(stopped);
statusBarItem.tooltip = stopped;
serverRunning = false;
}
updateStatusBarVisibility(Window.activeTextEditor);
});
client.onReady().then(() => {
client.onNotification(StatusNotification.type, (params) => {
updateStatus(params.state);
});
client.onNotification(exitCalled, (params) => {
serverCalledProcessExit = true;
client.error(`Server process exited with code ${params[0]}. This usually indicates a misconfigured ${linterName} setup.`, params[1]);
Window.showErrorMessage(`${linterName} server shut down itself. See '${linterName}' output channel for details.`);
});
client.onRequest(NoStandardLibraryRequest.type, (params) => {
const key = 'noStandardMessageShown';
let state = context.globalState.get<NoStandardState>(key, {});
let uri: Uri = Uri.parse(params.source.uri);
let workspaceFolder = Workspace.getWorkspaceFolder(uri);
let config = Workspace.getConfiguration('standard');
let linter = config.get('semistandard', false) ? 'semistandard' : 'standard';