@codingame/monaco-vscode-api 4.5.0-improve-code-splitting.1 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -8
- package/editor.api.d.ts +8 -0
- package/localExtensionHost.d.ts +41 -0
- package/package.json +10 -8
- package/service-override/accessibility.d.ts +5 -0
- package/service-override/ai.d.ts +5 -0
- package/service-override/authentication.d.ts +5 -0
- package/service-override/base.d.ts +5 -0
- package/service-override/bulkEdit.d.ts +5 -0
- package/service-override/chat.d.ts +5 -0
- package/service-override/comments.d.ts +5 -0
- package/service-override/configuration.d.ts +31 -0
- package/service-override/debug.d.ts +5 -0
- package/service-override/dialogs.d.ts +12 -0
- package/service-override/editSessions.d.ts +5 -0
- package/service-override/editor.d.ts +10 -0
- package/service-override/emmet.d.ts +5 -0
- package/service-override/environment.d.ts +10 -0
- package/service-override/explorer.d.ts +5 -0
- package/service-override/extensionGallery.d.ts +12 -0
- package/service-override/extensions.d.ts +43 -0
- package/service-override/files.d.ts +164 -0
- package/service-override/host.d.ts +5 -0
- package/service-override/interactive.d.ts +5 -0
- package/service-override/issue.d.ts +5 -0
- package/service-override/keybindings.d.ts +21 -0
- package/service-override/languageDetectionWorker.d.ts +5 -0
- package/service-override/languages.d.ts +6 -0
- package/service-override/layout.d.ts +128 -0
- package/service-override/lifecycle.d.ts +5 -0
- package/service-override/localization.d.ts +14 -0
- package/service-override/log.d.ts +14 -0
- package/service-override/markers.d.ts +5 -0
- package/service-override/model.d.ts +5 -0
- package/service-override/monarch.d.ts +5 -0
- package/service-override/multiDiffEditor.d.ts +5 -0
- package/service-override/notebook.d.ts +5 -0
- package/service-override/notifications.d.ts +5 -0
- package/service-override/outline.d.ts +5 -0
- package/service-override/output.d.ts +10 -0
- package/service-override/performance.d.ts +5 -0
- package/service-override/preferences.d.ts +5 -0
- package/service-override/quickaccess.d.ts +11 -0
- package/service-override/relauncher.d.ts +5 -0
- package/service-override/remoteAgent.d.ts +12 -0
- package/service-override/scm.d.ts +5 -0
- package/service-override/search.d.ts +12 -0
- package/service-override/secretStorage.d.ts +5 -0
- package/service-override/share.d.ts +5 -0
- package/service-override/snippets.d.ts +9 -0
- package/service-override/speech.d.ts +5 -0
- package/service-override/storage.d.ts +66 -0
- package/service-override/survey.d.ts +5 -0
- package/service-override/task.d.ts +5 -0
- package/service-override/terminal.d.ts +71 -0
- package/service-override/testing.d.ts +5 -0
- package/service-override/textmate.d.ts +6 -0
- package/service-override/theme.d.ts +7 -0
- package/service-override/timeline.d.ts +5 -0
- package/service-override/update.d.ts +5 -0
- package/service-override/userDataSync.d.ts +5 -0
- package/service-override/viewBanner.d.ts +6 -0
- package/service-override/viewCommon.d.ts +6 -0
- package/service-override/viewStatusBar.d.ts +6 -0
- package/service-override/viewTitleBar.d.ts +5 -0
- package/service-override/views.d.ts +47 -0
- package/service-override/walkthrough.d.ts +5 -0
- package/service-override/welcome.d.ts +5 -0
- package/service-override/workbench.d.ts +18 -0
- package/service-override/workingCopy.d.ts +5 -0
- package/service-override/workspaceTrust.d.ts +5 -0
- package/services.js +0 -1
- package/vscode/src/vs/base/browser/indexedDB.d.ts +17 -0
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.d.ts +62 -0
- package/vscode/src/vs/base/common/worker/simpleWorker.js +2 -6
- package/vscode/src/vs/editor/common/languages/nullTokenize.js +1 -1
- package/vscode/src/vs/editor/common/standaloneStrings.js +17 -1
- package/vscode/src/vs/platform/actions/browser/toolbar.d.ts +73 -0
- package/vscode/src/vs/platform/files/browser/htmlFileSystemProvider.d.ts +43 -0
- package/vscode/src/vs/platform/files/browser/indexedDBFileSystemProvider.d.ts +48 -0
- package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.d.ts +59 -0
- package/vscode/src/vs/platform/remote/common/remoteExtensionsScanner.service.d.ts +13 -0
- package/vscode/src/vs/workbench/browser/dnd.d.ts +14 -0
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.d.ts +61 -0
- package/vscode/src/vs/workbench/browser/parts/banner/bannerPart.d.ts +46 -0
- package/vscode/src/vs/workbench/browser/parts/compositeBarActions.d.ts +21 -0
- package/vscode/src/vs/workbench/browser/parts/compositePart.d.ts +89 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.d.ts +108 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.d.ts +138 -0
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.d.ts +35 -0
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.d.ts +48 -0
- package/vscode/src/vs/workbench/browser/workbench.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +795 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.service.d.ts +149 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +168 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm-private.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/environmentVariable.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.d.ts +238 -0
- package/vscode/src/vs/workbench/services/activity/browser/activityService.d.ts +28 -0
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.d.ts +53 -0
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.service.d.ts +106 -0
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.d.ts +45 -0
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.d.ts +11 -0
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +162 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +18 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManagers.d.ts +39 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostProxy.d.ts +17 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionManifestPropertiesService.service.d.ts +20 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.d.ts +45 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.d.ts +17 -0
- package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.d.ts +6 -0
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +50 -0
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.service.d.ts +40 -0
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.d.ts +185 -0
- package/vscode/src/vs/workbench/services/storage/browser/storageService.d.ts +41 -0
- package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeature.service.d.ts +11 -0
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.d.ts +11 -0
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.service.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.js +0 -503
- package/vscode/src/vs/workbench/services/textMate/common/TMHelper.js +0 -107
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { ServiceIdentifier } from '../../../../platform/instantiation/common/instantiation.js';
|
|
2
|
+
import { Event, IDynamicListEventMultiplexer } from '../../../../base/common/event.js';
|
|
3
|
+
import { URI } from '../../../../base/common/uri.js';
|
|
4
|
+
import { TerminalCapability, ITerminalCapabilityImplMap } from '../../../../platform/terminal/common/capabilities/capabilities.js';
|
|
5
|
+
import { TerminalLocation, ITerminalBackend, ITerminalLaunchError, IShellLaunchConfig, ITerminalProfile } from '../../../../platform/terminal/common/terminal.js';
|
|
6
|
+
import { IEditableData } from '../../../common/views.js';
|
|
7
|
+
import { IStartExtensionTerminalRequest, ITerminalProcessExtHostProxy, IRemoteTerminalAttachTarget } from '../common/terminal.js';
|
|
8
|
+
import { GroupIdentifier } from '../../../common/editor.js';
|
|
9
|
+
import { SIDE_GROUP_TYPE, ACTIVE_GROUP_TYPE, AUX_WINDOW_GROUP_TYPE } from '../../../services/editor/common/editorService.js';
|
|
10
|
+
import { ITerminalInstanceHost, ITerminalInstance, IDetachedTerminalInstance, ITerminalConfigHelper, TerminalConnectionState, ITerminalGroup, ICreateTerminalOptions, IDetachedXTermOptions, ITerminalLocationOptions, ITerminalServiceNativeDelegate } from './terminal.js';
|
|
11
|
+
|
|
12
|
+
declare const ITerminalService: ServiceIdentifier<ITerminalService>;
|
|
13
|
+
interface ITerminalService extends ITerminalInstanceHost {
|
|
14
|
+
readonly _serviceBrand: undefined;
|
|
15
|
+
/** Gets all terminal instances, including editor and terminal view (group) instances. */
|
|
16
|
+
readonly instances: readonly ITerminalInstance[];
|
|
17
|
+
/** Gets detached terminal instances created via {@link createDetachedXterm}. */
|
|
18
|
+
readonly detachedInstances: Iterable<IDetachedTerminalInstance>;
|
|
19
|
+
readonly configHelper: ITerminalConfigHelper;
|
|
20
|
+
readonly defaultLocation: TerminalLocation;
|
|
21
|
+
readonly isProcessSupportRegistered: boolean;
|
|
22
|
+
readonly connectionState: TerminalConnectionState;
|
|
23
|
+
readonly whenConnected: Promise<void>;
|
|
24
|
+
/** The number of restored terminal groups on startup. */
|
|
25
|
+
readonly restoredGroupCount: number;
|
|
26
|
+
readonly onDidCreateInstance: Event<ITerminalInstance>;
|
|
27
|
+
readonly onDidChangeInstanceDimensions: Event<ITerminalInstance>;
|
|
28
|
+
readonly onDidRequestStartExtensionTerminal: Event<IStartExtensionTerminalRequest>;
|
|
29
|
+
readonly onDidRegisterProcessSupport: Event<void>;
|
|
30
|
+
readonly onDidChangeConnectionState: Event<void>;
|
|
31
|
+
readonly onDidChangeActiveGroup: Event<ITerminalGroup | undefined>;
|
|
32
|
+
readonly onAnyInstanceData: Event<{
|
|
33
|
+
instance: ITerminalInstance;
|
|
34
|
+
data: string;
|
|
35
|
+
}>;
|
|
36
|
+
readonly onAnyInstanceDataInput: Event<ITerminalInstance>;
|
|
37
|
+
readonly onAnyInstanceIconChange: Event<{
|
|
38
|
+
instance: ITerminalInstance;
|
|
39
|
+
userInitiated: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
readonly onAnyInstanceMaximumDimensionsChange: Event<ITerminalInstance>;
|
|
42
|
+
readonly onAnyInstancePrimaryStatusChange: Event<ITerminalInstance>;
|
|
43
|
+
readonly onAnyInstanceProcessIdReady: Event<ITerminalInstance>;
|
|
44
|
+
readonly onAnyInstanceSelectionChange: Event<ITerminalInstance>;
|
|
45
|
+
readonly onAnyInstanceTitleChange: Event<ITerminalInstance>;
|
|
46
|
+
/**
|
|
47
|
+
* Creates a terminal.
|
|
48
|
+
* @param options The options to create the terminal with, when not specified the default
|
|
49
|
+
* profile will be used at the default target.
|
|
50
|
+
*/
|
|
51
|
+
createTerminal(options?: ICreateTerminalOptions): Promise<ITerminalInstance>;
|
|
52
|
+
/**
|
|
53
|
+
* Creates a detached xterm instance which is not attached to the DOM or
|
|
54
|
+
* tracked as a terminal instance.
|
|
55
|
+
* @params options The options to create the terminal with
|
|
56
|
+
*/
|
|
57
|
+
createDetachedTerminal(options: IDetachedXTermOptions): Promise<IDetachedTerminalInstance>;
|
|
58
|
+
/**
|
|
59
|
+
* Creates a raw terminal instance, this should not be used outside of the terminal part.
|
|
60
|
+
*/
|
|
61
|
+
getInstanceFromId(terminalId: number): ITerminalInstance | undefined;
|
|
62
|
+
getInstanceFromIndex(terminalIndex: number): ITerminalInstance;
|
|
63
|
+
/**
|
|
64
|
+
* An owner of terminals might be created after reconnection has occurred,
|
|
65
|
+
* so store them to be requested/adopted later
|
|
66
|
+
*/
|
|
67
|
+
getReconnectedTerminals(reconnectionOwner: string): ITerminalInstance[] | undefined;
|
|
68
|
+
getActiveOrCreateInstance(options?: {
|
|
69
|
+
acceptsInput?: boolean;
|
|
70
|
+
}): Promise<ITerminalInstance>;
|
|
71
|
+
revealActiveTerminal(preserveFocus?: boolean): Promise<void>;
|
|
72
|
+
moveToEditor(source: ITerminalInstance, group?: GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE | AUX_WINDOW_GROUP_TYPE): void;
|
|
73
|
+
moveIntoNewEditor(source: ITerminalInstance): void;
|
|
74
|
+
moveToTerminalView(source: ITerminalInstance | URI): Promise<void>;
|
|
75
|
+
getPrimaryBackend(): ITerminalBackend | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Fire the onActiveTabChanged event, this will trigger the terminal dropdown to be updated,
|
|
78
|
+
* among other things.
|
|
79
|
+
*/
|
|
80
|
+
refreshActiveGroup(): void;
|
|
81
|
+
registerProcessSupport(isSupported: boolean): void;
|
|
82
|
+
showProfileQuickPick(type: 'setDefault' | 'createInstance', cwd?: string | URI): Promise<ITerminalInstance | undefined>;
|
|
83
|
+
setContainers(panelContainer: HTMLElement, terminalContainer: HTMLElement): void;
|
|
84
|
+
requestStartExtensionTerminal(proxy: ITerminalProcessExtHostProxy, cols: number, rows: number): Promise<ITerminalLaunchError | undefined>;
|
|
85
|
+
isAttachedToTerminal(remoteTerm: IRemoteTerminalAttachTarget): boolean;
|
|
86
|
+
getEditableData(instance: ITerminalInstance): IEditableData | undefined;
|
|
87
|
+
setEditable(instance: ITerminalInstance, data: IEditableData | null): void;
|
|
88
|
+
isEditable(instance: ITerminalInstance | undefined): boolean;
|
|
89
|
+
safeDisposeTerminal(instance: ITerminalInstance): Promise<void>;
|
|
90
|
+
getDefaultInstanceHost(): ITerminalInstanceHost;
|
|
91
|
+
getInstanceHost(target: ITerminalLocationOptions | undefined): Promise<ITerminalInstanceHost>;
|
|
92
|
+
resolveLocation(location?: ITerminalLocationOptions): Promise<TerminalLocation | undefined>;
|
|
93
|
+
setNativeDelegate(nativeCalls: ITerminalServiceNativeDelegate): void;
|
|
94
|
+
getEditingTerminal(): ITerminalInstance | undefined;
|
|
95
|
+
setEditingTerminal(instance: ITerminalInstance | undefined): void;
|
|
96
|
+
/**
|
|
97
|
+
* Creates an instance event listener that listens to all instances, dynamically adding new
|
|
98
|
+
* instances and removing old instances as needed.
|
|
99
|
+
* @param getEvent Maps the instance to the event.
|
|
100
|
+
*/
|
|
101
|
+
createOnInstanceEvent<T>(getEvent: (instance: ITerminalInstance) => Event<T>): Event<T>;
|
|
102
|
+
/**
|
|
103
|
+
* Creates a capability event listener that listens to capabilities on all instances,
|
|
104
|
+
* dynamically adding and removing instances and capabilities as needed.
|
|
105
|
+
* @param capabilityId The capability type to listen to an event on.
|
|
106
|
+
* @param getEvent Maps the capability to the event.
|
|
107
|
+
*/
|
|
108
|
+
createOnInstanceCapabilityEvent<T extends TerminalCapability, K>(capabilityId: T, getEvent: (capability: ITerminalCapabilityImplMap[T]) => Event<K>): IDynamicListEventMultiplexer<{
|
|
109
|
+
instance: ITerminalInstance;
|
|
110
|
+
data: K;
|
|
111
|
+
}>;
|
|
112
|
+
}
|
|
113
|
+
declare const ITerminalInstanceService: ServiceIdentifier<ITerminalInstanceService>;
|
|
114
|
+
/**
|
|
115
|
+
* A service used to create instances or fetch backends, this services allows services that
|
|
116
|
+
* ITerminalService depends on to also create instances.
|
|
117
|
+
*
|
|
118
|
+
* **This service is intended to only be used within the terminal contrib.**
|
|
119
|
+
*/
|
|
120
|
+
interface ITerminalInstanceService {
|
|
121
|
+
readonly _serviceBrand: undefined;
|
|
122
|
+
/**
|
|
123
|
+
* An event that's fired when a terminal instance is created.
|
|
124
|
+
*/
|
|
125
|
+
onDidCreateInstance: Event<ITerminalInstance>;
|
|
126
|
+
/**
|
|
127
|
+
* Helper function to convert a shell launch config, a profile or undefined into its equivalent
|
|
128
|
+
* shell launch config.
|
|
129
|
+
* @param shellLaunchConfigOrProfile A shell launch config, a profile or undefined
|
|
130
|
+
* @param cwd A cwd to override.
|
|
131
|
+
*/
|
|
132
|
+
convertProfileToShellLaunchConfig(shellLaunchConfigOrProfile?: IShellLaunchConfig | ITerminalProfile, cwd?: string | URI): IShellLaunchConfig;
|
|
133
|
+
/**
|
|
134
|
+
* Create a new terminal instance.
|
|
135
|
+
* @param launchConfig The shell launch config.
|
|
136
|
+
* @param target The target of the terminal.
|
|
137
|
+
*/
|
|
138
|
+
createInstance(launchConfig: IShellLaunchConfig, target: TerminalLocation): ITerminalInstance;
|
|
139
|
+
/**
|
|
140
|
+
* Gets the registered backend for a remote authority (undefined = local). This is a convenience
|
|
141
|
+
* method to avoid using the more verbose fetching from the registry.
|
|
142
|
+
* @param remoteAuthority The remote authority of the backend.
|
|
143
|
+
*/
|
|
144
|
+
getBackend(remoteAuthority?: string): Promise<ITerminalBackend | undefined>;
|
|
145
|
+
getRegisteredBackends(): IterableIterator<ITerminalBackend>;
|
|
146
|
+
didRegisterBackend(remoteAuthority?: string): void;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export { ITerminalInstanceService, ITerminalService };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.service.js';
|
|
2
|
+
import { ITerminalConfiguration, ITerminalFont } from '../common/terminal.js';
|
|
3
|
+
import { INotificationService } from '../../../../platform/notification/common/notification.service.js';
|
|
4
|
+
import { ITerminalConfigHelper, LinuxDistro } from './terminal.js';
|
|
5
|
+
import { Event } from '../../../../base/common/event.js';
|
|
6
|
+
import { IExtensionManagementService } from '../../../../platform/extensionManagement/common/extensionManagement.service.js';
|
|
7
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
8
|
+
import { IProductService } from '../../../../platform/product/common/productService.service.js';
|
|
9
|
+
import { IXtermCore } from './xterm-private.js';
|
|
10
|
+
import { IShellLaunchConfig } from '../../../../platform/terminal/common/terminal.js';
|
|
11
|
+
import { Disposable } from '../../../../base/common/lifecycle.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Encapsulates terminal configuration logic, the primary purpose of this file is so that platform
|
|
15
|
+
* specific test cases can be written.
|
|
16
|
+
*/
|
|
17
|
+
declare class TerminalConfigHelper extends Disposable implements ITerminalConfigHelper {
|
|
18
|
+
private readonly _configurationService;
|
|
19
|
+
private readonly _extensionManagementService;
|
|
20
|
+
private readonly _notificationService;
|
|
21
|
+
private readonly _instantiationService;
|
|
22
|
+
private readonly _productService;
|
|
23
|
+
panelContainer: HTMLElement | undefined;
|
|
24
|
+
private _charMeasureElement;
|
|
25
|
+
private _lastFontMeasurement;
|
|
26
|
+
protected _linuxDistro: LinuxDistro;
|
|
27
|
+
config: ITerminalConfiguration;
|
|
28
|
+
private readonly _onConfigChanged;
|
|
29
|
+
get onConfigChanged(): Event<void>;
|
|
30
|
+
constructor(_configurationService: IConfigurationService, _extensionManagementService: IExtensionManagementService, _notificationService: INotificationService, _instantiationService: IInstantiationService, _productService: IProductService);
|
|
31
|
+
private _updateConfig;
|
|
32
|
+
configFontIsMonospace(): boolean;
|
|
33
|
+
private _createCharMeasureElementIfNecessary;
|
|
34
|
+
private _getBoundingRectFor;
|
|
35
|
+
private _measureFont;
|
|
36
|
+
/**
|
|
37
|
+
* Gets the font information based on the terminal.integrated.fontFamily
|
|
38
|
+
* terminal.integrated.fontSize, terminal.integrated.lineHeight configuration properties
|
|
39
|
+
*/
|
|
40
|
+
getFont(w: Window, xtermCore?: IXtermCore, excludeDimensions?: boolean): ITerminalFont;
|
|
41
|
+
private _clampInt;
|
|
42
|
+
private _recommendationsShown;
|
|
43
|
+
showRecommendations(shellLaunchConfig: IShellLaunchConfig): Promise<void>;
|
|
44
|
+
private _isExtensionInstalled;
|
|
45
|
+
private _normalizeFontWeight;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { TerminalConfigHelper };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Event } from '../../../../base/common/event.js';
|
|
2
|
+
import { ITerminalStatus } from '../common/terminal.js';
|
|
3
|
+
|
|
4
|
+
interface ITerminalStatusList {
|
|
5
|
+
/** Gets the most recent, highest severity status. */
|
|
6
|
+
readonly primary: ITerminalStatus | undefined;
|
|
7
|
+
/** Gets all active statues. */
|
|
8
|
+
readonly statuses: ITerminalStatus[];
|
|
9
|
+
readonly onDidAddStatus: Event<ITerminalStatus>;
|
|
10
|
+
readonly onDidRemoveStatus: Event<ITerminalStatus>;
|
|
11
|
+
readonly onDidChangePrimaryStatus: Event<ITerminalStatus | undefined>;
|
|
12
|
+
/**
|
|
13
|
+
* Adds a status to the list.
|
|
14
|
+
* @param status The status object. Ideally a single status object that does not change will be
|
|
15
|
+
* shared as this call will no-op if the status is already set (checked by by object reference).
|
|
16
|
+
* @param duration An optional duration in milliseconds of the status, when specified the status
|
|
17
|
+
* will remove itself when the duration elapses unless the status gets re-added.
|
|
18
|
+
*/
|
|
19
|
+
add(status: ITerminalStatus, duration?: number): void;
|
|
20
|
+
remove(status: ITerminalStatus): void;
|
|
21
|
+
remove(statusId: string): void;
|
|
22
|
+
toggle(status: ITerminalStatus, value: boolean): void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type { ITerminalStatusList };
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { Event } from '../../../../../base/common/event.js';
|
|
2
|
+
import { Terminal, ITheme } from '@xterm/xterm';
|
|
3
|
+
import { CanvasAddon } from '@xterm/addon-canvas';
|
|
4
|
+
import { ISearchOptions, SearchAddon } from '@xterm/addon-search';
|
|
5
|
+
import { Unicode11Addon } from '@xterm/addon-unicode11';
|
|
6
|
+
import { WebglAddon } from '@xterm/addon-webgl';
|
|
7
|
+
import { SerializeAddon } from '@xterm/addon-serialize';
|
|
8
|
+
import { ImageAddon } from '@xterm/addon-image';
|
|
9
|
+
import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.service.js';
|
|
10
|
+
import { TerminalConfigHelper } from '../terminalConfigHelper.js';
|
|
11
|
+
import { Disposable } from '../../../../../base/common/lifecycle.js';
|
|
12
|
+
import { IShellIntegration } from '../../../../../platform/terminal/common/terminal.js';
|
|
13
|
+
import { ITerminalLogService } from '../../../../../platform/terminal/common/terminal.service.js';
|
|
14
|
+
import { ITerminalFont } from '../../common/terminal.js';
|
|
15
|
+
import { IXtermTerminal, IDetachedXtermTerminal, IInternalXtermTerminal, IMarkTracker, IXtermColorProvider, IXtermAttachToElementOptions } from '../terminal.js';
|
|
16
|
+
import { IStorageService } from '../../../../../platform/storage/common/storage.service.js';
|
|
17
|
+
import { INotificationService } from '../../../../../platform/notification/common/notification.service.js';
|
|
18
|
+
import { ScrollPosition } from './markNavigationAddon.js';
|
|
19
|
+
import { IColorTheme } from '../../../../../platform/theme/common/themeService.js';
|
|
20
|
+
import { IThemeService } from '../../../../../platform/theme/common/themeService.service.js';
|
|
21
|
+
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
|
|
22
|
+
import { ITerminalCommand, ITerminalCapabilityStore } from '../../../../../platform/terminal/common/capabilities/capabilities.js';
|
|
23
|
+
import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.service.js';
|
|
24
|
+
import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.service.js';
|
|
25
|
+
import { IClipboardService } from '../../../../../platform/clipboard/common/clipboardService.service.js';
|
|
26
|
+
import { ILayoutService } from '../../../../../platform/layout/browser/layoutService.service.js';
|
|
27
|
+
import { IAccessibilitySignalService } from '../../../../../platform/accessibilitySignal/browser/accessibilitySignalService.service.js';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Wraps the xterm object with additional functionality. Interaction with the backing process is out
|
|
31
|
+
* of the scope of this class.
|
|
32
|
+
*/
|
|
33
|
+
declare class XtermTerminal extends Disposable implements IXtermTerminal, IDetachedXtermTerminal, IInternalXtermTerminal {
|
|
34
|
+
private readonly _configHelper;
|
|
35
|
+
private readonly _xtermColorProvider;
|
|
36
|
+
private readonly _capabilities;
|
|
37
|
+
private readonly _configurationService;
|
|
38
|
+
private readonly _instantiationService;
|
|
39
|
+
private readonly _logService;
|
|
40
|
+
private readonly _notificationService;
|
|
41
|
+
private readonly _storageService;
|
|
42
|
+
private readonly _themeService;
|
|
43
|
+
private readonly _telemetryService;
|
|
44
|
+
private readonly _clipboardService;
|
|
45
|
+
private readonly _accessibilitySignalService;
|
|
46
|
+
/** The raw xterm.js instance */
|
|
47
|
+
readonly raw: Terminal;
|
|
48
|
+
private _core;
|
|
49
|
+
private static _suggestedRendererType;
|
|
50
|
+
private static _checkedWebglCompatible;
|
|
51
|
+
private _attached?;
|
|
52
|
+
private _isPhysicalMouseWheel;
|
|
53
|
+
private _markNavigationAddon;
|
|
54
|
+
private _shellIntegrationAddon;
|
|
55
|
+
private _decorationAddon;
|
|
56
|
+
private _canvasAddon?;
|
|
57
|
+
private _searchAddon?;
|
|
58
|
+
private _unicode11Addon?;
|
|
59
|
+
private _webglAddon?;
|
|
60
|
+
private _serializeAddon?;
|
|
61
|
+
private _imageAddon?;
|
|
62
|
+
private readonly _attachedDisposables;
|
|
63
|
+
private readonly _anyTerminalFocusContextKey;
|
|
64
|
+
private readonly _anyFocusedTerminalHasSelection;
|
|
65
|
+
private _lastFindResult;
|
|
66
|
+
get findResult(): {
|
|
67
|
+
resultIndex: number;
|
|
68
|
+
resultCount: number;
|
|
69
|
+
} | undefined;
|
|
70
|
+
get isStdinDisabled(): boolean;
|
|
71
|
+
get isGpuAccelerated(): boolean;
|
|
72
|
+
private readonly _onDidRequestRunCommand;
|
|
73
|
+
readonly onDidRequestRunCommand: Event<{
|
|
74
|
+
command: ITerminalCommand;
|
|
75
|
+
copyAsHtml?: boolean | undefined;
|
|
76
|
+
noNewLine?: boolean | undefined;
|
|
77
|
+
}>;
|
|
78
|
+
private readonly _onDidRequestFocus;
|
|
79
|
+
readonly onDidRequestFocus: Event<void>;
|
|
80
|
+
private readonly _onDidRequestSendText;
|
|
81
|
+
readonly onDidRequestSendText: Event<string>;
|
|
82
|
+
private readonly _onDidRequestFreePort;
|
|
83
|
+
readonly onDidRequestFreePort: Event<string>;
|
|
84
|
+
private readonly _onDidChangeFindResults;
|
|
85
|
+
readonly onDidChangeFindResults: Event<{
|
|
86
|
+
resultIndex: number;
|
|
87
|
+
resultCount: number;
|
|
88
|
+
}>;
|
|
89
|
+
private readonly _onDidChangeSelection;
|
|
90
|
+
readonly onDidChangeSelection: Event<void>;
|
|
91
|
+
private readonly _onDidChangeFocus;
|
|
92
|
+
readonly onDidChangeFocus: Event<boolean>;
|
|
93
|
+
private readonly _onDidDispose;
|
|
94
|
+
readonly onDidDispose: Event<void>;
|
|
95
|
+
get markTracker(): IMarkTracker;
|
|
96
|
+
get shellIntegration(): IShellIntegration;
|
|
97
|
+
get textureAtlas(): Promise<ImageBitmap> | undefined;
|
|
98
|
+
get isFocused(): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* @param xtermCtor The xterm.js constructor, this is passed in so it can be fetched lazily
|
|
101
|
+
* outside of this class such that {@link raw} is not nullable.
|
|
102
|
+
*/
|
|
103
|
+
constructor(xtermCtor: typeof Terminal, _configHelper: TerminalConfigHelper, cols: number, rows: number, _xtermColorProvider: IXtermColorProvider, _capabilities: ITerminalCapabilityStore, shellIntegrationNonce: string, disableShellIntegrationReporting: boolean, _configurationService: IConfigurationService, _instantiationService: IInstantiationService, _logService: ITerminalLogService, _notificationService: INotificationService, _storageService: IStorageService, _themeService: IThemeService, _telemetryService: ITelemetryService, _clipboardService: IClipboardService, contextKeyService: IContextKeyService, _accessibilitySignalService: IAccessibilitySignalService, layoutService: ILayoutService);
|
|
104
|
+
getBufferReverseIterator(): IterableIterator<string>;
|
|
105
|
+
getContentsAsHtml(): Promise<string>;
|
|
106
|
+
getSelectionAsHtml(command?: ITerminalCommand): Promise<string>;
|
|
107
|
+
attachToElement(container: HTMLElement, partialOptions?: Partial<IXtermAttachToElementOptions>): HTMLElement;
|
|
108
|
+
private _setFocused;
|
|
109
|
+
write(data: string | Uint8Array, callback?: () => void): void;
|
|
110
|
+
resize(columns: number, rows: number): void;
|
|
111
|
+
updateConfig(): void;
|
|
112
|
+
private _updateSmoothScrolling;
|
|
113
|
+
private _shouldLoadWebgl;
|
|
114
|
+
private _shouldLoadCanvas;
|
|
115
|
+
forceRedraw(): void;
|
|
116
|
+
clearDecorations(): void;
|
|
117
|
+
forceRefresh(): void;
|
|
118
|
+
forceUnpause(): void;
|
|
119
|
+
findNext(term: string, searchOptions: ISearchOptions): Promise<boolean>;
|
|
120
|
+
findPrevious(term: string, searchOptions: ISearchOptions): Promise<boolean>;
|
|
121
|
+
private _updateFindColors;
|
|
122
|
+
private _searchAddonPromise;
|
|
123
|
+
private _getSearchAddon;
|
|
124
|
+
clearSearchDecorations(): void;
|
|
125
|
+
clearActiveSearchDecoration(): void;
|
|
126
|
+
getFont(): ITerminalFont;
|
|
127
|
+
getLongestViewportWrappedLineLength(): number;
|
|
128
|
+
private _getWrappedLineCount;
|
|
129
|
+
scrollDownLine(): void;
|
|
130
|
+
scrollDownPage(): void;
|
|
131
|
+
scrollToBottom(): void;
|
|
132
|
+
scrollUpLine(): void;
|
|
133
|
+
scrollUpPage(): void;
|
|
134
|
+
scrollToTop(): void;
|
|
135
|
+
scrollToLine(line: number, position?: ScrollPosition): void;
|
|
136
|
+
clearBuffer(): void;
|
|
137
|
+
hasSelection(): boolean;
|
|
138
|
+
clearSelection(): void;
|
|
139
|
+
selectMarkedRange(fromMarkerId: string, toMarkerId: string, scrollIntoView?: boolean): void;
|
|
140
|
+
selectAll(): void;
|
|
141
|
+
focus(): void;
|
|
142
|
+
copySelection(asHtml?: boolean, command?: ITerminalCommand): Promise<void>;
|
|
143
|
+
private _setCursorBlink;
|
|
144
|
+
private _setCursorStyle;
|
|
145
|
+
private _setCursorStyleInactive;
|
|
146
|
+
private _setCursorWidth;
|
|
147
|
+
private _enableWebglRenderer;
|
|
148
|
+
private _disableWebglForThisSession;
|
|
149
|
+
private _enableCanvasRenderer;
|
|
150
|
+
protected _getCanvasAddonConstructor(): Promise<typeof CanvasAddon>;
|
|
151
|
+
private _refreshImageAddon;
|
|
152
|
+
protected _getImageAddonConstructor(): Promise<typeof ImageAddon>;
|
|
153
|
+
protected _getSearchAddonConstructor(): Promise<typeof SearchAddon>;
|
|
154
|
+
protected _getUnicode11Constructor(): Promise<typeof Unicode11Addon>;
|
|
155
|
+
protected _getWebglAddonConstructor(): Promise<typeof WebglAddon>;
|
|
156
|
+
protected _getSerializeAddonConstructor(): Promise<typeof SerializeAddon>;
|
|
157
|
+
private _disposeOfCanvasRenderer;
|
|
158
|
+
private _disposeOfWebglRenderer;
|
|
159
|
+
private _measureRenderTime;
|
|
160
|
+
getXtermTheme(theme?: IColorTheme): ITheme;
|
|
161
|
+
private _updateTheme;
|
|
162
|
+
refresh(): void;
|
|
163
|
+
private _updateUnicodeVersion;
|
|
164
|
+
_writeText(data: string): void;
|
|
165
|
+
dispose(): void;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export { XtermTerminal };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { IBufferCell } from '@xterm/xterm';
|
|
2
|
+
|
|
3
|
+
/*---------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
6
|
+
*--------------------------------------------------------------------------------------------*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
type XtermAttributes = Omit<IBufferCell, 'getWidth' | 'getChars' | 'getCode'> & { clone?(): XtermAttributes };
|
|
11
|
+
|
|
12
|
+
interface IXtermCore {
|
|
13
|
+
viewport?: {
|
|
14
|
+
readonly scrollBarWidth: number;
|
|
15
|
+
_innerRefresh(): void;
|
|
16
|
+
};
|
|
17
|
+
_onData: IEventEmitter<string>;
|
|
18
|
+
_onKey: IEventEmitter<{ key: string }>;
|
|
19
|
+
|
|
20
|
+
_charSizeService: {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
coreService: {
|
|
26
|
+
triggerDataEvent(data: string, wasUserInput?: boolean): void;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
_inputHandler: {
|
|
30
|
+
_curAttrData: XtermAttributes;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
_renderService: {
|
|
34
|
+
dimensions: {
|
|
35
|
+
css: {
|
|
36
|
+
cell: {
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
_renderer: {
|
|
43
|
+
value?: {
|
|
44
|
+
_renderLayers?: any[];
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
_handleIntersectionChange: any;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface IEventEmitter<T> {
|
|
52
|
+
fire(e: T): void;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type { IEventEmitter, IXtermCore, XtermAttributes };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EnvironmentVariableScope } from '../../../../platform/terminal/common/environmentVariable.js';
|
|
2
|
+
import { ITerminalStatus } from './terminal.js';
|
|
3
|
+
|
|
4
|
+
interface IEnvironmentVariableInfo {
|
|
5
|
+
readonly requiresAction: boolean;
|
|
6
|
+
getStatus(scope: EnvironmentVariableScope | undefined): ITerminalStatus;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type { IEnvironmentVariableInfo };
|