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
180 lines (165 loc) · 4.78 KB
/
types.ts
File metadata and controls
180 lines (165 loc) · 4.78 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { DiagnosticCodes } from '../application/diagnostics/constants';
import { TerminalShellType } from '../common/terminal/types';
import { DebugConfigurationType } from '../debugger/extension/types';
import { AutoSelectionRule } from '../interpreter/autoSelection/types';
import { InterpreterType } from '../interpreter/contracts';
import { LinterId } from '../linters/types';
import { IEventNamePropertyMapping } from '../telemetry/index'
import { EventName, PlatformErrors } from './constants';
export type EditorLoadTelemetry = {
condaVersion: string | undefined;
pythonVersion: string | undefined;
interpreterType: InterpreterType | undefined;
terminal: TerminalShellType;
workspaceFolderCount: number;
hasPython3: boolean;
usingUserDefinedInterpreter: boolean;
usingAutoSelectedWorkspaceInterpreter: boolean;
usingGlobalInterpreter: boolean;
};
export type FormatTelemetry = {
tool: 'autopep8' | 'black' | 'yapf';
hasCustomArgs: boolean;
formatSelection: boolean;
};
export type LanguageServerVersionTelemetry = {
success: boolean;
lsVersion?: string;
usedSSL?: boolean;
};
export type LanguageServerErrorTelemetry = {
error: string;
};
export type LanguageServePlatformSupported = {
supported: boolean;
failureType?: 'UnknownError';
};
export type LinterTrigger = 'auto' | 'save';
export type LintingTelemetry = {
tool: LinterId;
hasCustomArgs: boolean;
trigger: LinterTrigger;
executableSpecified: boolean;
};
export type LinterInstallPromptTelemetry = {
tool?: LinterId;
action: 'select' | 'disablePrompt' | 'install';
};
export type LinterSelectionTelemetry = {
tool?: LinterId;
enabled: boolean;
};
export type PythonInterpreterTelemetry = {
trigger: 'ui' | 'shebang' | 'load';
failed: boolean;
pythonVersion?: string;
pipVersion?: string;
};
export type CodeExecutionTelemetry = {
scope: 'file' | 'selection';
};
export type DebuggerTelemetry = IEventNamePropertyMapping[EventName.DEBUGGER];
export type DebuggerPerformanceTelemetry = {
duration: number;
action: 'stepIn' | 'stepOut' | 'continue' | 'next' | 'launch';
};
export type TestTool = 'nosetest' | 'pytest' | 'unittest';
export type TestRunTelemetry = {
tool: TestTool;
scope: 'currentFile' | 'all' | 'file' | 'class' | 'function' | 'failed';
debugging: boolean;
triggerSource: 'ui' | 'codelens' | 'commandpalette' | 'auto' | 'testExplorer';
failed: boolean;
};
export type TestDiscoverytTelemetry = {
tool: TestTool;
trigger: 'ui' | 'commandpalette';
failed: boolean;
};
export type TestConfiguringTelemetry = {
tool?: TestTool;
trigger: 'ui' | 'commandpalette';
failed: boolean;
};
export type FeedbackTelemetry = {
action: 'accepted' | 'dismissed' | 'doNotShowAgain';
};
export type SettingsTelemetry = {
enabled: boolean;
};
export type TerminalTelemetry = {
terminal?: TerminalShellType;
triggeredBy?: 'commandpalette';
pythonVersion?: string;
interpreterType?: InterpreterType;
};
export type DebuggerConfigurationPromtpsTelemetry = {
configurationType: DebugConfigurationType;
autoDetectedDjangoManagePyPath?: boolean;
autoDetectedPyramidIniPath?: boolean;
autoDetectedFlaskAppPyPath?: boolean;
manuallyEnteredAValue?: boolean;
};
export type DiagnosticsAction = {
/**
* Diagnostics command executed.
* @type {string}
*/
commandName?: string;
/**
* Diagnostisc code ignored (message will not be seen again).
* @type {string}
*/
ignoreCode?: string;
/**
* Url of web page launched in browser.
* @type {string}
*/
url?: string;
/**
* Custom actions performed.
* @type {'switchToCommandPrompt'}
*/
action?: 'switchToCommandPrompt';
};
export type DiagnosticsMessages = {
/**
* Code of diagnostics message detected and displayed.
* @type {string}
*/
code: DiagnosticCodes;
};
export type ImportNotebook = {
scope: 'command';
};
export type Platform = {
failureType?: PlatformErrors;
osVersion?: string;
};
export type InterpreterAutoSelection = {
rule?: AutoSelectionRule;
interpreterMissing?: boolean;
identified?: boolean;
updated?: boolean;
};
export type InterpreterDiscovery = {
locator: string;
};
export type InterpreterActivationEnvironmentVariables = {
hasEnvVars?: boolean;
failed?: boolean;
};
export type InterpreterActivation = {
hasCommands?: boolean;
failed?: boolean;
terminal: TerminalShellType;
pythonVersion?: string;
interpreterType: InterpreterType;
};
export const IImportTracker = Symbol('IImportTracker');
export interface IImportTracker {
activate(): Promise<void>;
}