mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Testbed for 181166
This commit is contained in:
3
lsp-sample/.vscode/launch.json
vendored
3
lsp-sample/.vscode/launch.json
vendored
@ -9,10 +9,11 @@
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
|
||||
"outFiles": ["${workspaceRoot}/client/out/**/*.js"],
|
||||
"autoAttachChildProcesses": true,
|
||||
"preLaunchTask": {
|
||||
"type": "npm",
|
||||
"script": "watch"
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "Language Server E2E Test",
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
import {
|
||||
createConnection,
|
||||
TextDocuments,
|
||||
Range,
|
||||
Diagnostic,
|
||||
DiagnosticSeverity,
|
||||
ProposedFeatures,
|
||||
@ -55,7 +56,8 @@ connection.onInitialize((params: InitializeParams) => {
|
||||
// Tell the client that this server supports code completion.
|
||||
completionProvider: {
|
||||
resolveProvider: true
|
||||
}
|
||||
},
|
||||
codeActionProvider: true,
|
||||
}
|
||||
};
|
||||
if (hasWorkspaceFolderCapability) {
|
||||
@ -147,14 +149,16 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> {
|
||||
const diagnostics: Diagnostic[] = [];
|
||||
while ((m = pattern.exec(text)) && problems < settings.maxNumberOfProblems) {
|
||||
problems++;
|
||||
const range: Range = {
|
||||
start: textDocument.positionAt(m.index),
|
||||
end: textDocument.positionAt(m.index + m[0].length)
|
||||
};
|
||||
const diagnostic: Diagnostic = {
|
||||
severity: DiagnosticSeverity.Warning,
|
||||
range: {
|
||||
start: textDocument.positionAt(m.index),
|
||||
end: textDocument.positionAt(m.index + m[0].length)
|
||||
},
|
||||
range: range,
|
||||
message: `${m[0]} is all uppercase.`,
|
||||
source: 'ex'
|
||||
source: 'ex',
|
||||
data: JSON.stringify(range, undefined, 0)
|
||||
};
|
||||
if (hasDiagnosticRelatedInformationCapability) {
|
||||
diagnostic.relatedInformation = [
|
||||
@ -221,6 +225,9 @@ connection.onCompletionResolve(
|
||||
return item;
|
||||
}
|
||||
);
|
||||
connection.onCodeAction((params) => {
|
||||
return [];
|
||||
});
|
||||
|
||||
// Make the text document manager listen on the connection
|
||||
// for open, change and close text document events
|
||||
|
||||
Reference in New Issue
Block a user