@theia/plugin 1.31.0-next.19 → 1.31.0-next.29
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.
- package/package.json +2 -2
- package/src/theia.d.ts +206 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/plugin",
|
|
3
|
-
"version": "1.31.0-next.
|
|
3
|
+
"version": "1.31.0-next.29+6ca2cfb56",
|
|
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": "
|
|
35
|
+
"gitHead": "6ca2cfb56125cd93bda95be3ba705aa4c7da62fe"
|
|
36
36
|
}
|
package/src/theia.d.ts
CHANGED
|
@@ -5586,6 +5586,29 @@ export module '@theia/plugin' {
|
|
|
5586
5586
|
* @return Parent of `element`.
|
|
5587
5587
|
*/
|
|
5588
5588
|
getParent?(element: T): ProviderResult<T>;
|
|
5589
|
+
|
|
5590
|
+
/**
|
|
5591
|
+
* Called on hover to resolve the {@link TreeItem.tooltip TreeItem} property if it is undefined.
|
|
5592
|
+
* Called on tree item click/open to resolve the {@link TreeItem.command TreeItem} property if it is undefined.
|
|
5593
|
+
* Only properties that were undefined can be resolved in `resolveTreeItem`.
|
|
5594
|
+
* Functionality may be expanded later to include being called to resolve other missing
|
|
5595
|
+
* properties on selection and/or on open.
|
|
5596
|
+
*
|
|
5597
|
+
* Will only ever be called once per TreeItem.
|
|
5598
|
+
*
|
|
5599
|
+
* onDidChangeTreeData should not be triggered from within resolveTreeItem.
|
|
5600
|
+
*
|
|
5601
|
+
* *Note* that this function is called when tree items are already showing in the UI.
|
|
5602
|
+
* Because of that, no property that changes the presentation (label, description, etc.)
|
|
5603
|
+
* can be changed.
|
|
5604
|
+
*
|
|
5605
|
+
* @param item Undefined properties of `item` should be set then `item` should be returned.
|
|
5606
|
+
* @param element The object associated with the TreeItem.
|
|
5607
|
+
* @param token A cancellation token.
|
|
5608
|
+
* @return The resolved tree item or a thenable that resolves to such. It is OK to return the given
|
|
5609
|
+
* `item`. When no result is returned, the given `item` will be used.
|
|
5610
|
+
*/
|
|
5611
|
+
resolveTreeItem?(item: TreeItem, element: T, token: CancellationToken): ProviderResult<TreeItem>;
|
|
5589
5612
|
}
|
|
5590
5613
|
|
|
5591
5614
|
export class TreeItem {
|
|
@@ -7621,6 +7644,176 @@ export module '@theia/plugin' {
|
|
|
7621
7644
|
provideColorPresentations(color: Color, context: { document: TextDocument, range: Range }, token: CancellationToken): ProviderResult<ColorPresentation[]>;
|
|
7622
7645
|
}
|
|
7623
7646
|
|
|
7647
|
+
/**
|
|
7648
|
+
* Inlay hint kinds.
|
|
7649
|
+
*
|
|
7650
|
+
* The kind of an inline hint defines its appearance, e.g the corresponding foreground and background colors are being
|
|
7651
|
+
* used.
|
|
7652
|
+
*/
|
|
7653
|
+
export enum InlayHintKind {
|
|
7654
|
+
/**
|
|
7655
|
+
* An inlay hint that for a type annotation.
|
|
7656
|
+
*/
|
|
7657
|
+
Type = 1,
|
|
7658
|
+
/**
|
|
7659
|
+
* An inlay hint that is for a parameter.
|
|
7660
|
+
*/
|
|
7661
|
+
Parameter = 2,
|
|
7662
|
+
}
|
|
7663
|
+
|
|
7664
|
+
/**
|
|
7665
|
+
* An inlay hint label part allows for interactive and composite labels of inlay hints.
|
|
7666
|
+
*/
|
|
7667
|
+
export class InlayHintLabelPart {
|
|
7668
|
+
|
|
7669
|
+
/**
|
|
7670
|
+
* The value of this label part.
|
|
7671
|
+
*/
|
|
7672
|
+
value: string;
|
|
7673
|
+
|
|
7674
|
+
/**
|
|
7675
|
+
* The tooltip text when you hover over this label part.
|
|
7676
|
+
*
|
|
7677
|
+
* *Note* that this property can be set late during
|
|
7678
|
+
* {@link InlayHintsProvider.resolveInlayHint resolving} of inlay hints.
|
|
7679
|
+
*/
|
|
7680
|
+
tooltip?: string | MarkdownString | undefined;
|
|
7681
|
+
|
|
7682
|
+
/**
|
|
7683
|
+
* An optional {@link Location source code location} that represents this label
|
|
7684
|
+
* part.
|
|
7685
|
+
*
|
|
7686
|
+
* The editor will use this location for the hover and for code navigation features: This
|
|
7687
|
+
* part will become a clickable link that resolves to the definition of the symbol at the
|
|
7688
|
+
* given location (not necessarily the location itself), it shows the hover that shows at
|
|
7689
|
+
* the given location, and it shows a context menu with further code navigation commands.
|
|
7690
|
+
*
|
|
7691
|
+
* *Note* that this property can be set late during
|
|
7692
|
+
* {@link InlayHintsProvider.resolveInlayHint resolving} of inlay hints.
|
|
7693
|
+
*/
|
|
7694
|
+
location?: Location | undefined;
|
|
7695
|
+
|
|
7696
|
+
/**
|
|
7697
|
+
* An optional command for this label part.
|
|
7698
|
+
*
|
|
7699
|
+
* The editor renders parts with commands as clickable links. The command is added to the context menu
|
|
7700
|
+
* when a label part defines {@link InlayHintLabelPart.location location} and {@link InlayHintLabelPart.command command} .
|
|
7701
|
+
*
|
|
7702
|
+
* *Note* that this property can be set late during
|
|
7703
|
+
* {@link InlayHintsProvider.resolveInlayHint resolving} of inlay hints.
|
|
7704
|
+
*/
|
|
7705
|
+
command?: Command | undefined;
|
|
7706
|
+
|
|
7707
|
+
/**
|
|
7708
|
+
* Creates a new inlay hint label part.
|
|
7709
|
+
*
|
|
7710
|
+
* @param value The value of the part.
|
|
7711
|
+
*/
|
|
7712
|
+
constructor(value: string);
|
|
7713
|
+
}
|
|
7714
|
+
|
|
7715
|
+
/**
|
|
7716
|
+
* Inlay hint information.
|
|
7717
|
+
*/
|
|
7718
|
+
export class InlayHint {
|
|
7719
|
+
|
|
7720
|
+
/**
|
|
7721
|
+
* The position of this hint.
|
|
7722
|
+
*/
|
|
7723
|
+
position: Position;
|
|
7724
|
+
|
|
7725
|
+
/**
|
|
7726
|
+
* The label of this hint. A human readable string or an array of {@link InlayHintLabelPart label parts}.
|
|
7727
|
+
*
|
|
7728
|
+
* *Note* that neither the string nor the label part can be empty.
|
|
7729
|
+
*/
|
|
7730
|
+
label: string | InlayHintLabelPart[];
|
|
7731
|
+
|
|
7732
|
+
/**
|
|
7733
|
+
* The tooltip text when you hover over this item.
|
|
7734
|
+
*
|
|
7735
|
+
* *Note* that this property can be set late during
|
|
7736
|
+
* {@link InlayHintsProvider.resolveInlayHint resolving} of inlay hints.
|
|
7737
|
+
*/
|
|
7738
|
+
tooltip?: string | MarkdownString | undefined;
|
|
7739
|
+
|
|
7740
|
+
/**
|
|
7741
|
+
* The kind of this hint. The inlay hint kind defines the appearance of this inlay hint.
|
|
7742
|
+
*/
|
|
7743
|
+
kind?: InlayHintKind;
|
|
7744
|
+
|
|
7745
|
+
/**
|
|
7746
|
+
* Optional {@link TextEdit text edits} that are performed when accepting this inlay hint. The default
|
|
7747
|
+
* gesture for accepting an inlay hint is the double click.
|
|
7748
|
+
*
|
|
7749
|
+
* *Note* that edits are expected to change the document so that the inlay hint (or its nearest variant) is
|
|
7750
|
+
* now part of the document and the inlay hint itself is now obsolete.
|
|
7751
|
+
*
|
|
7752
|
+
* *Note* that this property can be set late during
|
|
7753
|
+
* {@link InlayHintsProvider.resolveInlayHint resolving} of inlay hints.
|
|
7754
|
+
*/
|
|
7755
|
+
textEdits?: TextEdit[];
|
|
7756
|
+
|
|
7757
|
+
/**
|
|
7758
|
+
* Render padding before the hint. Padding will use the editor's background color,
|
|
7759
|
+
* not the background color of the hint itself. That means padding can be used to visually
|
|
7760
|
+
* align/separate an inlay hint.
|
|
7761
|
+
*/
|
|
7762
|
+
paddingLeft?: boolean;
|
|
7763
|
+
|
|
7764
|
+
/**
|
|
7765
|
+
* Render padding after the hint. Padding will use the editor's background color,
|
|
7766
|
+
* not the background color of the hint itself. That means padding can be used to visually
|
|
7767
|
+
* align/separate an inlay hint.
|
|
7768
|
+
*/
|
|
7769
|
+
paddingRight?: boolean;
|
|
7770
|
+
|
|
7771
|
+
/**
|
|
7772
|
+
* Creates a new inlay hint.
|
|
7773
|
+
*
|
|
7774
|
+
* @param position The position of the hint.
|
|
7775
|
+
* @param label The label of the hint.
|
|
7776
|
+
* @param kind The {@link InlayHintKind kind} of the hint.
|
|
7777
|
+
*/
|
|
7778
|
+
constructor(position: Position, label: string | InlayHintLabelPart[], kind?: InlayHintKind);
|
|
7779
|
+
}
|
|
7780
|
+
|
|
7781
|
+
/**
|
|
7782
|
+
* The inlay hints provider interface defines the contract between extensions and
|
|
7783
|
+
* the inlay hints feature.
|
|
7784
|
+
*/
|
|
7785
|
+
export interface InlayHintsProvider<T extends InlayHint = InlayHint> {
|
|
7786
|
+
|
|
7787
|
+
/**
|
|
7788
|
+
* An optional event to signal that inlay hints from this provider have changed.
|
|
7789
|
+
*/
|
|
7790
|
+
onDidChangeInlayHints?: Event<void>;
|
|
7791
|
+
|
|
7792
|
+
/**
|
|
7793
|
+
* Provide inlay hints for the given range and document.
|
|
7794
|
+
*
|
|
7795
|
+
* *Note* that inlay hints that are not {@link Range.contains contained} by the given range are ignored.
|
|
7796
|
+
*
|
|
7797
|
+
* @param document The document in which the command was invoked.
|
|
7798
|
+
* @param range The range for which inlay hints should be computed.
|
|
7799
|
+
* @param token A cancellation token.
|
|
7800
|
+
* @return An array of inlay hints or a thenable that resolves to such.
|
|
7801
|
+
*/
|
|
7802
|
+
provideInlayHints(document: TextDocument, range: Range, token: CancellationToken): ProviderResult<T[]>;
|
|
7803
|
+
|
|
7804
|
+
/**
|
|
7805
|
+
* Given an inlay hint fill in {@link InlayHint.tooltip tooltip}, {@link InlayHint.textEdits text edits},
|
|
7806
|
+
* or complete label {@link InlayHintLabelPart parts}.
|
|
7807
|
+
*
|
|
7808
|
+
* *Note* that the editor will resolve an inlay hint at most once.
|
|
7809
|
+
*
|
|
7810
|
+
* @param hint An inlay hint.
|
|
7811
|
+
* @param token A cancellation token.
|
|
7812
|
+
* @return The resolved inlay hint or a thenable that resolves to such. It is OK to return the given `item`. When no result is returned, the given `item` will be used.
|
|
7813
|
+
*/
|
|
7814
|
+
resolveInlayHint?(hint: T, token: CancellationToken): ProviderResult<T>;
|
|
7815
|
+
}
|
|
7816
|
+
|
|
7624
7817
|
/**
|
|
7625
7818
|
* A line based folding range. To be valid, start and end line must a zero or larger and smaller than the number of lines in the document.
|
|
7626
7819
|
* Invalid ranges will be ignored.
|
|
@@ -9698,6 +9891,19 @@ export module '@theia/plugin' {
|
|
|
9698
9891
|
*/
|
|
9699
9892
|
export function registerColorProvider(selector: DocumentSelector, provider: DocumentColorProvider): Disposable;
|
|
9700
9893
|
|
|
9894
|
+
/**
|
|
9895
|
+
* Register a inlay hints provider.
|
|
9896
|
+
*
|
|
9897
|
+
* Multiple providers can be registered for a language. In that case providers are asked in
|
|
9898
|
+
* parallel and the results are merged. A failing provider (rejected promise or exception) will
|
|
9899
|
+
* not cause a failure of the whole operation.
|
|
9900
|
+
*
|
|
9901
|
+
* @param selector A selector that defines the documents this provider is applicable to.
|
|
9902
|
+
* @param provider An inlay hints provider.
|
|
9903
|
+
* @return A {@link Disposable} that unregisters this provider when being disposed.
|
|
9904
|
+
*/
|
|
9905
|
+
export function registerInlayHintsProvider(selector: DocumentSelector, provider: InlayHintsProvider): Disposable;
|
|
9906
|
+
|
|
9701
9907
|
/**
|
|
9702
9908
|
* Register a folding range provider.
|
|
9703
9909
|
*
|