@theia/plugin 1.30.0-next.3 → 1.30.0-next.30

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 (2) hide show
  1. package/package.json +2 -2
  2. package/src/theia.d.ts +73 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.30.0-next.3+9e5db775675",
3
+ "version": "1.30.0-next.30+559c6cafd",
4
4
  "description": "Theia - Plugin API",
5
5
  "types": "./src/theia.d.ts",
6
6
  "publishConfig": {
@@ -32,5 +32,5 @@
32
32
  "nyc": {
33
33
  "extends": "../../configs/nyc.json"
34
34
  },
35
- "gitHead": "9e5db7756755fe2cc4155f59fda27f32b3d5bbe4"
35
+ "gitHead": "559c6cafd2f8242a784e1b0077d9f6c6f79c2152"
36
36
  }
package/src/theia.d.ts CHANGED
@@ -227,7 +227,12 @@ export module '@theia/plugin' {
227
227
  }
228
228
 
229
229
  /**
230
- * Represents a line and character position.
230
+ * Represents a line and character position, such as
231
+ * the position of the cursor.
232
+ *
233
+ * Position objects are __immutable__. Use the {@link Position.with with} or
234
+ * {@link Position.translate translate} methods to derive new positions
235
+ * from an existing position.
231
236
  */
232
237
  export class Position {
233
238
 
@@ -241,6 +246,10 @@ export module '@theia/plugin' {
241
246
  */
242
247
  readonly character: number;
243
248
 
249
+ /**
250
+ * @param line A zero-based line value.
251
+ * @param character A zero-based character value.
252
+ */
244
253
  constructor(line: number, character: number);
245
254
 
246
255
  /**
@@ -315,7 +324,7 @@ export module '@theia/plugin' {
315
324
  * @return A position that reflects the given delta. Will return `this` position if the change
316
325
  * is not changing anything.
317
326
  */
318
- translate(change: { lineDelta?: number; characterDelta?: number; }): Position;
327
+ translate(change: { lineDelta?: number; characterDelta?: number }): Position;
319
328
 
320
329
  /**
321
330
  * Create a new position derived from this position.
@@ -333,7 +342,7 @@ export module '@theia/plugin' {
333
342
  * @return A position that reflects the given change. Will return `this` position if the change
334
343
  * is not changing anything.
335
344
  */
336
- with(change: { line?: number; character?: number; }): Position;
345
+ with(change: { line?: number; character?: number }): Position;
337
346
  }
338
347
 
339
348
  /**
@@ -410,15 +419,21 @@ export module '@theia/plugin' {
410
419
  /**
411
420
  * Derived a new range from this range.
412
421
  *
413
- * @param start
414
- * @param end
422
+ * @param start A position that should be used as start. The default value is the {@link Range.start current start}.
423
+ * @param end A position that should be used as end. The default value is the {@link Range.end current end}.
424
+ * @return A range derived from this range with the given start and end position.
425
+ * If start and end are not different `this` range will be returned.
415
426
  */
416
427
  with(start?: Position, end?: Position): Range;
417
428
 
418
429
  /**
419
430
  * Derived a new range from this range.
431
+ *
432
+ * @param change An object that describes a change to this range.
433
+ * @return A range that reflects the given change. Will return `this` range if the change
434
+ * is not changing anything.
420
435
  */
421
- with(change: { start?: Position, end?: Position }): Range;
436
+ with(change: { start?: Position; end?: Position }): Range;
422
437
  }
423
438
 
424
439
  /**
@@ -2074,7 +2089,7 @@ export module '@theia/plugin' {
2074
2089
  * Fire the event and pass data object
2075
2090
  * @param data
2076
2091
  */
2077
- fire(data?: T): void;
2092
+ fire(data: T): void;
2078
2093
 
2079
2094
  /**
2080
2095
  * Dispose this object
@@ -2782,6 +2797,16 @@ export module '@theia/plugin' {
2782
2797
  */
2783
2798
  clear(): void;
2784
2799
 
2800
+ /**
2801
+ * Reveal this channel in the UI.
2802
+ *
2803
+ * @deprecated Use the overload with just one parameter (`show(preserveFocus?: boolean): void`).
2804
+ *
2805
+ * @param column This argument is **deprecated** and will be ignored.
2806
+ * @param preserveFocus When `true` the channel will not take focus.
2807
+ */
2808
+ show(column?: ViewColumn, preserveFocus?: boolean): void;
2809
+
2785
2810
  /**
2786
2811
  * Reveal this channel in the UI.
2787
2812
  *
@@ -2987,6 +3012,15 @@ export module '@theia/plugin' {
2987
3012
  */
2988
3013
  env?: { [key: string]: string | null };
2989
3014
 
3015
+ /**
3016
+ * Whether the terminal process environment should be exactly as provided in
3017
+ * `TerminalOptions.env`. When this is false (default), the environment will be based on the
3018
+ * window's environment and also apply configured platform settings like
3019
+ * `terminal.integrated.windows.env` on top. When this is true, the complete environment
3020
+ * must be provided as nothing will be inherited from the process or any configuration.
3021
+ */
3022
+ strictEnv?: boolean;
3023
+
2990
3024
  /**
2991
3025
  * A message to write to the terminal on first launch. Note that this is not sent to the
2992
3026
  * process, but rather written directly to the terminal. This supports escape sequences such
@@ -3081,6 +3115,26 @@ export module '@theia/plugin' {
3081
3115
  */
3082
3116
  onDidClose?: Event<void | number>;
3083
3117
 
3118
+ /**
3119
+ * An event that when fired allows changing the name of the terminal.
3120
+ *
3121
+ * Events fired before {@link Pseudoterminal.open} is called will be be ignored.
3122
+ *
3123
+ * **Example:** Change the terminal name to "My new terminal".
3124
+ * ```typescript
3125
+ * const writeEmitter = new vscode.EventEmitter<string>();
3126
+ * const changeNameEmitter = new vscode.EventEmitter<string>();
3127
+ * const pty: vscode.Pseudoterminal = {
3128
+ * onDidWrite: writeEmitter.event,
3129
+ * onDidChangeName: changeNameEmitter.event,
3130
+ * open: () => changeNameEmitter.fire('My new terminal'),
3131
+ * close: () => {}
3132
+ * };
3133
+ * vscode.window.createTerminal({ name: 'My terminal', pty });
3134
+ * ```
3135
+ */
3136
+ onDidChangeName?: Event<string>;
3137
+
3084
3138
  /**
3085
3139
  * Implement to handle when the pty is opened.
3086
3140
  *
@@ -4337,7 +4391,7 @@ export module '@theia/plugin' {
4337
4391
  *
4338
4392
  * Note that hiding a view using the context menu instead disposes of the view and fires `onDidDispose`.
4339
4393
  */
4340
- readonly onDidChangeVisibility: Event<boolean>;
4394
+ readonly onDidChangeVisibility: Event<void>;
4341
4395
 
4342
4396
  /**
4343
4397
  * Reveal the view in the UI.
@@ -4575,7 +4629,7 @@ export module '@theia/plugin' {
4575
4629
  * @param items A set of items that will be rendered as actions in the message.
4576
4630
  * @return A promise that resolves to the selected item or `undefined` when being dismissed.
4577
4631
  */
4578
- export function showInformationMessage(message: string, ...items: string[]): Thenable<string | undefined>;
4632
+ export function showInformationMessage<T extends string>(message: string, ...items: T[]): Thenable<T | undefined>;
4579
4633
 
4580
4634
  /**
4581
4635
  * Show an information message.
@@ -4585,7 +4639,7 @@ export module '@theia/plugin' {
4585
4639
  * @param items A set of items that will be rendered as actions in the message.
4586
4640
  * @return A promise that resolves to the selected item or `undefined` when being dismissed.
4587
4641
  */
4588
- export function showInformationMessage(message: string, options: MessageOptions, ...items: string[]): Thenable<string | undefined>;
4642
+ export function showInformationMessage<T extends string>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>;
4589
4643
 
4590
4644
  /**
4591
4645
  * Show an information message.
@@ -4613,7 +4667,7 @@ export module '@theia/plugin' {
4613
4667
  * @param items A set of items that will be rendered as actions in the message.
4614
4668
  * @return A promise that resolves to the selected item or `undefined` when being dismissed.
4615
4669
  */
4616
- export function showWarningMessage(message: string, ...items: string[]): Thenable<string | undefined>;
4670
+ export function showWarningMessage<T extends string>(message: string, ...items: T[]): Thenable<T | undefined>;
4617
4671
 
4618
4672
  /**
4619
4673
  * Show a warning message.
@@ -4623,7 +4677,7 @@ export module '@theia/plugin' {
4623
4677
  * @param items A set of items that will be rendered as actions in the message.
4624
4678
  * @return A promise that resolves to the selected item or `undefined` when being dismissed.
4625
4679
  */
4626
- export function showWarningMessage(message: string, options: MessageOptions, ...items: string[]): Thenable<string | undefined>;
4680
+ export function showWarningMessage<T extends string>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>;
4627
4681
 
4628
4682
  /**
4629
4683
  * Show a warning message.
@@ -4651,7 +4705,7 @@ export module '@theia/plugin' {
4651
4705
  * @param items A set of items that will be rendered as actions in the message.
4652
4706
  * @return A promise that resolves to the selected item or `undefined` when being dismissed.
4653
4707
  */
4654
- export function showErrorMessage(message: string, ...items: string[]): Thenable<string | undefined>;
4708
+ export function showErrorMessage<T extends string>(message: string, ...items: T[]): Thenable<T | undefined>;
4655
4709
 
4656
4710
  /**
4657
4711
  * Show an error message.
@@ -4661,7 +4715,7 @@ export module '@theia/plugin' {
4661
4715
  * @param items A set of items that will be rendered as actions in the message.
4662
4716
  * @return A promise that resolves to the selected item or `undefined` when being dismissed.
4663
4717
  */
4664
- export function showErrorMessage(message: string, options: MessageOptions, ...items: string[]): Thenable<string | undefined>;
4718
+ export function showErrorMessage<T extends string>(message: string, options: MessageOptions, ...items: T[]): Thenable<T | undefined>;
4665
4719
 
4666
4720
  /**
4667
4721
  * Show an error message.
@@ -5402,7 +5456,7 @@ export module '@theia/plugin' {
5402
5456
  * This will trigger the view to update the changed element/root and its children recursively (if shown).
5403
5457
  * To signal that root has changed, do not pass any argument or pass `undefined` or `null`.
5404
5458
  */
5405
- onDidChangeTreeData?: Event<T | undefined | null>;
5459
+ onDidChangeTreeData?: Event<T | T[] | undefined | null | void>;
5406
5460
 
5407
5461
  /**
5408
5462
  * Get {@link TreeItem TreeItem} representation of the `element`
@@ -5469,7 +5523,7 @@ export module '@theia/plugin' {
5469
5523
  /**
5470
5524
  * The tooltip text when you hover over this item.
5471
5525
  */
5472
- tooltip?: string | undefined;
5526
+ tooltip?: string | MarkdownString | undefined;
5473
5527
 
5474
5528
  /**
5475
5529
  * The {@link Command command} which should be run when the tree item is selected.
@@ -8324,7 +8378,7 @@ export module '@theia/plugin' {
8324
8378
  * @return An array of commands, quick fixes, or refactorings or a thenable of such. The lack of a result can be
8325
8379
  * signaled by returning `undefined`, `null`, or an empty array.
8326
8380
  */
8327
- provideCodeActions(document: TextDocument, range: Range | Selection, context: CodeActionContext, token: CancellationToken | undefined): ProviderResult<(Command | T)[]>;
8381
+ provideCodeActions(document: TextDocument, range: Range | Selection, context: CodeActionContext, token: CancellationToken): ProviderResult<(Command | T)[]>;
8328
8382
 
8329
8383
  /**
8330
8384
  * Given a code action fill in its `edit`-property. Changes to
@@ -8340,7 +8394,7 @@ export module '@theia/plugin' {
8340
8394
  * @return The resolved code action or a thenable that resolves to such. It is OK to return the given
8341
8395
  * `item`. When no result is returned, the given `item` will be used.
8342
8396
  */
8343
- resolveCodeAction?(codeAction: T, token: CancellationToken | undefined): ProviderResult<T>;
8397
+ resolveCodeAction?(codeAction: T, token: CancellationToken): ProviderResult<T>;
8344
8398
  }
8345
8399
 
8346
8400
  /**
@@ -8938,7 +8992,7 @@ export module '@theia/plugin' {
8938
8992
  * @param tokenType The token type.
8939
8993
  * @param tokenModifiers The token modifiers.
8940
8994
  */
8941
- push(range: Range, tokenType: string, tokenModifiers?: string[]): void;
8995
+ push(range: Range, tokenType: string, tokenModifiers?: readonly string[]): void;
8942
8996
 
8943
8997
  /**
8944
8998
  * Finish and create a `SemanticTokens` instance.