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
232 lines (210 loc) · 7.09 KB
/
Copy pathtypes.ts
File metadata and controls
232 lines (210 loc) · 7.09 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { Socket } from 'net';
import { ConfigurationTarget, DiagnosticSeverity, Disposable, Uri } from 'vscode';
import { EnvironmentVariables } from './variables/types';
export const IOutputChannel = Symbol('IOutputChannel');
export const IDocumentSymbolProvider = Symbol('IDocumentSymbolProvider');
export const IsWindows = Symbol('IS_WINDOWS');
export const Is64Bit = Symbol('Is64Bit');
export const IDisposableRegistry = Symbol('IDiposableRegistry');
export const IMemento = Symbol('IGlobalMemento');
export const GLOBAL_MEMENTO = Symbol('IGlobalMemento');
export const WORKSPACE_MEMENTO = Symbol('IWorkspaceMemento');
export interface IPersistentState<T> {
readonly value: T;
updateValue(value: T): Promise<void>;
}
export const IPersistentStateFactory = Symbol('IPersistentStateFactory');
export interface IPersistentStateFactory {
createGlobalPersistentState<T>(key: string, defaultValue: T): IPersistentState<T>;
createWorkspacePersistentState<T>(key: string, defaultValue: T): IPersistentState<T>;
}
export type ExecutionInfo = {
execPath?: string;
moduleName?: string;
args: string[];
product?: Product;
};
export const ILogger = Symbol('ILogger');
export interface ILogger {
logError(message: string, error?: Error);
logWarning(message: string, error?: Error);
}
export enum InstallerResponse {
Installed,
Disabled,
Ignore
}
export enum Product {
pytest = 1,
nosetest = 2,
pylint = 3,
flake8 = 4,
pep8 = 5,
pylama = 6,
prospector = 7,
pydocstyle = 8,
yapf = 9,
autopep8 = 10,
mypy = 11,
unittest = 12,
ctags = 13,
rope = 14,
isort = 15
}
export enum ModuleNamePurpose {
install = 1,
run = 2
}
export const IInstaller = Symbol('IInstaller');
export interface IInstaller {
promptToInstall(product: Product, resource?: Uri): Promise<InstallerResponse>;
install(product: Product, resource?: Uri): Promise<InstallerResponse>;
isInstalled(product: Product, resource?: Uri): Promise<boolean | undefined>;
translateProductToModuleName(product: Product, purpose: ModuleNamePurpose): string;
}
export const IPathUtils = Symbol('IPathUtils');
export interface IPathUtils {
getPathVariableName(): 'Path' | 'PATH';
}
export const ICurrentProcess = Symbol('ICurrentProcess');
export interface ICurrentProcess {
readonly env: EnvironmentVariables;
readonly argv: string[];
readonly stdout: NodeJS.WriteStream;
readonly stdin: NodeJS.ReadStream;
on(event: string | symbol, listener: Function): this;
}
export interface IPythonSettings {
readonly pythonPath: string;
readonly venvPath: string;
readonly venvFolders: string[];
readonly jediEnabled: boolean;
readonly jediPath: string;
readonly jediMemoryLimit: number;
readonly devOptions: string[];
readonly linting?: ILintingSettings;
readonly formatting?: IFormattingSettings;
readonly unitTest?: IUnitTestSettings;
readonly autoComplete?: IAutoCompleteSettings;
readonly terminal: ITerminalSettings;
readonly sortImports?: ISortImportSettings;
readonly workspaceSymbols?: IWorkspaceSymbolSettings;
readonly envFile: string;
readonly disablePromptForFeatures: string[];
readonly disableInstallationChecks: boolean;
readonly globalModuleInstallation: boolean;
}
export interface ISortImportSettings {
readonly path: string;
readonly args: string[];
}
export interface IUnitTestSettings {
readonly promptToConfigure: boolean;
readonly debugPort: number;
readonly debugHost?: string;
readonly nosetestsEnabled: boolean;
nosetestPath: string;
nosetestArgs: string[];
readonly pyTestEnabled: boolean;
pyTestPath: string;
pyTestArgs: string[];
readonly unittestEnabled: boolean;
unittestArgs: string[];
cwd?: string;
readonly useExperimentalDebugger?: boolean;
}
export interface IPylintCategorySeverity {
readonly convention: DiagnosticSeverity;
readonly refactor: DiagnosticSeverity;
readonly warning: DiagnosticSeverity;
readonly error: DiagnosticSeverity;
readonly fatal: DiagnosticSeverity;
}
export interface IPep8CategorySeverity {
readonly W: DiagnosticSeverity;
readonly E: DiagnosticSeverity;
}
// tslint:disable-next-line:interface-name
export interface Flake8CategorySeverity {
readonly F: DiagnosticSeverity;
readonly E: DiagnosticSeverity;
readonly W: DiagnosticSeverity;
}
export interface IMypyCategorySeverity {
readonly error: DiagnosticSeverity;
readonly note: DiagnosticSeverity;
}
export interface ILintingSettings {
readonly enabled: boolean;
readonly ignorePatterns: string[];
readonly prospectorEnabled: boolean;
readonly prospectorArgs: string[];
readonly pylintEnabled: boolean;
readonly pylintArgs: string[];
readonly pep8Enabled: boolean;
readonly pep8Args: string[];
readonly pylamaEnabled: boolean;
readonly pylamaArgs: string[];
readonly flake8Enabled: boolean;
readonly flake8Args: string[];
readonly pydocstyleEnabled: boolean;
readonly pydocstyleArgs: string[];
readonly lintOnSave: boolean;
readonly maxNumberOfProblems: number;
readonly pylintCategorySeverity: IPylintCategorySeverity;
readonly pep8CategorySeverity: IPep8CategorySeverity;
readonly flake8CategorySeverity: Flake8CategorySeverity;
readonly mypyCategorySeverity: IMypyCategorySeverity;
prospectorPath: string;
pylintPath: string;
pep8Path: string;
pylamaPath: string;
flake8Path: string;
pydocstylePath: string;
mypyEnabled: boolean;
mypyArgs: string[];
mypyPath: string;
readonly pylintUseMinimalCheckers: boolean;
}
export interface IFormattingSettings {
readonly provider: string;
autopep8Path: string;
readonly autopep8Args: string[];
yapfPath: string;
readonly yapfArgs: string[];
}
export interface IAutoCompleteSettings {
readonly addBrackets: boolean;
readonly extraPaths: string[];
readonly preloadModules: string[];
readonly showAdvancedMembers: boolean;
}
export interface IWorkspaceSymbolSettings {
readonly enabled: boolean;
tagFilePath: string;
readonly rebuildOnStart: boolean;
readonly rebuildOnFileSave: boolean;
readonly ctagsPath: string;
readonly exclusionPatterns: string[];
}
export interface ITerminalSettings {
readonly executeInFileDir: boolean;
readonly launchArgs: string[];
readonly activateEnvironment: boolean;
}
export interface IPythonAnalysisEngineSettings {
readonly showAdvancedMembers: boolean;
}
export const IConfigurationService = Symbol('IConfigurationService');
export interface IConfigurationService {
getSettings(resource?: Uri): IPythonSettings;
isTestExecution(): boolean;
updateSettingAsync(setting: string, value?: {}, resource?: Uri, configTarget?: ConfigurationTarget): Promise<void>;
}
export const ISocketServer = Symbol('ISocketServer');
export interface ISocketServer extends Disposable {
readonly client: Promise<Socket>;
Start(options?: { port?: number; host?: string }): Promise<number>;
}