@theia/plugin 1.29.0-next.4 → 1.29.0-next.9

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 +74 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.29.0-next.4+0c0f8c7a7ae",
3
+ "version": "1.29.0-next.9+7b29ac6f2d1",
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": "0c0f8c7a7aedd67930bf65d6f63d827721707d60"
35
+ "gitHead": "7b29ac6f2d1a75b44b5c5d37ec7ae0200e0c3e99"
36
36
  }
package/src/theia.d.ts CHANGED
@@ -3469,6 +3469,13 @@ export module '@theia/plugin' {
3469
3469
  */
3470
3470
  export interface Memento {
3471
3471
 
3472
+ /**
3473
+ * Returns the stored keys.
3474
+ *
3475
+ * @return The stored keys.
3476
+ */
3477
+ keys(): readonly string[];
3478
+
3472
3479
  /**
3473
3480
  * Return a value.
3474
3481
  *
@@ -5640,12 +5647,14 @@ export module '@theia/plugin' {
5640
5647
  * Returns `true` if the given section for the given resource (if provided) is affected.
5641
5648
  *
5642
5649
  * @param section Configuration name, supports _dotted_ names.
5643
- * @param resource A resource Uri.
5650
+ * @param scope a {@link ConfigurationScope}
5644
5651
  * @return `true` if the given section for the given resource (if provided) is affected.
5645
5652
  */
5646
- affectsConfiguration(section: string, resource?: Uri): boolean;
5653
+ affectsConfiguration(section: string, scope?: ConfigurationScope): boolean;
5647
5654
  }
5648
5655
 
5656
+ export type ConfigurationScope = Uri | WorkspaceFolder | TextDocument | { uri?: Uri, languageId: string };
5657
+
5649
5658
  /**
5650
5659
  * An event describing a change to the set of [workspace folders](#workspace.workspaceFolders).
5651
5660
  */
@@ -6300,13 +6309,13 @@ export module '@theia/plugin' {
6300
6309
  * is returned. Dots in the section-identifier are interpreted as child-access,
6301
6310
  * like `{ myExt: { setting: { doIt: true }}}` and `getConfiguration('myExt.setting').get('doIt') === true`.
6302
6311
  *
6303
- * When a resource is provided, configuration scoped to that resource is returned.
6312
+ * When a scope is provided configuration confined to that scope is returned. Scope can be a resource or a language identifier or both.
6304
6313
  *
6305
6314
  * @param section A dot-separated identifier.
6306
- * @param resource A resource for which the configuration is asked for
6315
+ * @param scope A scope for which the configuration is asked for.
6307
6316
  * @return The full configuration or a subset.
6308
6317
  */
6309
- export function getConfiguration(section?: string, resource?: Uri | null): WorkspaceConfiguration;
6318
+ export function getConfiguration(section?: string, scope?: ConfigurationScope | null): WorkspaceConfiguration;
6310
6319
 
6311
6320
  /**
6312
6321
  * An event that is emitted when the [configuration](#WorkspaceConfiguration) changed.
@@ -9267,6 +9276,18 @@ export module '@theia/plugin' {
9267
9276
  */
9268
9277
  export function registerHoverProvider(selector: DocumentSelector, provider: HoverProvider): Disposable;
9269
9278
 
9279
+ /**
9280
+ * Register a provider that locates evaluatable expressions in text documents.
9281
+ * The editor will evaluate the expression in the active debug session and will show the result in the debug hover.
9282
+ *
9283
+ * If multiple providers are registered for a language an arbitrary provider will be used.
9284
+ *
9285
+ * @param selector A selector that defines the documents this provider is applicable to.
9286
+ * @param provider An evaluatable expression provider.
9287
+ * @return A {@link Disposable} that unregisters this provider when being disposed.
9288
+ */
9289
+ export function registerEvaluatableExpressionProvider(selector: DocumentSelector, provider: EvaluatableExpressionProvider): Disposable;
9290
+
9270
9291
  /**
9271
9292
  * Register a workspace symbol provider.
9272
9293
  *
@@ -9580,6 +9601,54 @@ export module '@theia/plugin' {
9580
9601
  provideHover(document: TextDocument, position: Position, token: CancellationToken | undefined): ProviderResult<Hover>;
9581
9602
  }
9582
9603
 
9604
+ /**
9605
+ * An EvaluatableExpression represents an expression in a document that can be evaluated by an active debugger or runtime.
9606
+ * The result of this evaluation is shown in a tooltip-like widget.
9607
+ * If only a range is specified, the expression will be extracted from the underlying document.
9608
+ * An optional expression can be used to override the extracted expression.
9609
+ * In this case the range is still used to highlight the range in the document.
9610
+ */
9611
+ export class EvaluatableExpression {
9612
+
9613
+ /*
9614
+ * The range is used to extract the evaluatable expression from the underlying document and to highlight it.
9615
+ */
9616
+ readonly range: Range;
9617
+
9618
+ /*
9619
+ * If specified the expression overrides the extracted expression.
9620
+ */
9621
+ readonly expression?: string | undefined;
9622
+
9623
+ /**
9624
+ * Creates a new evaluatable expression object.
9625
+ *
9626
+ * @param range The range in the underlying document from which the evaluatable expression is extracted.
9627
+ * @param expression If specified overrides the extracted expression.
9628
+ */
9629
+ constructor(range: Range, expression?: string);
9630
+ }
9631
+
9632
+ /**
9633
+ * The evaluatable expression provider interface defines the contract between extensions and
9634
+ * the debug hover. In this contract the provider returns an evaluatable expression for a given position
9635
+ * in a document and the editor evaluates this expression in the active debug session and shows the result in a debug hover.
9636
+ */
9637
+ export interface EvaluatableExpressionProvider {
9638
+ /**
9639
+ * Provide an evaluatable expression for the given document and position.
9640
+ * The editor will evaluate this expression in the active debug session and will show the result in the debug hover.
9641
+ * The expression can be implicitly specified by the range in the underlying document or by explicitly returning an expression.
9642
+ *
9643
+ * @param document The document for which the debug hover is about to appear.
9644
+ * @param position The line and character position in the document where the debug hover is about to appear.
9645
+ * @param token A cancellation token.
9646
+ * @return An EvaluatableExpression or a thenable that resolves to such. The lack of a result can be
9647
+ * signaled by returning `undefined` or `null`.
9648
+ */
9649
+ provideEvaluatableExpression(document: TextDocument, position: Position, token: CancellationToken | undefined): ProviderResult<EvaluatableExpression>;
9650
+ }
9651
+
9583
9652
  /**
9584
9653
  * A document highlight kind.
9585
9654
  */