mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
@ -136,7 +136,7 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> {
|
||||
const diagnostics: Diagnostic[] = [];
|
||||
while ((m = pattern.exec(text)) && problems < settings.maxNumberOfProblems) {
|
||||
problems++;
|
||||
const diagnosic: Diagnostic = {
|
||||
const diagnostic: Diagnostic = {
|
||||
severity: DiagnosticSeverity.Warning,
|
||||
range: {
|
||||
start: textDocument.positionAt(m.index),
|
||||
@ -146,24 +146,24 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> {
|
||||
source: 'ex'
|
||||
};
|
||||
if (hasDiagnosticRelatedInformationCapability) {
|
||||
diagnosic.relatedInformation = [
|
||||
diagnostic.relatedInformation = [
|
||||
{
|
||||
location: {
|
||||
uri: textDocument.uri,
|
||||
range: Object.assign({}, diagnosic.range)
|
||||
range: Object.assign({}, diagnostic.range)
|
||||
},
|
||||
message: 'Spelling matters'
|
||||
},
|
||||
{
|
||||
location: {
|
||||
uri: textDocument.uri,
|
||||
range: Object.assign({}, diagnosic.range)
|
||||
range: Object.assign({}, diagnostic.range)
|
||||
},
|
||||
message: 'Particularly for names'
|
||||
}
|
||||
];
|
||||
}
|
||||
diagnostics.push(diagnosic);
|
||||
diagnostics.push(diagnostic);
|
||||
}
|
||||
|
||||
// Send the computed diagnostics to VSCode.
|
||||
|
||||
@ -15,7 +15,7 @@ export function activate(context: ExtensionContext) {
|
||||
|
||||
/*
|
||||
* all except the code to create the language client in not browser specific
|
||||
* and couuld be shared with a regular (Node) extension
|
||||
* and could be shared with a regular (Node) extension
|
||||
*/
|
||||
const documentSelector = [{ language: 'plaintext' }];
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ const connection = createConnection(messageReader, messageWriter);
|
||||
|
||||
connection.onInitialize((params: InitializeParams): InitializeResult => {
|
||||
const capabilities: ServerCapabilities = {
|
||||
colorProvider: {} // provide a color providr
|
||||
colorProvider: {} // provide a color provider
|
||||
};
|
||||
return { capabilities };
|
||||
});
|
||||
|
||||
@ -8,7 +8,7 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
const runHandler = (request: vscode.TestRunRequest, cancellation: vscode.CancellationToken) => {
|
||||
const queue: { test: vscode.TestItem; data: TestCase }[] = [];
|
||||
const run = ctrl.createTestRun(request);
|
||||
// map of file uris to statments on each line:
|
||||
// map of file uris to statements on each line:
|
||||
const coveredLines = new Map</* file uri */ string, (vscode.StatementCoverage | undefined)[]>();
|
||||
|
||||
const discoverTests = async (tests: Iterable<vscode.TestItem>) => {
|
||||
|
||||
Reference in New Issue
Block a user