forked from microsoft/vscode-python-debugger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
155 lines (130 loc) · 4.51 KB
/
types.ts
File metadata and controls
155 lines (130 loc) · 4.51 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
/* eslint-disable @typescript-eslint/naming-convention */
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { DebugConfiguration } from 'vscode';
import { DebugProtocol } from '@vscode/debugprotocol';
import { IDisposableRegistry, IExtensionContext } from './common/types';
import { DebuggerTypeName } from './constants';
/**
* The global extension state needed by components.
*
*/
export type ExtensionState = {
context: IExtensionContext;
disposables: IDisposableRegistry;
};
export enum DebugOptions {
RedirectOutput = 'RedirectOutput',
Django = 'Django',
Jinja = 'Jinja',
DebugStdLib = 'DebugStdLib',
Sudo = 'Sudo',
Pyramid = 'Pyramid',
FixFilePathCase = 'FixFilePathCase',
WindowsClient = 'WindowsClient',
UnixClient = 'UnixClient',
StopOnEntry = 'StopOnEntry',
ShowReturnValue = 'ShowReturnValue',
SubProcess = 'Multiprocess',
}
export enum DebugPurpose {
DebugTest = 'debug-test',
DebugInTerminal = 'debug-in-terminal',
}
export type PathMapping = {
localRoot: string;
remoteRoot: string;
};
type Connection = {
host?: string;
port?: number | string;
};
export interface IAutomaticCodeReload {
enable?: boolean;
exclude?: string[];
include?: string[];
pollingInterval?: number;
}
interface ICommonDebugArguments {
redirectOutput?: boolean;
django?: boolean;
gevent?: boolean;
jinja?: boolean;
debugStdLib?: boolean;
justMyCode?: boolean;
logToFile?: boolean;
debugOptions?: DebugOptions[];
port?: number | string;
host?: string;
// Show return values of functions while stepping.
showReturnValue?: boolean;
subProcess?: boolean;
// An absolute path to local directory with source.
pathMappings?: PathMapping[];
}
interface IKnownAttachDebugArguments extends ICommonDebugArguments {
workspaceFolder?: string;
customDebugger?: boolean;
// localRoot and remoteRoot are deprecated (replaced by pathMappings).
localRoot?: string;
remoteRoot?: string;
// Internal field used to attach to subprocess using python debug adapter
subProcessId?: number;
processId?: number | string;
connect?: Connection;
listen?: Connection;
}
interface IKnownLaunchRequestArguments extends ICommonDebugArguments {
sudo?: boolean;
pyramid?: boolean;
workspaceFolder?: string;
// An absolute path to the program to debug.
module?: string;
program?: string;
python?: string;
// Automatically stop target after launch. If not specified, target does not stop.
stopOnEntry?: boolean;
args?: string[] | String;
cwd?: string;
debugOptions?: DebugOptions[];
env?: Record<string, string | undefined>;
envFile?: string;
console?: ConsoleType;
// The following are all internal properties that are not publicly documented or
// exposed in launch.json schema for the extension.
// Python interpreter used by the extension to spawn the debug adapter.
debugAdapterPython?: string;
// Debug adapter to use in lieu of the one bundled with the extension.
// This must be a full path that is executable with "python <debugAdapterPath>";
// for debugpy, this is ".../src/debugpy/adapter".
debugAdapterPath?: string;
// Python interpreter used by the debug adapter to spawn the debug launcher.
debugLauncherPython?: string;
// Legacy interpreter setting. Equivalent to setting "python", "debugAdapterPython",
// and "debugLauncherPython" all at once.
pythonPath?: string;
// Configures automatic code reloading.
autoReload?: IAutomaticCodeReload;
// Defines where the purpose where the config should be used.
purpose?: DebugPurpose[];
}
export interface LaunchRequestArguments
extends DebugProtocol.LaunchRequestArguments,
IKnownLaunchRequestArguments,
DebugConfiguration {
type: typeof DebuggerTypeName;
}
export interface AttachRequestArguments
extends DebugProtocol.AttachRequestArguments,
IKnownAttachDebugArguments,
DebugConfiguration {
type: typeof DebuggerTypeName;
}
export interface DebugConfigurationArguments extends LaunchRequestArguments, AttachRequestArguments {}
export type ConsoleType = 'internalConsole' | 'integratedTerminal' | 'externalTerminal';
export type TriggerType = 'launch' | 'attach' | 'test' | 'noConfig';
export type IStartupDurations = Record<
'totalNonBlockingActivateTime' | 'totalActivateTime' | 'startActivateTime' | 'codeLoadingTime',
number
>;