@theia/plugin 1.31.0-next.13 → 1.31.0-next.15

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 +157 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.31.0-next.13+c0da67fa8",
3
+ "version": "1.31.0-next.15+cac96ae94",
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": "c0da67fa862e7a042687378b902667861c6eafb1"
35
+ "gitHead": "cac96ae946d2e70a701a1779d53ade185db7a343"
36
36
  }
package/src/theia.d.ts CHANGED
@@ -3274,7 +3274,7 @@ export module '@theia/plugin' {
3274
3274
  /**
3275
3275
  * A link on a terminal line.
3276
3276
  */
3277
- export interface TerminalLink {
3277
+ export class TerminalLink {
3278
3278
  /**
3279
3279
  * The start index of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
3280
3280
  */
@@ -3293,6 +3293,18 @@ export module '@theia/plugin' {
3293
3293
  * depending on OS, user settings, and localization.
3294
3294
  */
3295
3295
  tooltip?: string;
3296
+
3297
+ /**
3298
+ * Creates a new terminal link.
3299
+ * @param startIndex The start index of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
3300
+ * @param length The length of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
3301
+ * @param tooltip The tooltip text when you hover over this link.
3302
+ *
3303
+ * If a tooltip is provided, is will be displayed in a string that includes instructions on
3304
+ * how to trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary
3305
+ * depending on OS, user settings, and localization.
3306
+ */
3307
+ constructor(startIndex: number, length: number, tooltip?: string);
3296
3308
  }
3297
3309
 
3298
3310
  /**
@@ -5124,7 +5136,7 @@ export module '@theia/plugin' {
5124
5136
  * @param provider The provider that provides the terminal links.
5125
5137
  * @return Disposable that unregisters the provider.
5126
5138
  */
5127
- export function registerTerminalLinkProvider(provider: TerminalLinkProvider): void;
5139
+ export function registerTerminalLinkProvider(provider: TerminalLinkProvider): Disposable;
5128
5140
 
5129
5141
  /**
5130
5142
  * Register a file decoration provider.
@@ -9506,6 +9518,21 @@ export module '@theia/plugin' {
9506
9518
  */
9507
9519
  export function registerEvaluatableExpressionProvider(selector: DocumentSelector, provider: EvaluatableExpressionProvider): Disposable;
9508
9520
 
9521
+ /**
9522
+ * Register a provider that returns data for the debugger's 'inline value' feature.
9523
+ * Whenever the generic debugger has stopped in a source file, providers registered for the language of the file
9524
+ * are called to return textual data that will be shown in the editor at the end of lines.
9525
+ *
9526
+ * Multiple providers can be registered for a language. In that case providers are asked in
9527
+ * parallel and the results are merged. A failing provider (rejected promise or exception) will
9528
+ * not cause a failure of the whole operation.
9529
+ *
9530
+ * @param selector A selector that defines the documents this provider is applicable to.
9531
+ * @param provider An inline values provider.
9532
+ * @return A {@link Disposable} that unregisters this provider when being disposed.
9533
+ */
9534
+ export function registerInlineValuesProvider(selector: DocumentSelector, provider: InlineValuesProvider): Disposable;
9535
+
9509
9536
  /**
9510
9537
  * Register a workspace symbol provider.
9511
9538
  *
@@ -9867,6 +9894,134 @@ export module '@theia/plugin' {
9867
9894
  provideEvaluatableExpression(document: TextDocument, position: Position, token: CancellationToken | undefined): ProviderResult<EvaluatableExpression>;
9868
9895
  }
9869
9896
 
9897
+ /**
9898
+ * Provide inline value as text.
9899
+ */
9900
+ export class InlineValueText {
9901
+ /**
9902
+ * The document range for which the inline value applies.
9903
+ */
9904
+ readonly range: Range;
9905
+ /**
9906
+ * The text of the inline value.
9907
+ */
9908
+ readonly text: string;
9909
+ /**
9910
+ * Creates a new InlineValueText object.
9911
+ *
9912
+ * @param range The document line where to show the inline value.
9913
+ * @param text The value to be shown for the line.
9914
+ */
9915
+ constructor(range: Range, text: string);
9916
+ }
9917
+
9918
+ /**
9919
+ * Provide inline value through a variable lookup.
9920
+ * If only a range is specified, the variable name will be extracted from the underlying document.
9921
+ * An optional variable name can be used to override the extracted name.
9922
+ */
9923
+ export class InlineValueVariableLookup {
9924
+ /**
9925
+ * The document range for which the inline value applies.
9926
+ * The range is used to extract the variable name from the underlying document.
9927
+ */
9928
+ readonly range: Range;
9929
+ /**
9930
+ * If specified the name of the variable to look up.
9931
+ */
9932
+ readonly variableName?: string | undefined;
9933
+ /**
9934
+ * How to perform the lookup.
9935
+ */
9936
+ readonly caseSensitiveLookup: boolean;
9937
+ /**
9938
+ * Creates a new InlineValueVariableLookup object.
9939
+ *
9940
+ * @param range The document line where to show the inline value.
9941
+ * @param variableName The name of the variable to look up.
9942
+ * @param caseSensitiveLookup How to perform the lookup. If missing lookup is case sensitive.
9943
+ */
9944
+ constructor(range: Range, variableName?: string, caseSensitiveLookup?: boolean);
9945
+ }
9946
+
9947
+ /**
9948
+ * Provide an inline value through an expression evaluation.
9949
+ * If only a range is specified, the expression will be extracted from the underlying document.
9950
+ * An optional expression can be used to override the extracted expression.
9951
+ */
9952
+ export class InlineValueEvaluatableExpression {
9953
+ /**
9954
+ * The document range for which the inline value applies.
9955
+ * The range is used to extract the evaluatable expression from the underlying document.
9956
+ */
9957
+ readonly range: Range;
9958
+ /**
9959
+ * If specified the expression overrides the extracted expression.
9960
+ */
9961
+ readonly expression?: string | undefined;
9962
+ /**
9963
+ * Creates a new InlineValueEvaluatableExpression object.
9964
+ *
9965
+ * @param range The range in the underlying document from which the evaluatable expression is extracted.
9966
+ * @param expression If specified overrides the extracted expression.
9967
+ */
9968
+ constructor(range: Range, expression?: string);
9969
+ }
9970
+
9971
+ /**
9972
+ * Inline value information can be provided by different means:
9973
+ * - directly as a text value (class InlineValueText).
9974
+ * - as a name to use for a variable lookup (class InlineValueVariableLookup)
9975
+ * - as an evaluatable expression (class InlineValueEvaluatableExpression)
9976
+ * The InlineValue types combines all inline value types into one type.
9977
+ */
9978
+ export type InlineValue = InlineValueText | InlineValueVariableLookup | InlineValueEvaluatableExpression;
9979
+
9980
+ /**
9981
+ * A value-object that contains contextual information when requesting inline values from a InlineValuesProvider.
9982
+ */
9983
+ export interface InlineValueContext {
9984
+
9985
+ /**
9986
+ * The stack frame (as a DAP Id) where the execution has stopped.
9987
+ */
9988
+ readonly frameId: number;
9989
+
9990
+ /**
9991
+ * The document range where execution has stopped.
9992
+ * Typically the end position of the range denotes the line where the inline values are shown.
9993
+ */
9994
+ readonly stoppedLocation: Range;
9995
+ }
9996
+
9997
+ /**
9998
+ * The inline values provider interface defines the contract between extensions and the editor's debugger inline values feature.
9999
+ * In this contract the provider returns inline value information for a given document range
10000
+ * and the editor shows this information in the editor at the end of lines.
10001
+ */
10002
+ export interface InlineValuesProvider {
10003
+
10004
+ /**
10005
+ * An optional event to signal that inline values have changed.
10006
+ * @see {@link EventEmitter}
10007
+ */
10008
+ onDidChangeInlineValues?: Event<void> | undefined;
10009
+
10010
+ /**
10011
+ * Provide "inline value" information for a given document and range.
10012
+ * The editor calls this method whenever debugging stops in the given document.
10013
+ * The returned inline values information is rendered in the editor at the end of lines.
10014
+ *
10015
+ * @param document The document for which the inline values information is needed.
10016
+ * @param viewPort The visible document range for which inline values should be computed.
10017
+ * @param context A bag containing contextual information like the current location.
10018
+ * @param token A cancellation token.
10019
+ * @return An array of InlineValueDescriptors or a thenable that resolves to such. The lack of a result can be
10020
+ * signaled by returning `undefined` or `null`.
10021
+ */
10022
+ provideInlineValues(document: TextDocument, viewPort: Range, context: InlineValueContext, token: CancellationToken): ProviderResult<InlineValue[]>;
10023
+ }
10024
+
9870
10025
  /**
9871
10026
  * A document highlight kind.
9872
10027
  */