1 | import {
|
2 | BufferScanResult,
|
3 | BufferStoppedChangingEvent,
|
4 | ContextualBufferScanResult,
|
5 | Cursor,
|
6 | CursorPositionChangedEvent,
|
7 | Decoration,
|
8 | DecorationLayerOptions,
|
9 | DecorationOptions,
|
10 | DisplayMarker,
|
11 | DisplayMarkerLayer,
|
12 | Disposable,
|
13 | EditorChangedEvent,
|
14 | FindDisplayMarkerOptions,
|
15 | Grammar,
|
16 | Gutter,
|
17 | GutterOptions,
|
18 | LayerDecoration,
|
19 | MarkerLayer,
|
20 | Point,
|
21 | PointCompatible,
|
22 | Range,
|
23 | RangeCompatible,
|
24 | RangeLike,
|
25 | ReadonlyEditOptions,
|
26 | ScanContextOptions,
|
27 | ScopeDescriptor,
|
28 | Selection,
|
29 | SelectionChangedEvent,
|
30 | TextBuffer,
|
31 | TextEditOptions,
|
32 | TextInsertionOptions,
|
33 | } from '../index';
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | export class TextEditor {
|
40 | readonly id: number;
|
41 |
|
42 |
|
43 | constructor(options?: object);
|
44 |
|
45 | // Event Subscription
|
46 | /** Calls your callback when the buffer's title has changed. */
|
47 | onDidChangeTitle(callback: (title: string) => void): Disposable;
|
48 |
|
49 | /** Calls your callback when the buffer's path, and therefore title, has changed. */
|
50 | onDidChangePath(callback: (path: string) => void): Disposable;
|
51 |
|
52 | /**
|
53 | * Invoke the given callback synchronously when the content of the buffer
|
54 | * changes.
|
55 | */
|
56 | onDidChange(callback: (event: EditorChangedEvent[]) => void): Disposable;
|
57 |
|
58 | /**
|
59 | * Invoke callback when the buffer's contents change. It is emit
|
60 | * asynchronously 300ms after the last buffer change. This is a good place
|
61 | * to handle changes to the buffer without compromising typing performance.
|
62 | */
|
63 | onDidStopChanging(callback: (event: BufferStoppedChangingEvent) => void): Disposable;
|
64 |
|
65 | /**
|
66 | * Calls your callback when a Cursor is moved. If there are multiple cursors,
|
67 | * your callback will be called for each cursor.
|
68 | */
|
69 | onDidChangeCursorPosition(callback: (event: CursorPositionChangedEvent) => void): Disposable;
|
70 |
|
71 | /** Calls your callback when a selection's screen range changes. */
|
72 | onDidChangeSelectionRange(callback: (event: SelectionChangedEvent) => void): Disposable;
|
73 |
|
74 | /** Invoke the given callback after the buffer is saved to disk. */
|
75 | onDidSave(callback: (event: { path: string }) => void): Disposable;
|
76 |
|
77 | /** Invoke the given callback when the editor is destroyed. */
|
78 | onDidDestroy(callback: () => void): Disposable;
|
79 |
|
80 | /** Retrieves the current TextBuffer. */
|
81 | getBuffer(): TextBuffer;
|
82 |
|
83 | /** Sets the read-only state for the editor. */
|
84 | setReadOnly(readonly: boolean): void;
|
85 |
|
86 | /** Whether or not this editor is in read-only mode. */
|
87 | isReadOnly(): boolean;
|
88 |
|
89 | /**
|
90 | * Calls your callback when a Gutter is added to the editor. Immediately calls
|
91 | * your callback for each existing gutter.
|
92 | */
|
93 | observeGutters(callback: (gutter: Gutter) => void): Disposable;
|
94 |
|
95 | /** Calls your callback when a Gutter is added to the editor. */
|
96 | onDidAddGutter(callback: (gutter: Gutter) => void): Disposable;
|
97 |
|
98 | /** Calls your callback when a Gutter is removed from the editor. */
|
99 | onDidRemoveGutter(callback: (name: string) => void): Disposable;
|
100 |
|
101 | /** Calls your callback when soft wrap was enabled or disabled. */
|
102 | onDidChangeSoftWrapped(callback: (softWrapped: boolean) => void): Disposable;
|
103 |
|
104 | /** Calls your callback when the buffer's encoding has changed. */
|
105 | onDidChangeEncoding(callback: (encoding: string) => void): Disposable;
|
106 |
|
107 | /**
|
108 | * Calls your callback when the grammar that interprets and colorizes the text
|
109 | * has been changed. Immediately calls your callback with the current grammar.
|
110 | */
|
111 | observeGrammar(callback: (grammar: Grammar) => void): Disposable;
|
112 |
|
113 | /**
|
114 | * Calls your callback when the grammar that interprets and colorizes the text
|
115 | * has been changed.
|
116 | */
|
117 | onDidChangeGrammar(callback: (grammar: Grammar) => void): Disposable;
|
118 |
|
119 | /** Calls your callback when the result of ::isModified changes. */
|
120 | onDidChangeModified(callback: (modified: boolean) => void): Disposable;
|
121 |
|
122 | /**
|
123 | * Calls your callback when the buffer's underlying file changes on disk at a
|
124 | * moment when the result of ::isModified is true.
|
125 | */
|
126 | onDidConflict(callback: () => void): Disposable;
|
127 |
|
128 | /** Calls your callback before text has been inserted. */
|
129 | onWillInsertText(callback: (event: { text: string; cancel(): void }) => void): Disposable;
|
130 |
|
131 | /** Calls your callback after text has been inserted. */
|
132 | onDidInsertText(callback: (event: { text: string }) => void): Disposable;
|
133 |
|
134 | /**
|
135 | * Calls your callback when a Cursor is added to the editor. Immediately calls
|
136 | * your callback for each existing cursor.
|
137 | */
|
138 | observeCursors(callback: (cursor: Cursor) => void): Disposable;
|
139 |
|
140 | /** Calls your callback when a Cursor is added to the editor. */
|
141 | onDidAddCursor(callback: (cursor: Cursor) => void): Disposable;
|
142 |
|
143 | /** Calls your callback when a Cursor is removed from the editor. */
|
144 | onDidRemoveCursor(callback: (cursor: Cursor) => void): Disposable;
|
145 |
|
146 | /**
|
147 | * Calls your callback when a Selection is added to the editor. Immediately
|
148 | * calls your callback for each existing selection.
|
149 | */
|
150 | observeSelections(callback: (selection: Selection) => void): Disposable;
|
151 |
|
152 | /** Calls your callback when a Selection is added to the editor. */
|
153 | onDidAddSelection(callback: (selection: Selection) => void): Disposable;
|
154 |
|
155 | /** Calls your callback when a Selection is removed from the editor. */
|
156 | onDidRemoveSelection(callback: (selection: Selection) => void): Disposable;
|
157 |
|
158 | /**
|
159 | * Calls your callback with each Decoration added to the editor. Calls your
|
160 | * callback immediately for any existing decorations.
|
161 | */
|
162 | observeDecorations(callback: (decoration: Decoration) => void): Disposable;
|
163 |
|
164 | /** Calls your callback when a Decoration is added to the editor. */
|
165 | onDidAddDecoration(callback: (decoration: Decoration) => void): Disposable;
|
166 |
|
167 | /** Calls your callback when a Decoration is removed from the editor. */
|
168 | onDidRemoveDecoration(callback: (decoration: Decoration) => void): Disposable;
|
169 |
|
170 | /** Calls your callback when the placeholder text is changed. */
|
171 | onDidChangePlaceholderText(callback: (placeholderText: string) => void): Disposable;
|
172 |
|
173 | // File Details
|
174 | /**
|
175 | * Get the editor's title for display in other parts of the UI such as the tabs.
|
176 | * If the editor's buffer is saved, its title is the file name. If it is unsaved,
|
177 | * its title is "untitled".
|
178 | */
|
179 | getTitle(): string;
|
180 |
|
181 | /**
|
182 | * Get unique title for display in other parts of the UI, such as the window title.
|
183 | * If the editor's buffer is unsaved, its title is "untitled" If the editor's
|
184 | * buffer is saved, its unique title is formatted as one of the following,
|
185 | *
|
186 | * "" when it is the only editing buffer with this file name.
|
187 | * " — " when other buffers have this file name.
|
188 | */
|
189 | getLongTitle(): string;
|
190 |
|
191 | /** Returns the string path of this editor's text buffer. */
|
192 | getPath(): string | undefined;
|
193 |
|
194 | /** Returns boolean true if this editor has been modified. */
|
195 | isModified(): boolean;
|
196 |
|
197 | /** Returns boolean true if this editor has no content. */
|
198 | isEmpty(): boolean;
|
199 |
|
200 | /** Returns the string character set encoding of this editor's text buffer. */
|
201 | getEncoding(): string;
|
202 |
|
203 | /** Set the character set encoding to use in this editor's text buffer. */
|
204 | setEncoding(encoding: string): void;
|
205 |
|
206 | // File Operations
|
207 | /**
|
208 | * Saves the editor's text buffer.
|
209 | * See TextBuffer::save for more details.
|
210 | */
|
211 | save(): Promise<void>;
|
212 |
|
213 | /**
|
214 | * Saves the editor's text buffer as the given path.
|
215 | * See TextBuffer::saveAs for more details.
|
216 | */
|
217 | saveAs(filePath: string): Promise<void>;
|
218 |
|
219 | // Reading Text
|
220 | /** Returns a string representing the entire contents of the editor. */
|
221 | getText(): string;
|
222 |
|
223 | /** Get the text in the given range in buffer coordinates. */
|
224 | getTextInBufferRange(range: RangeCompatible): string;
|
225 |
|
226 | /** Returns a number representing the number of lines in the buffer. */
|
227 | getLineCount(): number;
|
228 |
|
229 | /**
|
230 | * Returns a number representing the number of screen lines in the editor.
|
231 | * This accounts for folds.
|
232 | */
|
233 | getScreenLineCount(): number;
|
234 |
|
235 | /**
|
236 | * Returns a number representing the last zero-indexed buffer row number of
|
237 | * the editor.
|
238 | */
|
239 | getLastBufferRow(): number;
|
240 |
|
241 | /**
|
242 | * Returns a number representing the last zero-indexed screen row number of
|
243 | * the editor.
|
244 | */
|
245 | getLastScreenRow(): number;
|
246 |
|
247 | /**
|
248 | * Returns a string representing the contents of the line at the given
|
249 | * buffer row.
|
250 | */
|
251 | lineTextForBufferRow(bufferRow: number): string;
|
252 |
|
253 | /**
|
254 | * Returns a string representing the contents of the line at the given
|
255 | * screen row.
|
256 | */
|
257 | lineTextForScreenRow(screenRow: number): string;
|
258 |
|
259 | /** Get the range of the paragraph surrounding the most recently added cursor. */
|
260 | getCurrentParagraphBufferRange(): Range;
|
261 |
|
262 | // Mutating Text
|
263 | /** Replaces the entire contents of the buffer with the given string. */
|
264 | setText(text: string, options?: ReadonlyEditOptions): void;
|
265 |
|
266 | /** Set the text in the given Range in buffer coordinates. */
|
267 | setTextInBufferRange(range: RangeCompatible, text: string, options?: TextEditOptions & ReadonlyEditOptions): Range;
|
268 |
|
269 | /* For each selection, replace the selected text with the given text. */
|
270 | insertText(text: string, options?: TextInsertionOptions & ReadonlyEditOptions): Range | false;
|
271 |
|
272 | /** For each selection, replace the selected text with a newline. */
|
273 | insertNewline(options?: ReadonlyEditOptions): void;
|
274 |
|
275 | /**
|
276 | * For each selection, if the selection is empty, delete the character following
|
277 | * the cursor. Otherwise delete the selected text.
|
278 | */
|
279 | delete(options?: ReadonlyEditOptions): void;
|
280 |
|
281 | /**
|
282 | * For each selection, if the selection is empty, delete the character preceding
|
283 | * the cursor. Otherwise delete the selected text.
|
284 | */
|
285 | backspace(options?: ReadonlyEditOptions): void;
|
286 |
|
287 | /**
|
288 | * Mutate the text of all the selections in a single transaction.
|
289 | * All the changes made inside the given function can be reverted with a single
|
290 | * call to ::undo.
|
291 | */
|
292 | mutateSelectedText(fn: (selection: Selection, index: number) => void): void;
|
293 |
|
294 | /**
|
295 | * For each selection, transpose the selected text.
|
296 | * If the selection is empty, the characters preceding and following the cursor
|
297 | * are swapped. Otherwise, the selected characters are reversed.
|
298 | */
|
299 | transpose(options?: ReadonlyEditOptions): void;
|
300 |
|
301 | /**
|
302 | * Convert the selected text to upper case.
|
303 | * For each selection, if the selection is empty, converts the containing word
|
304 | * to upper case. Otherwise convert the selected text to upper case.
|
305 | */
|
306 | upperCase(options?: ReadonlyEditOptions): void;
|
307 |
|
308 | /**
|
309 | * Convert the selected text to lower case.
|
310 | * For each selection, if the selection is empty, converts the containing word
|
311 | * to upper case. Otherwise convert the selected text to upper case.
|
312 | */
|
313 | lowerCase(options?: ReadonlyEditOptions): void;
|
314 |
|
315 | /**
|
316 | * Toggle line comments for rows intersecting selections.
|
317 | * If the current grammar doesn't support comments, does nothing.
|
318 | */
|
319 | toggleLineCommentsInSelection(options?: ReadonlyEditOptions): void;
|
320 |
|
321 | /** For each cursor, insert a newline at beginning the following line. */
|
322 | insertNewlineBelow(options?: ReadonlyEditOptions): void;
|
323 |
|
324 | /** For each cursor, insert a newline at the end of the preceding line. */
|
325 | insertNewlineAbove(options?: ReadonlyEditOptions): void;
|
326 |
|
327 | /**
|
328 | * For each selection, if the selection is empty, delete all characters of the
|
329 | * containing word that precede the cursor. Otherwise delete the selected text.
|
330 | */
|
331 | deleteToBeginningOfWord(options?: ReadonlyEditOptions): void;
|
332 |
|
333 | /**
|
334 | * Similar to ::deleteToBeginningOfWord, but deletes only back to the previous
|
335 | * word boundary.
|
336 | */
|
337 | deleteToPreviousWordBoundary(options?: ReadonlyEditOptions): void;
|
338 |
|
339 | /** Similar to ::deleteToEndOfWord, but deletes only up to the next word boundary. */
|
340 | deleteToNextWordBoundary(options?: ReadonlyEditOptions): void;
|
341 |
|
342 | /**
|
343 | * For each selection, if the selection is empty, delete all characters of the
|
344 | * containing subword following the cursor. Otherwise delete the selected text.
|
345 | */
|
346 | deleteToBeginningOfSubword(options?: ReadonlyEditOptions): void;
|
347 |
|
348 | /**
|
349 | * For each selection, if the selection is empty, delete all characters of the
|
350 | * containing subword following the cursor. Otherwise delete the selected text.
|
351 | */
|
352 | deleteToEndOfSubword(options?: ReadonlyEditOptions): void;
|
353 |
|
354 | /**
|
355 | * For each selection, if the selection is empty, delete all characters of the
|
356 | * containing line that precede the cursor. Otherwise delete the selected text.
|
357 | */
|
358 | deleteToBeginningOfLine(options?: ReadonlyEditOptions): void;
|
359 |
|
360 | /**
|
361 | * For each selection, if the selection is not empty, deletes the selection
|
362 | * otherwise, deletes all characters of the containing line following the cursor.
|
363 | * If the cursor is already at the end of the line, deletes the following newline.
|
364 | */
|
365 | deleteToEndOfLine(options?: ReadonlyEditOptions): void;
|
366 |
|
367 | /**
|
368 | * For each selection, if the selection is empty, delete all characters of the
|
369 | * containing word following the cursor. Otherwise delete the selected text.
|
370 | */
|
371 | deleteToEndOfWord(options?: ReadonlyEditOptions): void;
|
372 |
|
373 | /** Delete all lines intersecting selections. */
|
374 | deleteLine(options?: ReadonlyEditOptions): void;
|
375 |
|
376 | // History
|
377 | /** Undo the last change. */
|
378 | undo(options?: ReadonlyEditOptions): void;
|
379 |
|
380 | /** Redo the last change. */
|
381 | redo(options?: ReadonlyEditOptions): void;
|
382 |
|
383 | /**
|
384 | * Batch multiple operations as a single undo/redo step.
|
385 | * Any group of operations that are logically grouped from the perspective of undoing
|
386 | * and redoing should be performed in a transaction. If you want to abort the transaction,
|
387 | * call ::abortTransaction to terminate the function's execution and revert any changes
|
388 | * performed up to the abortion.
|
389 | */
|
390 | transact(fn: () => void): void;
|
391 | /**
|
392 | * Batch multiple operations as a single undo/redo step.
|
393 | * Any group of operations that are logically grouped from the perspective of undoing
|
394 | * and redoing should be performed in a transaction. If you want to abort the transaction,
|
395 | * call ::abortTransaction to terminate the function's execution and revert any changes
|
396 | * performed up to the abortion.
|
397 | */
|
398 | transact(groupingInterval: number, fn: () => void): void;
|
399 |
|
400 | /**
|
401 | * Abort an open transaction, undoing any operations performed so far within the
|
402 | * transaction.
|
403 | */
|
404 | abortTransaction(): void;
|
405 |
|
406 | /**
|
407 | * Create a pointer to the current state of the buffer for use with ::revertToCheckpoint
|
408 | * and ::groupChangesSinceCheckpoint.
|
409 | */
|
410 | createCheckpoint(): number;
|
411 |
|
412 | /**
|
413 | * Revert the buffer to the state it was in when the given checkpoint was created.
|
414 | * The redo stack will be empty following this operation, so changes since the checkpoint
|
415 | * will be lost. If the given checkpoint is no longer present in the undo history, no
|
416 | * changes will be made to the buffer and this method will return false.
|
417 | */
|
418 | revertToCheckpoint(checkpoint: number): boolean;
|
419 |
|
420 | /**
|
421 | * Group all changes since the given checkpoint into a single transaction for purposes
|
422 | * of undo/redo.
|
423 | * If the given checkpoint is no longer present in the undo history, no grouping will be
|
424 | * performed and this method will return false.
|
425 | */
|
426 | groupChangesSinceCheckpoint(checkpoint: number): boolean;
|
427 |
|
428 | // TextEditor Coordinates
|
429 | /** Convert a position in buffer-coordinates to screen-coordinates. */
|
430 | screenPositionForBufferPosition(
|
431 | bufferPosition: PointCompatible,
|
432 | options?: { clipDirection?: 'backward' | 'forward' | 'closest' | undefined },
|
433 | ): Point;
|
434 |
|
435 | /** Convert a position in screen-coordinates to buffer-coordinates. */
|
436 | bufferPositionForScreenPosition(
|
437 | bufferPosition: PointCompatible,
|
438 | options?: { clipDirection?: 'backward' | 'forward' | 'closest' | undefined },
|
439 | ): Point;
|
440 |
|
441 | /** Convert a range in buffer-coordinates to screen-coordinates. */
|
442 | screenRangeForBufferRange(bufferRange: RangeCompatible): Range;
|
443 |
|
444 | /** Convert a range in screen-coordinates to buffer-coordinates. */
|
445 | bufferRangeForScreenRange(screenRange: RangeCompatible): Range;
|
446 |
|
447 | /** Clip the given Point to a valid position in the buffer. */
|
448 | clipBufferPosition(bufferPosition: PointCompatible): Point;
|
449 |
|
450 | /**
|
451 | * Clip the start and end of the given range to valid positions in the buffer.
|
452 | * See ::clipBufferPosition for more information.
|
453 | */
|
454 | clipBufferRange(range: RangeCompatible): Range;
|
455 |
|
456 | /** Clip the given Point to a valid position on screen. */
|
457 | clipScreenPosition(
|
458 | screenPosition: PointCompatible,
|
459 | options?: { clipDirection?: 'backward' | 'forward' | 'closest' | undefined },
|
460 | ): Point;
|
461 |
|
462 | /**
|
463 | * Clip the start and end of the given range to valid positions on screen.
|
464 | * See ::clipScreenPosition for more information.
|
465 | */
|
466 | clipScreenRange(range: RangeCompatible, options?: { clipDirection?: 'backward' | 'forward' | 'closest' | undefined }): Range;
|
467 |
|
468 | // Decorations
|
469 | /**
|
470 | * Add a decoration that tracks a DisplayMarker. When the marker moves, is
|
471 | * invalidated, or is destroyed, the decoration will be updated to reflect
|
472 | * the marker's state.
|
473 | */
|
474 | decorateMarker(marker: DisplayMarker, decorationParams: DecorationOptions): Decoration;
|
475 |
|
476 | /**
|
477 | * Add a decoration to every marker in the given marker layer. Can be used to
|
478 | * decorate a large number of markers without having to create and manage many
|
479 | * individual decorations.
|
480 | */
|
481 | decorateMarkerLayer(
|
482 | markerLayer: MarkerLayer | DisplayMarkerLayer,
|
483 | decorationParams: DecorationLayerOptions,
|
484 | ): LayerDecoration;
|
485 |
|
486 | /** Get all decorations. */
|
487 | getDecorations(propertyFilter?: DecorationOptions): Decoration[];
|
488 |
|
489 | /** Get all decorations of type 'line'. */
|
490 | getLineDecorations(propertyFilter?: DecorationOptions): Decoration[];
|
491 |
|
492 | /** Get all decorations of type 'line-number'. */
|
493 | getLineNumberDecorations(propertyFilter?: DecorationOptions): Decoration[];
|
494 |
|
495 | /** Get all decorations of type 'highlight'. */
|
496 | getHighlightDecorations(propertyFilter?: DecorationOptions): Decoration[];
|
497 |
|
498 | /** Get all decorations of type 'overlay'. */
|
499 | getOverlayDecorations(propertyFilter?: DecorationOptions): Decoration[];
|
500 |
|
501 | // Markers
|
502 | /**
|
503 | * Create a marker on the default marker layer with the given range in buffer coordinates.
|
504 | * This marker will maintain its logical location as the buffer is changed, so if you mark
|
505 | * a particular word, the marker will remain over that word even if the word's location
|
506 | * in the buffer changes.
|
507 | */
|
508 | markBufferRange(
|
509 | range: RangeCompatible,
|
510 | properties?: {
|
511 | maintainHistory?: boolean | undefined;
|
512 | reversed?: boolean | undefined;
|
513 | invalidate?: 'never' | 'surround' | 'overlap' | 'inside' | 'touch' | undefined;
|
514 | },
|
515 | ): DisplayMarker;
|
516 |
|
517 | /**
|
518 | * Create a marker on the default marker layer with the given range in screen coordinates.
|
519 | * This marker will maintain its logical location as the buffer is changed, so if you mark
|
520 | * a particular word, the marker will remain over that word even if the word's location in
|
521 | * the buffer changes.
|
522 | */
|
523 | markScreenRange(
|
524 | range: RangeCompatible,
|
525 | properties?: {
|
526 | maintainHistory?: boolean | undefined;
|
527 | reversed?: boolean | undefined;
|
528 | invalidate?: 'never' | 'surround' | 'overlap' | 'inside' | 'touch' | undefined;
|
529 | },
|
530 | ): DisplayMarker;
|
531 |
|
532 | /**
|
533 | * Create a marker on the default marker layer with the given buffer position and no tail.
|
534 | * To group multiple markers together in their own private layer, see ::addMarkerLayer.
|
535 | */
|
536 | markBufferPosition(
|
537 | bufferPosition: PointCompatible,
|
538 | options?: {
|
539 | invalidate?: 'never' | 'surround' | 'overlap' | 'inside' | 'touch' | undefined;
|
540 | },
|
541 | ): DisplayMarker;
|
542 |
|
543 | /**
|
544 | * Create a marker on the default marker layer with the given screen position and no tail.
|
545 | * To group multiple markers together in their own private layer, see ::addMarkerLayer.
|
546 | */
|
547 | markScreenPosition(
|
548 | screenPosition: PointCompatible,
|
549 | options?: {
|
550 | invalidate?: 'never' | 'surround' | 'overlap' | 'inside' | 'touch' | undefined;
|
551 | clipDirection?: 'backward' | 'forward' | 'closest' | undefined;
|
552 | },
|
553 | ): DisplayMarker;
|
554 |
|
555 | /**
|
556 | * Find all DisplayMarkers on the default marker layer that match the given properties.
|
557 | *
|
558 | * This method finds markers based on the given properties. Markers can be associated
|
559 | * with custom properties that will be compared with basic equality. In addition, there
|
560 | * are several special properties that will be compared with the range of the markers
|
561 | * rather than their properties.
|
562 | */
|
563 | findMarkers(properties: FindDisplayMarkerOptions): DisplayMarker[];
|
564 |
|
565 | /** Create a marker layer to group related markers. */
|
566 | addMarkerLayer(options?: { maintainHistory?: boolean | undefined; persistent?: boolean | undefined }): DisplayMarkerLayer;
|
567 |
|
568 | /** Get a DisplayMarkerLayer by id. */
|
569 | getMarkerLayer(id: number): DisplayMarkerLayer | undefined;
|
570 |
|
571 | /**
|
572 | * Get the default DisplayMarkerLayer.
|
573 | * All marker APIs not tied to an explicit layer interact with this default layer.
|
574 | */
|
575 | getDefaultMarkerLayer(): DisplayMarkerLayer;
|
576 |
|
577 | /** Get the DisplayMarker on the default layer for the given marker id. */
|
578 | getMarker(id: number): DisplayMarker;
|
579 |
|
580 | /** Get all DisplayMarkers on the default marker layer. Consider using ::findMarkers. */
|
581 | getMarkers(): DisplayMarker[];
|
582 |
|
583 | /** Get the number of markers in the default marker layer. */
|
584 | getMarkerCount(): number;
|
585 |
|
586 | // Cursors
|
587 | /** Get the position of the most recently added cursor in buffer coordinates. */
|
588 | getCursorBufferPosition(): Point;
|
589 |
|
590 | /** Get the position of all the cursor positions in buffer coordinates. */
|
591 | getCursorBufferPositions(): Point[];
|
592 |
|
593 | /**
|
594 | * Move the cursor to the given position in buffer coordinates.
|
595 | * If there are multiple cursors, they will be consolidated to a single cursor.
|
596 | */
|
597 | setCursorBufferPosition(position: PointCompatible, options?: { autoscroll?: boolean | undefined }): void;
|
598 |
|
599 | /** Get a Cursor at given screen coordinates Point. */
|
600 | getCursorAtScreenPosition(position: PointCompatible): Cursor | undefined;
|
601 |
|
602 | /** Get the position of the most recently added cursor in screen coordinates. */
|
603 | getCursorScreenPosition(): Point;
|
604 |
|
605 | /** Get the position of all the cursor positions in screen coordinates. */
|
606 | getCursorScreenPositions(): Point[];
|
607 |
|
608 | /**
|
609 | * Move the cursor to the given position in screen coordinates.
|
610 | * If there are multiple cursors, they will be consolidated to a single cursor.
|
611 | */
|
612 | setCursorScreenPosition(position: PointCompatible, options?: { autoscroll?: boolean | undefined }): void;
|
613 |
|
614 | /** Add a cursor at the given position in buffer coordinates. */
|
615 | addCursorAtBufferPosition(bufferPosition: PointCompatible, options?: { autoscroll?: boolean | undefined }): Cursor;
|
616 |
|
617 | /** Add a cursor at the position in screen coordinates. */
|
618 | addCursorAtScreenPosition(screenPosition: PointCompatible): Cursor;
|
619 |
|
620 | /** Returns a boolean indicating whether or not there are multiple cursors. */
|
621 | hasMultipleCursors(): boolean;
|
622 |
|
623 | /** Move every cursor up one row in screen coordinates. */
|
624 | moveUp(lineCount?: number): void;
|
625 |
|
626 | /** Move every cursor down one row in screen coordinates. */
|
627 | moveDown(lineCount?: number): void;
|
628 |
|
629 | /** Move every cursor left one column. */
|
630 | moveLeft(columnCount?: number): void;
|
631 |
|
632 | /** Move every cursor right one column. */
|
633 | moveRight(columnCount?: number): void;
|
634 |
|
635 | /** Move every cursor to the beginning of its line in buffer coordinates. */
|
636 | moveToBeginningOfLine(): void;
|
637 |
|
638 | /** Move every cursor to the beginning of its line in screen coordinates. */
|
639 | moveToBeginningOfScreenLine(): void;
|
640 |
|
641 | /** Move every cursor to the first non-whitespace character of its line. */
|
642 | moveToFirstCharacterOfLine(): void;
|
643 |
|
644 | /** Move every cursor to the end of its line in buffer coordinates. */
|
645 | moveToEndOfLine(): void;
|
646 |
|
647 | /** Move every cursor to the end of its line in screen coordinates. */
|
648 | moveToEndOfScreenLine(): void;
|
649 |
|
650 | /** Move every cursor to the beginning of its surrounding word. */
|
651 | moveToBeginningOfWord(): void;
|
652 |
|
653 | /** Move every cursor to the end of its surrounding word. */
|
654 | moveToEndOfWord(): void;
|
655 |
|
656 | /**
|
657 | * Move every cursor to the top of the buffer.
|
658 | * If there are multiple cursors, they will be merged into a single cursor.
|
659 | */
|
660 | moveToTop(): void;
|
661 |
|
662 | /**
|
663 | * Move every cursor to the bottom of the buffer.
|
664 | * If there are multiple cursors, they will be merged into a single cursor.
|
665 | */
|
666 | moveToBottom(): void;
|
667 |
|
668 | /** Move every cursor to the beginning of the next word. */
|
669 | moveToBeginningOfNextWord(): void;
|
670 |
|
671 | /** Move every cursor to the previous word boundary. */
|
672 | moveToPreviousWordBoundary(): void;
|
673 |
|
674 | /** Move every cursor to the next word boundary. */
|
675 | moveToNextWordBoundary(): void;
|
676 |
|
677 | /** Move every cursor to the previous subword boundary. */
|
678 | moveToPreviousSubwordBoundary(): void;
|
679 |
|
680 | /** Move every cursor to the next subword boundary. */
|
681 | moveToNextSubwordBoundary(): void;
|
682 |
|
683 | /** Move every cursor to the beginning of the next paragraph. */
|
684 | moveToBeginningOfNextParagraph(): void;
|
685 |
|
686 | /** Move every cursor to the beginning of the previous paragraph. */
|
687 | moveToBeginningOfPreviousParagraph(): void;
|
688 |
|
689 | /** Returns the most recently added Cursor. */
|
690 | getLastCursor(): Cursor;
|
691 |
|
692 | /** Returns the word surrounding the most recently added cursor. */
|
693 | getWordUnderCursor(options?: {
|
694 | wordRegex?: RegExp | undefined;
|
695 | includeNonWordCharacters?: boolean | undefined;
|
696 | allowPrevious?: boolean | undefined;
|
697 | }): string;
|
698 |
|
699 | /** Get an Array of all Cursors. */
|
700 | getCursors(): Cursor[];
|
701 |
|
702 | /**
|
703 | * Get all Cursors, ordered by their position in the buffer instead of the
|
704 | * order in which they were added.
|
705 | */
|
706 | getCursorsOrderedByBufferPosition(): Cursor[];
|
707 |
|
708 | // Selections
|
709 | /** Get the selected text of the most recently added selection. */
|
710 | getSelectedText(): string;
|
711 |
|
712 | /** Get the Range of the most recently added selection in buffer coordinates. */
|
713 | getSelectedBufferRange(): Range;
|
714 |
|
715 | /**
|
716 | * Get the Ranges of all selections in buffer coordinates.
|
717 | * The ranges are sorted by when the selections were added. Most recent at the end.
|
718 | */
|
719 | getSelectedBufferRanges(): Range[];
|
720 |
|
721 | /**
|
722 | * Set the selected range in buffer coordinates. If there are multiple selections,
|
723 | * they are reduced to a single selection with the given range.
|
724 | */
|
725 | setSelectedBufferRange(
|
726 | bufferRange: RangeCompatible,
|
727 | options?: { reversed?: boolean | undefined; preserveFolds?: boolean | undefined },
|
728 | ): void;
|
729 |
|
730 | /**
|
731 | * Set the selected ranges in buffer coordinates. If there are multiple selections,
|
732 | * they are replaced by new selections with the given ranges.
|
733 | */
|
734 | setSelectedBufferRanges(
|
735 | bufferRanges: ReadonlyArray<RangeCompatible>,
|
736 | options?: { reversed?: boolean | undefined; preserveFolds?: boolean | undefined },
|
737 | ): void;
|
738 |
|
739 | /** Get the Range of the most recently added selection in screen coordinates. */
|
740 | getSelectedScreenRange(): Range;
|
741 |
|
742 | /**
|
743 | * Get the Ranges of all selections in screen coordinates.
|
744 | * The ranges are sorted by when the selections were added. Most recent at the end.
|
745 | */
|
746 | getSelectedScreenRanges(): Range[];
|
747 |
|
748 | /**
|
749 | * Set the selected range in screen coordinates. If there are multiple selections,
|
750 | * they are reduced to a single selection with the given range.
|
751 | */
|
752 | setSelectedScreenRange(screenRange: RangeCompatible, options?: { reversed?: boolean | undefined }): void;
|
753 |
|
754 | /**
|
755 | * Set the selected ranges in screen coordinates. If there are multiple selections,
|
756 | * they are replaced by new selections with the given ranges.
|
757 | */
|
758 | setSelectedScreenRanges(screenRanges: ReadonlyArray<RangeCompatible>, options?: { reversed?: boolean | undefined }): void;
|
759 |
|
760 | /** Add a selection for the given range in buffer coordinates. */
|
761 | addSelectionForBufferRange(
|
762 | bufferRange: RangeCompatible,
|
763 | options?: { reversed?: boolean | undefined; preserveFolds?: boolean | undefined },
|
764 | ): Selection;
|
765 |
|
766 | /** Add a selection for the given range in screen coordinates. */
|
767 | addSelectionForScreenRange(
|
768 | screenRange: RangeCompatible,
|
769 | options?: { reversed?: boolean | undefined; preserveFolds?: boolean | undefined },
|
770 | ): Selection;
|
771 |
|
772 | /**
|
773 | * Select from the current cursor position to the given position in buffer coordinates.
|
774 | * This method may merge selections that end up intersecting.
|
775 | */
|
776 | selectToBufferPosition(position: PointCompatible): void;
|
777 |
|
778 | /**
|
779 | * Select from the current cursor position to the given position in screen coordinates.
|
780 | * This method may merge selections that end up intersecting.
|
781 | */
|
782 | selectToScreenPosition(position: PointCompatible): void;
|
783 |
|
784 | /**
|
785 | * Move the cursor of each selection one character upward while preserving the
|
786 | * selection's tail position.
|
787 | * This method may merge selections that end up intersecting.
|
788 | */
|
789 | selectUp(rowCount?: number): void;
|
790 |
|
791 | /**
|
792 | * Move the cursor of each selection one character downward while preserving
|
793 | * the selection's tail position.
|
794 | * This method may merge selections that end up intersecting.
|
795 | */
|
796 | selectDown(rowCount?: number): void;
|
797 |
|
798 | /**
|
799 | * Move the cursor of each selection one character leftward while preserving
|
800 | * the selection's tail position.
|
801 | * This method may merge selections that end up intersecting.
|
802 | */
|
803 | selectLeft(columnCount?: number): void;
|
804 |
|
805 | /**
|
806 | * Move the cursor of each selection one character rightward while preserving
|
807 | * the selection's tail position.
|
808 | * This method may merge selections that end up intersecting.
|
809 | */
|
810 | selectRight(columnCount?: number): void;
|
811 |
|
812 | /**
|
813 | * Select from the top of the buffer to the end of the last selection in the buffer.
|
814 | * This method merges multiple selections into a single selection.
|
815 | */
|
816 | selectToTop(): void;
|
817 |
|
818 | /**
|
819 | * Selects from the top of the first selection in the buffer to the end of the buffer.
|
820 | * This method merges multiple selections into a single selection.
|
821 | */
|
822 | selectToBottom(): void;
|
823 |
|
824 | /**
|
825 | * Select all text in the buffer.
|
826 | * This method merges multiple selections into a single selection.
|
827 | */
|
828 | selectAll(): void;
|
829 |
|
830 | /**
|
831 | * Move the cursor of each selection to the beginning of its line while preserving
|
832 | * the selection's tail position.
|
833 | * This method may merge selections that end up intersecting.
|
834 | */
|
835 | selectToBeginningOfLine(): void;
|
836 |
|
837 | /**
|
838 | * Move the cursor of each selection to the first non-whitespace character of its
|
839 | * line while preserving the selection's tail position. If the cursor is already
|
840 | * on the first character of the line, move it to the beginning of the line.
|
841 | * This method may merge selections that end up intersecting.
|
842 | */
|
843 | selectToFirstCharacterOfLine(): void;
|
844 |
|
845 | /**
|
846 | * Move the cursor of each selection to the end of its line while preserving the
|
847 | * selection's tail position.
|
848 | * This method may merge selections that end up intersecting.
|
849 | */
|
850 | selectToEndOfLine(): void;
|
851 |
|
852 | /**
|
853 | * Expand selections to the beginning of their containing word.
|
854 | * Operates on all selections. Moves the cursor to the beginning of the containing
|
855 | * word while preserving the selection's tail position.
|
856 | */
|
857 | selectToBeginningOfWord(): void;
|
858 |
|
859 | /**
|
860 | * Expand selections to the end of their containing word.
|
861 | * Operates on all selections. Moves the cursor to the end of the containing word
|
862 | * while preserving the selection's tail position.
|
863 | */
|
864 | selectToEndOfWord(): void;
|
865 |
|
866 | /**
|
867 | * For each cursor, select the containing line.
|
868 | * This method merges selections on successive lines.
|
869 | */
|
870 | selectLinesContainingCursors(): void;
|
871 |
|
872 | /** Select the word surrounding each cursor. */
|
873 | selectWordsContainingCursors(): void;
|
874 |
|
875 | /**
|
876 | * For each selection, move its cursor to the preceding subword boundary while
|
877 | * maintaining the selection's tail position.
|
878 | * This method may merge selections that end up intersecting.
|
879 | */
|
880 | selectToPreviousSubwordBoundary(): void;
|
881 |
|
882 | /**
|
883 | * For each selection, move its cursor to the next subword boundary while maintaining
|
884 | * the selection's tail position.
|
885 | * This method may merge selections that end up intersecting.
|
886 | */
|
887 | selectToNextSubwordBoundary(): void;
|
888 |
|
889 | /**
|
890 | * For each selection, move its cursor to the preceding word boundary while
|
891 | * maintaining the selection's tail position.
|
892 | * This method may merge selections that end up intersecting.
|
893 | */
|
894 | selectToPreviousWordBoundary(): void;
|
895 |
|
896 | /**
|
897 | * For each selection, move its cursor to the next word boundary while maintaining
|
898 | * the selection's tail position.
|
899 | * This method may merge selections that end up intersecting.
|
900 | */
|
901 | selectToNextWordBoundary(): void;
|
902 |
|
903 | /**
|
904 | * Expand selections to the beginning of the next word.
|
905 | * Operates on all selections. Moves the cursor to the beginning of the next word
|
906 | * while preserving the selection's tail position.
|
907 | */
|
908 | selectToBeginningOfNextWord(): void;
|
909 |
|
910 | /**
|
911 | * Expand selections to the beginning of the next paragraph.
|
912 | * Operates on all selections. Moves the cursor to the beginning of the next
|
913 | * paragraph while preserving the selection's tail position.
|
914 | */
|
915 | selectToBeginningOfNextParagraph(): void;
|
916 |
|
917 | /**
|
918 | * Expand selections to the beginning of the next paragraph.
|
919 | * Operates on all selections. Moves the cursor to the beginning of the next
|
920 | * paragraph while preserving the selection's tail position.
|
921 | */
|
922 | selectToBeginningOfPreviousParagraph(): void;
|
923 |
|
924 | /** For each selection, select the syntax node that contains that selection. */
|
925 | selectLargerSyntaxNode(): void;
|
926 |
|
927 | /** Undo the effect a preceding call to `::selectLargerSyntaxNode`. */
|
928 | selectSmallerSyntaxNode(): void;
|
929 |
|
930 | /** Select the range of the given marker if it is valid. */
|
931 | selectMarker(marker: DisplayMarker): Range | undefined;
|
932 |
|
933 | /** Get the most recently added Selection. */
|
934 | getLastSelection(): Selection;
|
935 |
|
936 | /** Get current Selections. */
|
937 | getSelections(): Selection[];
|
938 |
|
939 | /**
|
940 | * Get all Selections, ordered by their position in the buffer instead of the
|
941 | * order in which they were added.
|
942 | */
|
943 | getSelectionsOrderedByBufferPosition(): Selection[];
|
944 |
|
945 | // NOTE: this calls into Selection::intersectsBufferRange, which itself calls
|
946 | // into Range::intersectsWith. Range::intersectsWith is one of the few functions
|
947 | // which does NOT take a range-compatible array.
|
948 | /** Determine if a given range in buffer coordinates intersects a selection. */
|
949 | selectionIntersectsBufferRange(bufferRange: RangeLike): boolean;
|
950 |
|
951 | // Searching and Replacing
|
952 | /**
|
953 | * Scan regular expression matches in the entire buffer, calling the given
|
954 | * iterator function on each match.
|
955 | *
|
956 | * ::scan functions as the replace method as well via the replace.
|
957 | */
|
958 | scan(regex: RegExp, options: ScanContextOptions, iterator: (params: ContextualBufferScanResult) => void): void;
|
959 | /**
|
960 | * Scan regular expression matches in the entire buffer, calling the given
|
961 | * iterator function on each match.
|
962 | *
|
963 | * ::scan functions as the replace method as well via the replace.
|
964 | */
|
965 | scan(regex: RegExp, iterator: (params: BufferScanResult) => void): void;
|
966 |
|
967 | /**
|
968 | * Scan regular expression matches in a given range, calling the given iterator.
|
969 | * function on each match.
|
970 | */
|
971 | scanInBufferRange(regex: RegExp, range: RangeCompatible, iterator: (params: BufferScanResult) => void): void;
|
972 |
|
973 | /**
|
974 | * Scan regular expression matches in a given range in reverse order, calling the
|
975 | * given iterator function on each match.
|
976 | */
|
977 | backwardsScanInBufferRange(
|
978 | regex: RegExp,
|
979 | range: RangeCompatible,
|
980 | iterator: (params: BufferScanResult) => void,
|
981 | ): void;
|
982 |
|
983 | // Tab Behavior
|
984 | /** Returns a boolean indicating whether softTabs are enabled for this editor. */
|
985 | getSoftTabs(): boolean;
|
986 |
|
987 | /** Enable or disable soft tabs for this editor. */
|
988 | setSoftTabs(softTabs: boolean): void;
|
989 |
|
990 | /** Toggle soft tabs for this editor. */
|
991 | toggleSoftTabs(): boolean;
|
992 |
|
993 | /** Get the on-screen length of tab characters. */
|
994 | getTabLength(): number;
|
995 |
|
996 | /**
|
997 | * Set the on-screen length of tab characters. Setting this to a number will
|
998 | * override the editor.tabLength setting.
|
999 | */
|
1000 | setTabLength(tabLength: number): void;
|
1001 |
|
1002 | /** Determine if the buffer uses hard or soft tabs. */
|
1003 | usesSoftTabs(): boolean | undefined;
|
1004 |
|
1005 | /**
|
1006 | * Get the text representing a single level of indent.
|
1007 | * If soft tabs are enabled, the text is composed of N spaces, where N is the
|
1008 | * tab length. Otherwise the text is a tab character (\t).
|
1009 | */
|
1010 | getTabText(): string;
|
1011 |
|
1012 | // Soft Wrap Behavior
|
1013 | /** Determine whether lines in this editor are soft-wrapped. */
|
1014 | isSoftWrapped(): boolean;
|
1015 |
|
1016 | /** Enable or disable soft wrapping for this editor. */
|
1017 | setSoftWrapped(softWrapped: boolean): boolean;
|
1018 |
|
1019 | /** Toggle soft wrapping for this editor. */
|
1020 | toggleSoftWrapped(): boolean;
|
1021 |
|
1022 | /** Gets the column at which column will soft wrap. */
|
1023 | getSoftWrapColumn(): number;
|
1024 |
|
1025 | // Indentation
|
1026 | /**
|
1027 | * Get the indentation level of the given buffer row.
|
1028 | * Determines how deeply the given row is indented based on the soft tabs and tab
|
1029 | * length settings of this editor. Note that if soft tabs are enabled and the tab
|
1030 | * length is 2, a row with 4 leading spaces would have an indentation level of 2.
|
1031 | */
|
1032 | indentationForBufferRow(bufferRow: number): number;
|
1033 |
|
1034 | /**
|
1035 | * Set the indentation level for the given buffer row.
|
1036 | * Inserts or removes hard tabs or spaces based on the soft tabs and tab length settings
|
1037 | * of this editor in order to bring it to the given indentation level. Note that if soft
|
1038 | * tabs are enabled and the tab length is 2, a row with 4 leading spaces would have an
|
1039 | * indentation level of 2.
|
1040 | */
|
1041 | setIndentationForBufferRow(
|
1042 | bufferRow: number,
|
1043 | newLevel: number,
|
1044 | options?: { preserveLeadingWhitespace?: boolean | undefined },
|
1045 | ): void;
|
1046 |
|
1047 | /** Indent rows intersecting selections by one level. */
|
1048 | indentSelectedRows(options?: ReadonlyEditOptions): void;
|
1049 |
|
1050 | /** Outdent rows intersecting selections by one level. */
|
1051 | outdentSelectedRows(options?: ReadonlyEditOptions): void;
|
1052 |
|
1053 | /**
|
1054 | * Get the indentation level of the given line of text.
|
1055 | * Determines how deeply the given line is indented based on the soft tabs and tab length
|
1056 | * settings of this editor. Note that if soft tabs are enabled and the tab length is 2,
|
1057 | * a row with 4 leading spaces would have an indentation level of 2.
|
1058 | */
|
1059 | indentLevelForLine(line: string): number;
|
1060 |
|
1061 | /** Indent rows intersecting selections based on the grammar's suggested indent level. */
|
1062 | autoIndentSelectedRows(options?: ReadonlyEditOptions): void;
|
1063 |
|
1064 | // Grammars
|
1065 | /** Get the current Grammar of this editor. */
|
1066 | getGrammar(): Grammar;
|
1067 |
|
1068 | // Managing Syntax Scopes
|
1069 | /**
|
1070 | * Returns a ScopeDescriptor that includes this editor's language.
|
1071 | * e.g. [".source.ruby"], or [".source.coffee"].
|
1072 | */
|
1073 | getRootScopeDescriptor(): ScopeDescriptor;
|
1074 |
|
1075 | /** Get the syntactic scopeDescriptor for the given position in buffer coordinates. */
|
1076 | scopeDescriptorForBufferPosition(bufferPosition: PointCompatible): ScopeDescriptor;
|
1077 |
|
1078 | /**
|
1079 | * Get the syntactic tree {ScopeDescriptor} for the given position in buffer
|
1080 | * coordinates or the syntactic {ScopeDescriptor} for TextMate language mode
|
1081 | */
|
1082 | syntaxTreeScopeDescriptorForBufferPosition(bufferPosition: PointCompatible): ScopeDescriptor;
|
1083 |
|
1084 | |
1085 |
|
1086 |
|
1087 |
|
1088 | bufferRangeForScopeAtCursor(scopeSelector: string): Range;
|
1089 |
|
1090 |
|
1091 | isBufferRowCommented(bufferRow: number): boolean;
|
1092 |
|
1093 |
|
1094 |
|
1095 | copySelectedText(): void;
|
1096 |
|
1097 |
|
1098 | cutSelectedText(options?: ReadonlyEditOptions): void;
|
1099 |
|
1100 | |
1101 |
|
1102 |
|
1103 |
|
1104 |
|
1105 |
|
1106 | pasteText(options?: TextInsertionOptions & ReadonlyEditOptions): void;
|
1107 |
|
1108 | |
1109 |
|
1110 |
|
1111 |
|
1112 | cutToEndOfLine(options?: ReadonlyEditOptions): void;
|
1113 |
|
1114 | |
1115 |
|
1116 |
|
1117 |
|
1118 | cutToEndOfBufferLine(options?: ReadonlyEditOptions): void;
|
1119 |
|
1120 |
|
1121 | |
1122 |
|
1123 |
|
1124 |
|
1125 |
|
1126 | foldCurrentRow(): void;
|
1127 |
|
1128 |
|
1129 | unfoldCurrentRow(): void;
|
1130 |
|
1131 | |
1132 |
|
1133 |
|
1134 |
|
1135 |
|
1136 | foldBufferRow(bufferRow: number): void;
|
1137 |
|
1138 |
|
1139 | unfoldBufferRow(bufferRow: number): void;
|
1140 |
|
1141 |
|
1142 | foldSelectedLines(): void;
|
1143 |
|
1144 |
|
1145 | foldAll(): void;
|
1146 |
|
1147 |
|
1148 | unfoldAll(): void;
|
1149 |
|
1150 | |
1151 |
|
1152 |
|
1153 |
|
1154 | foldAllAtIndentLevel(level: number): void;
|
1155 |
|
1156 | |
1157 |
|
1158 |
|
1159 |
|
1160 | isFoldableAtBufferRow(bufferRow: number): boolean;
|
1161 |
|
1162 | |
1163 |
|
1164 |
|
1165 |
|
1166 | isFoldableAtScreenRow(bufferRow: number): boolean;
|
1167 |
|
1168 |
|
1169 | toggleFoldAtBufferRow(bufferRow: number): void;
|
1170 |
|
1171 |
|
1172 | isFoldedAtCursorRow(): boolean;
|
1173 |
|
1174 |
|
1175 | isFoldedAtBufferRow(bufferRow: number): boolean;
|
1176 |
|
1177 |
|
1178 | isFoldedAtScreenRow(screenRow: number): boolean;
|
1179 |
|
1180 |
|
1181 |
|
1182 | addGutter(options: GutterOptions): Gutter;
|
1183 |
|
1184 |
|
1185 | getGutters(): Gutter[];
|
1186 |
|
1187 |
|
1188 | gutterWithName(name: string): Gutter | null;
|
1189 |
|
1190 |
|
1191 |
|
1192 | scrollToCursorPosition(options?: { center?: boolean | undefined }): void;
|
1193 |
|
1194 |
|
1195 | scrollToBufferPosition(bufferPosition: PointCompatible, options?: { center?: boolean | undefined }): void;
|
1196 |
|
1197 |
|
1198 | scrollToScreenPosition(screenPosition: PointCompatible, options?: { center?: boolean | undefined }): void;
|
1199 |
|
1200 |
|
1201 |
|
1202 | getLineHeightInPixels(): number;
|
1203 |
|
1204 |
|
1205 | getPlaceholderText(): string;
|
1206 |
|
1207 | |
1208 |
|
1209 |
|
1210 |
|
1211 | setPlaceholderText(placeholderText: string): void;
|
1212 |
|
1213 |
|
1214 | bufferRangeForScopeAtPosition(scope: string, point: PointCompatible): Range;
|
1215 |
|
1216 |
|
1217 | tokenForBufferPosition(pos: PointCompatible): { value: string; scopes: string[] };
|
1218 | }
|