@codingame/monaco-vscode-xterm-addons-common 24.1.0

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.
Files changed (26) hide show
  1. package/empty.js +1 -0
  2. package/package.json +51 -0
  3. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.d.ts +25 -0
  4. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +315 -0
  5. package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +49 -0
  6. package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +379 -0
  7. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.d.ts +17 -0
  8. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +101 -0
  9. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.d.ts +4 -0
  10. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +201 -0
  11. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.d.ts +7 -0
  12. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js +79 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.d.ts +8 -0
  14. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.js +145 -0
  15. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.d.ts +73 -0
  16. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js +468 -0
  17. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalUri.d.ts +18 -0
  18. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalUri.js +48 -0
  19. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.d.ts +80 -0
  20. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +583 -0
  21. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.d.ts +64 -0
  22. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +582 -0
  23. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermAddonImporter.d.ts +25 -0
  24. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermAddonImporter.js +43 -0
  25. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +187 -0
  26. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +867 -0
@@ -0,0 +1,187 @@
1
+ import type { ITheme, Terminal as RawXtermTerminal, IMarker as IXtermMarker } from "@xterm/xterm";
2
+ import type { ISearchOptions } from "@xterm/addon-search";
3
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
4
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
5
+ import { IShellIntegration, type IDecorationAddon } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal";
6
+ import { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service";
7
+ import { ITerminalFont } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/common/terminal";
8
+ import { IMarkTracker, IInternalXtermTerminal, IXtermTerminal, IXtermColorProvider, IXtermAttachToElementOptions, IDetachedXtermTerminal } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
9
+ import { ITerminalConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service";
10
+ import { INotificationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service";
11
+ import { ScrollPosition } from "./markNavigationAddon.js";
12
+ import { IColorTheme } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService";
13
+ import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
14
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
15
+ import { ITerminalCapabilityStore, ITerminalCommand } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities";
16
+ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
17
+ import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
18
+ import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
19
+ import { IClipboardService } from "@codingame/monaco-vscode-api/vscode/vs/platform/clipboard/common/clipboardService.service";
20
+ import { ILayoutService } from "@codingame/monaco-vscode-api/vscode/vs/platform/layout/browser/layoutService.service";
21
+ import { IAccessibilitySignalService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service";
22
+ import { XtermAddonImporter } from "./xtermAddonImporter.js";
23
+ import type { IProgressState } from "@xterm/addon-progress";
24
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
25
+ export interface IXtermTerminalOptions {
26
+ /** The columns to initialize the terminal with. */
27
+ cols: number;
28
+ /** The rows to initialize the terminal with. */
29
+ rows: number;
30
+ /** The color provider for the terminal. */
31
+ xtermColorProvider: IXtermColorProvider;
32
+ /** The capabilities of the terminal. */
33
+ capabilities: ITerminalCapabilityStore;
34
+ /** The shell integration nonce to verify data coming from SI is trustworthy. */
35
+ shellIntegrationNonce?: string;
36
+ /** Whether to disable shell integration telemetry reporting. */
37
+ disableShellIntegrationReporting?: boolean;
38
+ /** The object that imports xterm addons, set this to inject an importer in tests. */
39
+ xtermAddonImporter?: XtermAddonImporter;
40
+ /** Whether to disable the overview ruler. */
41
+ disableOverviewRuler?: boolean;
42
+ }
43
+ /**
44
+ * Wraps the xterm object with additional functionality. Interaction with the backing process is out
45
+ * of the scope of this class.
46
+ */
47
+ export declare class XtermTerminal extends Disposable implements IXtermTerminal, IDetachedXtermTerminal, IInternalXtermTerminal {
48
+ private readonly _onDidExecuteText;
49
+ private readonly _configurationService;
50
+ private readonly _instantiationService;
51
+ private readonly _logService;
52
+ private readonly _notificationService;
53
+ private readonly _themeService;
54
+ private readonly _telemetryService;
55
+ private readonly _terminalConfigurationService;
56
+ private readonly _clipboardService;
57
+ private readonly _accessibilitySignalService;
58
+ /** The raw xterm.js instance */
59
+ readonly raw: RawXtermTerminal;
60
+ private _core;
61
+ private readonly _xtermAddonLoader;
62
+ private readonly _xtermColorProvider;
63
+ private readonly _capabilities;
64
+ private static _suggestedRendererType;
65
+ private _attached?;
66
+ private _isPhysicalMouseWheel;
67
+ private _lastInputEvent;
68
+ get lastInputEvent(): string | undefined;
69
+ private _progressState;
70
+ get progressState(): IProgressState;
71
+ private _markNavigationAddon;
72
+ private _shellIntegrationAddon;
73
+ private _decorationAddon;
74
+ private _clipboardAddon?;
75
+ private _searchAddon?;
76
+ private _unicode11Addon?;
77
+ private _webglAddon?;
78
+ private _serializeAddon?;
79
+ private _imageAddon?;
80
+ private readonly _ligaturesAddon;
81
+ private readonly _ligaturesAddonConfig?;
82
+ private readonly _attachedDisposables;
83
+ private readonly _anyTerminalFocusContextKey;
84
+ private readonly _anyFocusedTerminalHasSelection;
85
+ private _lastFindResult;
86
+ get findResult(): {
87
+ resultIndex: number;
88
+ resultCount: number;
89
+ } | undefined;
90
+ get isStdinDisabled(): boolean;
91
+ get isGpuAccelerated(): boolean;
92
+ private readonly _onDidRequestRunCommand;
93
+ readonly onDidRequestRunCommand: Event<{
94
+ command: ITerminalCommand;
95
+ noNewLine?: boolean;
96
+ }>;
97
+ private readonly _onDidRequestCopyAsHtml;
98
+ readonly onDidRequestCopyAsHtml: Event<{
99
+ command: ITerminalCommand;
100
+ }>;
101
+ private readonly _onDidRequestRefreshDimensions;
102
+ readonly onDidRequestRefreshDimensions: Event<void>;
103
+ private readonly _onDidChangeFindResults;
104
+ readonly onDidChangeFindResults: Event<{
105
+ resultIndex: number;
106
+ resultCount: number;
107
+ }>;
108
+ private readonly _onDidChangeSelection;
109
+ readonly onDidChangeSelection: Event<void>;
110
+ private readonly _onDidChangeFocus;
111
+ readonly onDidChangeFocus: Event<boolean>;
112
+ private readonly _onDidDispose;
113
+ readonly onDidDispose: Event<void>;
114
+ private readonly _onDidChangeProgress;
115
+ readonly onDidChangeProgress: Event<IProgressState>;
116
+ get markTracker(): IMarkTracker;
117
+ get shellIntegration(): IShellIntegration;
118
+ get decorationAddon(): IDecorationAddon;
119
+ get textureAtlas(): Promise<ImageBitmap> | undefined;
120
+ get isFocused(): boolean;
121
+ /**
122
+ * @param xtermCtor The xterm.js constructor, this is passed in so it can be fetched lazily
123
+ * outside of this class such that {@link raw} is not nullable.
124
+ */
125
+ constructor(resource: URI | undefined, xtermCtor: typeof RawXtermTerminal, options: IXtermTerminalOptions, _onDidExecuteText: Event<void> | undefined, _configurationService: IConfigurationService, _instantiationService: IInstantiationService, _logService: ITerminalLogService, _notificationService: INotificationService, _themeService: IThemeService, _telemetryService: ITelemetryService, _terminalConfigurationService: ITerminalConfigurationService, _clipboardService: IClipboardService, contextKeyService: IContextKeyService, _accessibilitySignalService: IAccessibilitySignalService, layoutService: ILayoutService);
126
+ getBufferReverseIterator(): IterableIterator<string>;
127
+ getContentsAsText(startMarker?: IXtermMarker, endMarker?: IXtermMarker): string;
128
+ getContentsAsHtml(): Promise<string>;
129
+ getCommandOutputAsHtml(command: ITerminalCommand, maxLines: number): Promise<{
130
+ text: string;
131
+ truncated?: boolean;
132
+ }>;
133
+ getSelectionAsHtml(command?: ITerminalCommand): Promise<string>;
134
+ attachToElement(container: HTMLElement, partialOptions?: Partial<IXtermAttachToElementOptions>): HTMLElement;
135
+ private _setFocused;
136
+ write(data: string | Uint8Array, callback?: () => void): void;
137
+ resize(columns: number, rows: number): void;
138
+ updateConfig(): void;
139
+ private _updateSmoothScrolling;
140
+ private _shouldLoadWebgl;
141
+ forceRedraw(): void;
142
+ clearDecorations(): void;
143
+ forceRefresh(): void;
144
+ findNext(term: string, searchOptions: ISearchOptions): Promise<boolean>;
145
+ findPrevious(term: string, searchOptions: ISearchOptions): Promise<boolean>;
146
+ private _updateFindColors;
147
+ private _searchAddonPromise;
148
+ private _getSearchAddon;
149
+ clearSearchDecorations(): void;
150
+ clearActiveSearchDecoration(): void;
151
+ getFont(): ITerminalFont;
152
+ getLongestViewportWrappedLineLength(): number;
153
+ private _getWrappedLineCount;
154
+ scrollDownLine(): void;
155
+ scrollDownPage(): void;
156
+ scrollToBottom(): void;
157
+ scrollUpLine(): void;
158
+ scrollUpPage(): void;
159
+ scrollToTop(): void;
160
+ scrollToLine(line: number, position?: ScrollPosition): void;
161
+ clearBuffer(): void;
162
+ hasSelection(): boolean;
163
+ clearSelection(): void;
164
+ selectMarkedRange(fromMarkerId: string, toMarkerId: string, scrollIntoView?: boolean): void;
165
+ selectAll(): void;
166
+ focus(): void;
167
+ copySelection(asHtml?: boolean, command?: ITerminalCommand): Promise<void>;
168
+ private _setCursorBlink;
169
+ private _setCursorStyle;
170
+ private _setCursorStyleInactive;
171
+ private _setCursorWidth;
172
+ private _enableWebglRenderer;
173
+ private _refreshLigaturesAddon;
174
+ private _refreshImageAddon;
175
+ private _disposeOfWebglRenderer;
176
+ getRangeAsVT(startMarker: IXtermMarker, endMarker?: IXtermMarker, skipLastLine?: boolean): Promise<string>;
177
+ getXtermTheme(theme?: IColorTheme): ITheme;
178
+ private _updateTheme;
179
+ refresh(): void;
180
+ private _updateUnicodeVersion;
181
+ _writeText(data: string): void;
182
+ dispose(): void;
183
+ }
184
+ export declare function getXtermScaledDimensions(w: Window, font: ITerminalFont, width: number, height: number): {
185
+ rows: number;
186
+ cols: number;
187
+ } | null;