Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/test/simulation/diagnosticProviders/diagnosticsProvider.ts
13395 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { ITestingServicesAccessor } from '../../../src/platform/test/node/services';
7
8
export interface IFile {
9
fileName: string;
10
fileContents: string;
11
}
12
13
export abstract class DiagnosticsProvider {
14
abstract getDiagnostics(accessor: ITestingServicesAccessor, files: IFile[]): Promise<ITestDiagnostic[]>;
15
16
protected isInstalled(): boolean { return true; }
17
}
18
19
/**
20
* This is serialized in the cache.
21
*/
22
export interface ITestDiagnostic extends ITestDiagnosticLocation {
23
code: string | number | undefined;
24
message: string;
25
relatedInformation: ITSDiagnosticRelatedInformation[] | undefined;
26
source: string;
27
/**
28
* For typescript, this is used to differentiate between semantic and syntax errors.
29
*/
30
kind?: string;
31
}
32
33
export interface ITestDiagnosticLocation {
34
file: string;
35
startLine: number;
36
startCharacter: number;
37
endLine: number;
38
endCharacter: number;
39
}
40
41
export interface ITSDiagnosticRelatedInformation {
42
location: ITestDiagnosticLocation;
43
message: string;
44
code: number;
45
}
46
47