@theia/editor 1.34.2 → 1.34.3

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 (100) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +30 -30
  3. package/lib/browser/decorations/editor-decoration-style.d.ts +8 -8
  4. package/lib/browser/decorations/editor-decoration-style.js +36 -36
  5. package/lib/browser/decorations/editor-decoration.d.ts +106 -106
  6. package/lib/browser/decorations/editor-decoration.js +37 -37
  7. package/lib/browser/decorations/editor-decorator.d.ts +6 -6
  8. package/lib/browser/decorations/editor-decorator.js +43 -43
  9. package/lib/browser/decorations/index.d.ts +3 -3
  10. package/lib/browser/decorations/index.js +30 -30
  11. package/lib/browser/diff-navigator.d.ts +10 -10
  12. package/lib/browser/diff-navigator.js +19 -19
  13. package/lib/browser/editor-command.d.ts +102 -102
  14. package/lib/browser/editor-command.js +426 -426
  15. package/lib/browser/editor-contribution.d.ts +26 -26
  16. package/lib/browser/editor-contribution.js +198 -198
  17. package/lib/browser/editor-frontend-module.d.ts +5 -5
  18. package/lib/browser/editor-frontend-module.js +74 -74
  19. package/lib/browser/editor-generated-preference-schema.d.ts +249 -249
  20. package/lib/browser/editor-generated-preference-schema.js +2316 -2316
  21. package/lib/browser/editor-keybinding-contexts.d.ts +35 -35
  22. package/lib/browser/editor-keybinding-contexts.js +98 -98
  23. package/lib/browser/editor-keybinding.d.ts +5 -5
  24. package/lib/browser/editor-keybinding.js +55 -55
  25. package/lib/browser/editor-manager.d.ts +113 -113
  26. package/lib/browser/editor-manager.js +412 -412
  27. package/lib/browser/editor-menu.d.ts +48 -48
  28. package/lib/browser/editor-menu.js +210 -210
  29. package/lib/browser/editor-navigation-contribution.d.ts +67 -67
  30. package/lib/browser/editor-navigation-contribution.js +331 -331
  31. package/lib/browser/editor-preferences.d.ts +40 -40
  32. package/lib/browser/editor-preferences.js +165 -165
  33. package/lib/browser/editor-variable-contribution.d.ts +8 -8
  34. package/lib/browser/editor-variable-contribution.js +64 -64
  35. package/lib/browser/editor-widget-factory.d.ts +17 -17
  36. package/lib/browser/editor-widget-factory.js +91 -91
  37. package/lib/browser/editor-widget.d.ts +20 -20
  38. package/lib/browser/editor-widget.js +87 -87
  39. package/lib/browser/editor.d.ts +293 -293
  40. package/lib/browser/editor.js +103 -103
  41. package/lib/browser/index.d.ts +10 -10
  42. package/lib/browser/index.js +37 -37
  43. package/lib/browser/language-status/editor-language-status-service.d.ts +77 -77
  44. package/lib/browser/language-status/editor-language-status-service.js +251 -251
  45. package/lib/browser/navigation/navigation-location-service.d.ts +103 -103
  46. package/lib/browser/navigation/navigation-location-service.js +281 -281
  47. package/lib/browser/navigation/navigation-location-service.spec.d.ts +1 -1
  48. package/lib/browser/navigation/navigation-location-service.spec.js +184 -184
  49. package/lib/browser/navigation/navigation-location-similarity.d.ts +15 -15
  50. package/lib/browser/navigation/navigation-location-similarity.js +62 -62
  51. package/lib/browser/navigation/navigation-location-similarity.spec.d.ts +1 -1
  52. package/lib/browser/navigation/navigation-location-similarity.spec.js +32 -32
  53. package/lib/browser/navigation/navigation-location-updater.d.ts +35 -35
  54. package/lib/browser/navigation/navigation-location-updater.js +210 -210
  55. package/lib/browser/navigation/navigation-location-updater.spec.d.ts +1 -1
  56. package/lib/browser/navigation/navigation-location-updater.spec.js +177 -177
  57. package/lib/browser/navigation/navigation-location.d.ts +191 -191
  58. package/lib/browser/navigation/navigation-location.js +300 -300
  59. package/lib/browser/navigation/test/mock-navigation-location-updater.d.ts +15 -15
  60. package/lib/browser/navigation/test/mock-navigation-location-updater.js +38 -38
  61. package/lib/browser/quick-editor-service.d.ts +16 -16
  62. package/lib/browser/quick-editor-service.js +109 -109
  63. package/lib/common/language-selector.d.ts +13 -13
  64. package/lib/common/language-selector.js +90 -90
  65. package/lib/package.spec.js +25 -25
  66. package/package.json +5 -5
  67. package/src/browser/decorations/editor-decoration-style.ts +41 -41
  68. package/src/browser/decorations/editor-decoration.ts +127 -127
  69. package/src/browser/decorations/editor-decorator.ts +36 -36
  70. package/src/browser/decorations/index.ts +19 -19
  71. package/src/browser/diff-navigator.ts +28 -28
  72. package/src/browser/editor-command.ts +414 -414
  73. package/src/browser/editor-contribution.ts +185 -185
  74. package/src/browser/editor-frontend-module.ts +85 -85
  75. package/src/browser/editor-generated-preference-schema.ts +2539 -2539
  76. package/src/browser/editor-keybinding-contexts.ts +87 -87
  77. package/src/browser/editor-keybinding.ts +55 -55
  78. package/src/browser/editor-manager.ts +429 -429
  79. package/src/browser/editor-menu.ts +224 -224
  80. package/src/browser/editor-navigation-contribution.ts +331 -331
  81. package/src/browser/editor-preferences.ts +220 -220
  82. package/src/browser/editor-variable-contribution.ts +54 -54
  83. package/src/browser/editor-widget-factory.ts +82 -82
  84. package/src/browser/editor-widget.ts +98 -98
  85. package/src/browser/editor.ts +358 -358
  86. package/src/browser/index.ts +26 -26
  87. package/src/browser/language-status/editor-language-status-service.ts +271 -271
  88. package/src/browser/language-status/editor-language-status.css +98 -98
  89. package/src/browser/navigation/navigation-location-service.spec.ts +245 -245
  90. package/src/browser/navigation/navigation-location-service.ts +284 -284
  91. package/src/browser/navigation/navigation-location-similarity.spec.ts +46 -46
  92. package/src/browser/navigation/navigation-location-similarity.ts +58 -58
  93. package/src/browser/navigation/navigation-location-updater.spec.ts +197 -197
  94. package/src/browser/navigation/navigation-location-updater.ts +220 -220
  95. package/src/browser/navigation/navigation-location.ts +418 -418
  96. package/src/browser/navigation/test/mock-navigation-location-updater.ts +41 -41
  97. package/src/browser/quick-editor-service.ts +94 -94
  98. package/src/browser/style/index.css +19 -19
  99. package/src/common/language-selector.ts +104 -104
  100. package/src/package.spec.ts +28 -28
@@ -1,294 +1,294 @@
1
- import { Position, Range, Location } from '@theia/core/shared/vscode-languageserver-protocol';
2
- import * as lsp from '@theia/core/shared/vscode-languageserver-protocol';
3
- import URI from '@theia/core/lib/common/uri';
4
- import { Event, Disposable, TextDocumentContentChangeDelta, Reference } from '@theia/core/lib/common';
5
- import { Saveable, Navigatable, Widget } from '@theia/core/lib/browser';
6
- import { EditorDecoration } from './decorations/editor-decoration';
7
- export { Position, Range, Location };
8
- export declare const TextEditorProvider: unique symbol;
9
- export declare type TextEditorProvider = (uri: URI) => Promise<TextEditor>;
10
- export interface TextEditorDocument extends lsp.TextDocument, Saveable, Disposable {
11
- getLineContent(lineNumber: number): string;
12
- getLineMaxColumn(lineNumber: number): number;
13
- /**
14
- * @since 1.8.0
15
- */
16
- findMatches?(options: FindMatchesOptions): FindMatch[];
17
- /**
18
- * Creates a valid position. If the position is outside of the backing document, this method will return a position that is ensured to be inside the document and valid.
19
- * For example, when the `position` is `{ line: 1, character: 0 }` and the document is empty, this method will return with `{ line: 0, character: 0 }`.
20
- */
21
- toValidPosition(position: Position): Position;
22
- /**
23
- * Creates a valid range. If the `range` argument is outside of the document, this method will return with a new range that does not exceed the boundaries of the document.
24
- * For example, if the argument is `{ start: { line: 1, character: 0 }, end: { line: 1, character: 0 } }` and the document is empty, the return value is
25
- * `{ start: { line: 0, character: 0 }, end: { line: 0, character: 0 } }`.
26
- */
27
- toValidRange(range: Range): Range;
28
- }
29
- export { TextDocumentContentChangeDelta };
30
- export interface TextDocumentChangeEvent {
31
- readonly document: TextEditorDocument;
32
- readonly contentChanges: TextDocumentContentChangeDelta[];
33
- }
34
- /**
35
- * Type of hit element with the mouse in the editor.
36
- * Copied from monaco editor.
37
- */
38
- export declare enum MouseTargetType {
39
- /**
40
- * Mouse is on top of an unknown element.
41
- */
42
- UNKNOWN = 0,
43
- /**
44
- * Mouse is on top of the textarea used for input.
45
- */
46
- TEXTAREA = 1,
47
- /**
48
- * Mouse is on top of the glyph margin
49
- */
50
- GUTTER_GLYPH_MARGIN = 2,
51
- /**
52
- * Mouse is on top of the line numbers
53
- */
54
- GUTTER_LINE_NUMBERS = 3,
55
- /**
56
- * Mouse is on top of the line decorations
57
- */
58
- GUTTER_LINE_DECORATIONS = 4,
59
- /**
60
- * Mouse is on top of the whitespace left in the gutter by a view zone.
61
- */
62
- GUTTER_VIEW_ZONE = 5,
63
- /**
64
- * Mouse is on top of text in the content.
65
- */
66
- CONTENT_TEXT = 6,
67
- /**
68
- * Mouse is on top of empty space in the content (e.g. after line text or below last line)
69
- */
70
- CONTENT_EMPTY = 7,
71
- /**
72
- * Mouse is on top of a view zone in the content.
73
- */
74
- CONTENT_VIEW_ZONE = 8,
75
- /**
76
- * Mouse is on top of a content widget.
77
- */
78
- CONTENT_WIDGET = 9,
79
- /**
80
- * Mouse is on top of the decorations overview ruler.
81
- */
82
- OVERVIEW_RULER = 10,
83
- /**
84
- * Mouse is on top of a scrollbar.
85
- */
86
- SCROLLBAR = 11,
87
- /**
88
- * Mouse is on top of an overlay widget.
89
- */
90
- OVERLAY_WIDGET = 12,
91
- /**
92
- * Mouse is outside of the editor.
93
- */
94
- OUTSIDE_EDITOR = 13
95
- }
96
- export interface MouseTarget {
97
- /**
98
- * The target element
99
- */
100
- readonly element?: Element;
101
- /**
102
- * The target type
103
- */
104
- readonly type: MouseTargetType;
105
- /**
106
- * The 'approximate' editor position
107
- */
108
- readonly position?: Position;
109
- /**
110
- * Desired mouse column (e.g. when position.column gets clamped to text length -- clicking after text on a line).
111
- */
112
- readonly mouseColumn: number;
113
- /**
114
- * The 'approximate' editor range
115
- */
116
- readonly range?: Range;
117
- /**
118
- * Some extra detail.
119
- */
120
- readonly detail: any;
121
- }
122
- export interface EditorMouseEvent {
123
- readonly event: MouseEvent;
124
- readonly target: MouseTarget;
125
- }
126
- export declare const enum EncodingMode {
127
- /**
128
- * Instructs the encoding support to encode the current input with the provided encoding
129
- */
130
- Encode = 0,
131
- /**
132
- * Instructs the encoding support to decode the current input with the provided encoding
133
- */
134
- Decode = 1
135
- }
136
- /**
137
- * Options for searching in an editor.
138
- */
139
- export interface FindMatchesOptions {
140
- /**
141
- * The string used to search. If it is a regular expression, set `isRegex` to true.
142
- */
143
- searchString: string;
144
- /**
145
- * Used to indicate that `searchString` is a regular expression.
146
- */
147
- isRegex: boolean;
148
- /**
149
- * Force the matching to match lower/upper case exactly.
150
- */
151
- matchCase: boolean;
152
- /**
153
- * Force the matching to match entire words only.
154
- */
155
- matchWholeWord: boolean;
156
- /**
157
- * Limit the number of results.
158
- */
159
- limitResultCount?: number;
160
- }
161
- /**
162
- * Representation of a find match.
163
- */
164
- export interface FindMatch {
165
- /**
166
- * The textual match.
167
- */
168
- readonly matches: string[];
169
- /**
170
- * The range for the given match.
171
- */
172
- readonly range: Range;
173
- }
174
- export interface TextEditor extends Disposable, TextEditorSelection, Navigatable {
175
- readonly node: HTMLElement;
176
- readonly uri: URI;
177
- readonly isReadonly: boolean;
178
- readonly document: TextEditorDocument;
179
- readonly onDocumentContentChanged: Event<TextDocumentChangeEvent>;
180
- cursor: Position;
181
- readonly onCursorPositionChanged: Event<Position>;
182
- selection: Range;
183
- readonly onSelectionChanged: Event<Range>;
184
- /**
185
- * The text editor should be revealed,
186
- * otherwise it won't receive the focus.
187
- */
188
- focus(): void;
189
- blur(): void;
190
- isFocused(): boolean;
191
- readonly onFocusChanged: Event<boolean>;
192
- readonly onMouseDown: Event<EditorMouseEvent>;
193
- readonly onScrollChanged: Event<void>;
194
- getVisibleRanges(): Range[];
195
- revealPosition(position: Position, options?: RevealPositionOptions): void;
196
- revealRange(range: Range, options?: RevealRangeOptions): void;
197
- /**
198
- * Rerender the editor.
199
- */
200
- refresh(): void;
201
- /**
202
- * Resize the editor to fit its node.
203
- */
204
- resizeToFit(): void;
205
- setSize(size: Dimension): void;
206
- /**
207
- * Applies given new decorations, and removes old decorations identified by ids.
208
- *
209
- * @returns identifiers of applied decorations, which can be removed in next call.
210
- */
211
- deltaDecorations(params: DeltaDecorationParams): string[];
212
- /**
213
- * Gets all the decorations for the lines between `startLineNumber` and `endLineNumber` as an array.
214
- * @param startLineNumber The start line number.
215
- * @param endLineNumber The end line number.
216
- * @return An array with the decorations.
217
- */
218
- getLinesDecorations(startLineNumber: number, endLineNumber: number): EditorDecoration[];
219
- getVisibleColumn(position: Position): number;
220
- /**
221
- * Replaces the text of source given in ReplaceTextParams.
222
- * @param params: ReplaceTextParams
223
- */
224
- replaceText(params: ReplaceTextParams): Promise<boolean>;
225
- /**
226
- * Execute edits on the editor.
227
- * @param edits: edits created with `lsp.TextEdit.replace`, `lsp.TextEdit.insert`, `lsp.TextEdit.del`
228
- */
229
- executeEdits(edits: lsp.TextEdit[]): boolean;
230
- storeViewState(): object;
231
- restoreViewState(state: object): void;
232
- detectLanguage(): void;
233
- setLanguage(languageId: string): void;
234
- readonly onLanguageChanged: Event<string>;
235
- /**
236
- * Gets the encoding of the input if known.
237
- */
238
- getEncoding(): string;
239
- /**
240
- * Sets the encoding for the input for saving.
241
- */
242
- setEncoding(encoding: string, mode: EncodingMode): void;
243
- readonly onEncodingChanged: Event<string>;
244
- }
245
- export interface Dimension {
246
- width: number;
247
- height: number;
248
- }
249
- export interface TextEditorSelection {
250
- uri: URI;
251
- cursor?: Position;
252
- selection?: Range;
253
- }
254
- export interface RevealPositionOptions {
255
- vertical: 'auto' | 'center' | 'centerIfOutsideViewport';
256
- horizontal?: boolean;
257
- }
258
- export interface RevealRangeOptions {
259
- at: 'auto' | 'center' | 'top' | 'centerIfOutsideViewport';
260
- }
261
- export interface DeltaDecorationParams {
262
- oldDecorations: string[];
263
- newDecorations: EditorDecoration[];
264
- }
265
- export interface ReplaceTextParams {
266
- /**
267
- * the source to edit
268
- */
269
- source: string;
270
- /**
271
- * the replace operations
272
- */
273
- replaceOperations: ReplaceOperation[];
274
- }
275
- export interface ReplaceOperation {
276
- /**
277
- * the position that shall be replaced
278
- */
279
- range: Range;
280
- /**
281
- * the text to replace with
282
- */
283
- text: string;
284
- }
285
- export declare namespace TextEditorSelection {
286
- function is(arg: unknown): arg is TextEditorSelection;
287
- }
288
- export declare namespace CustomEditorWidget {
289
- function is(arg: Widget | undefined): arg is CustomEditorWidget;
290
- }
291
- export interface CustomEditorWidget extends Widget {
292
- readonly modelRef: Reference<any>;
293
- }
1
+ import { Position, Range, Location } from '@theia/core/shared/vscode-languageserver-protocol';
2
+ import * as lsp from '@theia/core/shared/vscode-languageserver-protocol';
3
+ import URI from '@theia/core/lib/common/uri';
4
+ import { Event, Disposable, TextDocumentContentChangeDelta, Reference } from '@theia/core/lib/common';
5
+ import { Saveable, Navigatable, Widget } from '@theia/core/lib/browser';
6
+ import { EditorDecoration } from './decorations/editor-decoration';
7
+ export { Position, Range, Location };
8
+ export declare const TextEditorProvider: unique symbol;
9
+ export declare type TextEditorProvider = (uri: URI) => Promise<TextEditor>;
10
+ export interface TextEditorDocument extends lsp.TextDocument, Saveable, Disposable {
11
+ getLineContent(lineNumber: number): string;
12
+ getLineMaxColumn(lineNumber: number): number;
13
+ /**
14
+ * @since 1.8.0
15
+ */
16
+ findMatches?(options: FindMatchesOptions): FindMatch[];
17
+ /**
18
+ * Creates a valid position. If the position is outside of the backing document, this method will return a position that is ensured to be inside the document and valid.
19
+ * For example, when the `position` is `{ line: 1, character: 0 }` and the document is empty, this method will return with `{ line: 0, character: 0 }`.
20
+ */
21
+ toValidPosition(position: Position): Position;
22
+ /**
23
+ * Creates a valid range. If the `range` argument is outside of the document, this method will return with a new range that does not exceed the boundaries of the document.
24
+ * For example, if the argument is `{ start: { line: 1, character: 0 }, end: { line: 1, character: 0 } }` and the document is empty, the return value is
25
+ * `{ start: { line: 0, character: 0 }, end: { line: 0, character: 0 } }`.
26
+ */
27
+ toValidRange(range: Range): Range;
28
+ }
29
+ export { TextDocumentContentChangeDelta };
30
+ export interface TextDocumentChangeEvent {
31
+ readonly document: TextEditorDocument;
32
+ readonly contentChanges: TextDocumentContentChangeDelta[];
33
+ }
34
+ /**
35
+ * Type of hit element with the mouse in the editor.
36
+ * Copied from monaco editor.
37
+ */
38
+ export declare enum MouseTargetType {
39
+ /**
40
+ * Mouse is on top of an unknown element.
41
+ */
42
+ UNKNOWN = 0,
43
+ /**
44
+ * Mouse is on top of the textarea used for input.
45
+ */
46
+ TEXTAREA = 1,
47
+ /**
48
+ * Mouse is on top of the glyph margin
49
+ */
50
+ GUTTER_GLYPH_MARGIN = 2,
51
+ /**
52
+ * Mouse is on top of the line numbers
53
+ */
54
+ GUTTER_LINE_NUMBERS = 3,
55
+ /**
56
+ * Mouse is on top of the line decorations
57
+ */
58
+ GUTTER_LINE_DECORATIONS = 4,
59
+ /**
60
+ * Mouse is on top of the whitespace left in the gutter by a view zone.
61
+ */
62
+ GUTTER_VIEW_ZONE = 5,
63
+ /**
64
+ * Mouse is on top of text in the content.
65
+ */
66
+ CONTENT_TEXT = 6,
67
+ /**
68
+ * Mouse is on top of empty space in the content (e.g. after line text or below last line)
69
+ */
70
+ CONTENT_EMPTY = 7,
71
+ /**
72
+ * Mouse is on top of a view zone in the content.
73
+ */
74
+ CONTENT_VIEW_ZONE = 8,
75
+ /**
76
+ * Mouse is on top of a content widget.
77
+ */
78
+ CONTENT_WIDGET = 9,
79
+ /**
80
+ * Mouse is on top of the decorations overview ruler.
81
+ */
82
+ OVERVIEW_RULER = 10,
83
+ /**
84
+ * Mouse is on top of a scrollbar.
85
+ */
86
+ SCROLLBAR = 11,
87
+ /**
88
+ * Mouse is on top of an overlay widget.
89
+ */
90
+ OVERLAY_WIDGET = 12,
91
+ /**
92
+ * Mouse is outside of the editor.
93
+ */
94
+ OUTSIDE_EDITOR = 13
95
+ }
96
+ export interface MouseTarget {
97
+ /**
98
+ * The target element
99
+ */
100
+ readonly element?: Element;
101
+ /**
102
+ * The target type
103
+ */
104
+ readonly type: MouseTargetType;
105
+ /**
106
+ * The 'approximate' editor position
107
+ */
108
+ readonly position?: Position;
109
+ /**
110
+ * Desired mouse column (e.g. when position.column gets clamped to text length -- clicking after text on a line).
111
+ */
112
+ readonly mouseColumn: number;
113
+ /**
114
+ * The 'approximate' editor range
115
+ */
116
+ readonly range?: Range;
117
+ /**
118
+ * Some extra detail.
119
+ */
120
+ readonly detail: any;
121
+ }
122
+ export interface EditorMouseEvent {
123
+ readonly event: MouseEvent;
124
+ readonly target: MouseTarget;
125
+ }
126
+ export declare const enum EncodingMode {
127
+ /**
128
+ * Instructs the encoding support to encode the current input with the provided encoding
129
+ */
130
+ Encode = 0,
131
+ /**
132
+ * Instructs the encoding support to decode the current input with the provided encoding
133
+ */
134
+ Decode = 1
135
+ }
136
+ /**
137
+ * Options for searching in an editor.
138
+ */
139
+ export interface FindMatchesOptions {
140
+ /**
141
+ * The string used to search. If it is a regular expression, set `isRegex` to true.
142
+ */
143
+ searchString: string;
144
+ /**
145
+ * Used to indicate that `searchString` is a regular expression.
146
+ */
147
+ isRegex: boolean;
148
+ /**
149
+ * Force the matching to match lower/upper case exactly.
150
+ */
151
+ matchCase: boolean;
152
+ /**
153
+ * Force the matching to match entire words only.
154
+ */
155
+ matchWholeWord: boolean;
156
+ /**
157
+ * Limit the number of results.
158
+ */
159
+ limitResultCount?: number;
160
+ }
161
+ /**
162
+ * Representation of a find match.
163
+ */
164
+ export interface FindMatch {
165
+ /**
166
+ * The textual match.
167
+ */
168
+ readonly matches: string[];
169
+ /**
170
+ * The range for the given match.
171
+ */
172
+ readonly range: Range;
173
+ }
174
+ export interface TextEditor extends Disposable, TextEditorSelection, Navigatable {
175
+ readonly node: HTMLElement;
176
+ readonly uri: URI;
177
+ readonly isReadonly: boolean;
178
+ readonly document: TextEditorDocument;
179
+ readonly onDocumentContentChanged: Event<TextDocumentChangeEvent>;
180
+ cursor: Position;
181
+ readonly onCursorPositionChanged: Event<Position>;
182
+ selection: Range;
183
+ readonly onSelectionChanged: Event<Range>;
184
+ /**
185
+ * The text editor should be revealed,
186
+ * otherwise it won't receive the focus.
187
+ */
188
+ focus(): void;
189
+ blur(): void;
190
+ isFocused(): boolean;
191
+ readonly onFocusChanged: Event<boolean>;
192
+ readonly onMouseDown: Event<EditorMouseEvent>;
193
+ readonly onScrollChanged: Event<void>;
194
+ getVisibleRanges(): Range[];
195
+ revealPosition(position: Position, options?: RevealPositionOptions): void;
196
+ revealRange(range: Range, options?: RevealRangeOptions): void;
197
+ /**
198
+ * Rerender the editor.
199
+ */
200
+ refresh(): void;
201
+ /**
202
+ * Resize the editor to fit its node.
203
+ */
204
+ resizeToFit(): void;
205
+ setSize(size: Dimension): void;
206
+ /**
207
+ * Applies given new decorations, and removes old decorations identified by ids.
208
+ *
209
+ * @returns identifiers of applied decorations, which can be removed in next call.
210
+ */
211
+ deltaDecorations(params: DeltaDecorationParams): string[];
212
+ /**
213
+ * Gets all the decorations for the lines between `startLineNumber` and `endLineNumber` as an array.
214
+ * @param startLineNumber The start line number.
215
+ * @param endLineNumber The end line number.
216
+ * @return An array with the decorations.
217
+ */
218
+ getLinesDecorations(startLineNumber: number, endLineNumber: number): EditorDecoration[];
219
+ getVisibleColumn(position: Position): number;
220
+ /**
221
+ * Replaces the text of source given in ReplaceTextParams.
222
+ * @param params: ReplaceTextParams
223
+ */
224
+ replaceText(params: ReplaceTextParams): Promise<boolean>;
225
+ /**
226
+ * Execute edits on the editor.
227
+ * @param edits: edits created with `lsp.TextEdit.replace`, `lsp.TextEdit.insert`, `lsp.TextEdit.del`
228
+ */
229
+ executeEdits(edits: lsp.TextEdit[]): boolean;
230
+ storeViewState(): object;
231
+ restoreViewState(state: object): void;
232
+ detectLanguage(): void;
233
+ setLanguage(languageId: string): void;
234
+ readonly onLanguageChanged: Event<string>;
235
+ /**
236
+ * Gets the encoding of the input if known.
237
+ */
238
+ getEncoding(): string;
239
+ /**
240
+ * Sets the encoding for the input for saving.
241
+ */
242
+ setEncoding(encoding: string, mode: EncodingMode): void;
243
+ readonly onEncodingChanged: Event<string>;
244
+ }
245
+ export interface Dimension {
246
+ width: number;
247
+ height: number;
248
+ }
249
+ export interface TextEditorSelection {
250
+ uri: URI;
251
+ cursor?: Position;
252
+ selection?: Range;
253
+ }
254
+ export interface RevealPositionOptions {
255
+ vertical: 'auto' | 'center' | 'centerIfOutsideViewport';
256
+ horizontal?: boolean;
257
+ }
258
+ export interface RevealRangeOptions {
259
+ at: 'auto' | 'center' | 'top' | 'centerIfOutsideViewport';
260
+ }
261
+ export interface DeltaDecorationParams {
262
+ oldDecorations: string[];
263
+ newDecorations: EditorDecoration[];
264
+ }
265
+ export interface ReplaceTextParams {
266
+ /**
267
+ * the source to edit
268
+ */
269
+ source: string;
270
+ /**
271
+ * the replace operations
272
+ */
273
+ replaceOperations: ReplaceOperation[];
274
+ }
275
+ export interface ReplaceOperation {
276
+ /**
277
+ * the position that shall be replaced
278
+ */
279
+ range: Range;
280
+ /**
281
+ * the text to replace with
282
+ */
283
+ text: string;
284
+ }
285
+ export declare namespace TextEditorSelection {
286
+ function is(arg: unknown): arg is TextEditorSelection;
287
+ }
288
+ export declare namespace CustomEditorWidget {
289
+ function is(arg: Widget | undefined): arg is CustomEditorWidget;
290
+ }
291
+ export interface CustomEditorWidget extends Widget {
292
+ readonly modelRef: Reference<any>;
293
+ }
294
294
  //# sourceMappingURL=editor.d.ts.map