forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
66 lines (52 loc) · 2.07 KB
/
types.ts
File metadata and controls
66 lines (52 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { DiagnosticSeverity, Uri } from 'vscode';
import { Resource } from '../../common/types';
import { PythonPathSource } from '../../debugger/extension/types';
import { DiagnosticCodes } from './constants';
export enum DiagnosticScope {
Global = 'Global',
WorkspaceFolder = 'WorkspaceFolder'
}
export enum DiagnosticIgnoreScope {
always = 'always',
session = 'session'
}
export interface IDiagnostic {
readonly code: DiagnosticCodes;
readonly message: string;
readonly severity: DiagnosticSeverity;
readonly scope: DiagnosticScope;
readonly resource: Resource;
readonly invokeHandler: 'always' | 'default';
}
export const IDiagnosticsService = Symbol('IDiagnosticsService');
export interface IDiagnosticsService {
readonly runInBackground: Boolean;
diagnose(resource: Resource): Promise<IDiagnostic[]>;
canHandle(diagnostic: IDiagnostic): Promise<boolean>;
handle(diagnostics: IDiagnostic[]): Promise<void>;
}
export const IDiagnosticFilterService = Symbol('IDiagnosticFilterService');
export interface IDiagnosticFilterService {
shouldIgnoreDiagnostic(code: string): Promise<boolean>;
ignoreDiagnostic(code: string, scope: DiagnosticScope): Promise<void>;
}
export const IDiagnosticHandlerService = Symbol('IDiagnosticHandlerService');
export interface IDiagnosticHandlerService<T> {
handle(diagnostic: IDiagnostic, options?: T): Promise<void>;
}
export interface IDiagnosticCommand {
readonly diagnostic: IDiagnostic;
invoke(): Promise<void>;
}
export const IInvalidPythonPathInDebuggerService = Symbol('IInvalidPythonPathInDebuggerService');
export interface IInvalidPythonPathInDebuggerService extends IDiagnosticsService {
validatePythonPath(pythonPath?: string, pythonPathSource?: PythonPathSource, resource?: Uri): Promise<boolean>;
}
export const ISourceMapSupportService = Symbol('ISourceMapSupportService');
export interface ISourceMapSupportService {
register(): void;
enable(): Promise<void>;
}