@theia/plugin-ext 1.29.0-next.10 → 1.29.0-next.11
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/lib/common/plugin-api-rpc.d.ts +6 -6
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/common/rpc-protocol.d.ts +1 -1
- package/lib/common/rpc-protocol.d.ts.map +1 -1
- package/lib/common/rpc-protocol.js +3 -3
- package/lib/common/rpc-protocol.js.map +1 -1
- package/lib/main/browser/view/tree-view-decorator-service.d.ts +1 -1
- package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-decorator-service.js +1 -1
- package/lib/main/browser/view/tree-view-decorator-service.js.map +1 -1
- package/lib/plugin/languages/code-action.d.ts.map +1 -1
- package/lib/plugin/languages/code-action.js +8 -9
- package/lib/plugin/languages/code-action.js.map +1 -1
- package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
- package/lib/plugin/languages/document-highlight.js +0 -1
- package/lib/plugin/languages/document-highlight.js.map +1 -1
- package/lib/plugin/languages/util.d.ts +2 -2
- package/lib/plugin/languages/util.d.ts.map +1 -1
- package/lib/plugin/languages/util.js +0 -2
- package/lib/plugin/languages/util.js.map +1 -1
- package/lib/plugin/type-converters.d.ts +6 -6
- package/lib/plugin/type-converters.d.ts.map +1 -1
- package/lib/plugin/type-converters.js +45 -53
- package/lib/plugin/type-converters.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +3 -3
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +5 -7
- package/lib/plugin/types-impl.js.map +1 -1
- package/package.json +24 -24
- package/src/common/plugin-api-rpc.ts +6 -6
- package/src/common/rpc-protocol.ts +5 -5
- package/src/main/browser/view/tree-view-decorator-service.ts +2 -2
- package/src/plugin/languages/code-action.ts +9 -12
- package/src/plugin/languages/document-highlight.ts +1 -2
- package/src/plugin/languages/util.ts +2 -4
- package/src/plugin/type-converters.ts +51 -59
- package/src/plugin/types-impl.ts +12 -14
|
@@ -137,9 +137,8 @@ export function toPosition(position: Position): types.Position {
|
|
|
137
137
|
return new types.Position(position.lineNumber - 1, position.column - 1);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return (typeof something.range !== 'undefined');
|
|
140
|
+
function isDecorationOptions(arg: unknown): arg is theia.DecorationOptions {
|
|
141
|
+
return !!arg && typeof arg === 'object' && typeof (arg as theia.DecorationOptions).range !== 'undefined';
|
|
143
142
|
}
|
|
144
143
|
|
|
145
144
|
export function isDecorationOptionsArr(something: theia.Range[] | theia.DecorationOptions[]): something is theia.DecorationOptions[] {
|
|
@@ -182,11 +181,10 @@ interface Codeblock {
|
|
|
182
181
|
value: string;
|
|
183
182
|
}
|
|
184
183
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
&& typeof (
|
|
189
|
-
&& typeof (<Codeblock>thing).value === 'string';
|
|
184
|
+
function isCodeblock(arg: unknown): arg is Codeblock {
|
|
185
|
+
return !!arg && typeof arg === 'object'
|
|
186
|
+
&& typeof (arg as Codeblock).language === 'string'
|
|
187
|
+
&& typeof (arg as Codeblock).value === 'string';
|
|
190
188
|
}
|
|
191
189
|
|
|
192
190
|
export function fromMarkdown(markup: theia.MarkdownString | theia.MarkedString): MarkdownStringDTO {
|
|
@@ -625,64 +623,58 @@ export function toSymbolTag(kind: model.SymbolTag): types.SymbolTag {
|
|
|
625
623
|
}
|
|
626
624
|
}
|
|
627
625
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
if (!thing) {
|
|
631
|
-
return false;
|
|
632
|
-
}
|
|
633
|
-
return isModelRange((<model.Location>thing).range) &&
|
|
634
|
-
isUriComponents((<model.Location>thing).uri);
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
638
|
-
export function isModelRange(thing: any): thing is model.Range {
|
|
639
|
-
if (!thing) {
|
|
626
|
+
export function isModelLocation(arg: unknown): arg is model.Location {
|
|
627
|
+
if (!arg) {
|
|
640
628
|
return false;
|
|
641
629
|
}
|
|
642
|
-
return
|
|
643
|
-
|
|
644
|
-
((
|
|
645
|
-
((
|
|
630
|
+
return !!arg &&
|
|
631
|
+
typeof arg === 'object' &&
|
|
632
|
+
isModelRange((arg as model.Location).range) &&
|
|
633
|
+
isUriComponents((arg as model.Location).uri);
|
|
646
634
|
}
|
|
647
635
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
(('query' in thing) && typeof thing.query === 'string') &&
|
|
656
|
-
(('fragment' in thing) && typeof thing.fragment === 'string');
|
|
636
|
+
export function isModelRange(arg: unknown): arg is model.Range {
|
|
637
|
+
const range = arg as model.Range;
|
|
638
|
+
return !!arg && typeof arg === 'object' &&
|
|
639
|
+
typeof range.startLineNumber === 'number' &&
|
|
640
|
+
typeof range.startColumn === 'number' &&
|
|
641
|
+
typeof range.endLineNumber === 'number' &&
|
|
642
|
+
typeof range.endColumn === 'number';
|
|
657
643
|
}
|
|
658
644
|
|
|
659
645
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
660
|
-
export function
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
646
|
+
export function isUriComponents(arg: unknown): arg is UriComponents {
|
|
647
|
+
const uriComponents = arg as UriComponents;
|
|
648
|
+
return !!arg && typeof arg === 'object' &&
|
|
649
|
+
typeof uriComponents.scheme === 'string' &&
|
|
650
|
+
typeof uriComponents.path === 'string' &&
|
|
651
|
+
typeof uriComponents.query === 'string' &&
|
|
652
|
+
typeof uriComponents.fragment === 'string';
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
export function isModelCallHierarchyItem(arg: unknown): arg is model.CallHierarchyItem {
|
|
656
|
+
const item = arg as model.CallHierarchyItem;
|
|
657
|
+
return !!item && typeof item === 'object'
|
|
658
|
+
&& isModelRange(item.range)
|
|
659
|
+
&& isModelRange(item.selectionRange)
|
|
660
|
+
&& isUriComponents(item.uri)
|
|
661
|
+
&& !!item.name;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
export function isModelCallHierarchyIncomingCall(arg: unknown): arg is model.CallHierarchyIncomingCall {
|
|
665
|
+
const maybeIncomingCall = arg as model.CallHierarchyIncomingCall;
|
|
666
|
+
return !!arg && typeof arg === 'object' &&
|
|
667
|
+
'from' in maybeIncomingCall &&
|
|
668
|
+
'fromRanges' in maybeIncomingCall &&
|
|
669
|
+
isModelCallHierarchyItem(maybeIncomingCall.from);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
export function isModelCallHierarchyOutgoingCall(arg: unknown): arg is model.CallHierarchyOutgoingCall {
|
|
673
|
+
const maybeOutgoingCall = arg as model.CallHierarchyOutgoingCall;
|
|
674
|
+
return !!arg && typeof arg === 'object' &&
|
|
675
|
+
'to' in maybeOutgoingCall &&
|
|
676
|
+
'fromRanges' in maybeOutgoingCall &&
|
|
677
|
+
isModelCallHierarchyItem(maybeOutgoingCall.to);
|
|
686
678
|
}
|
|
687
679
|
|
|
688
680
|
export function toLocation(value: model.Location): types.Location {
|
package/src/plugin/types-impl.ts
CHANGED
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
*--------------------------------------------------------------------------------------------*/
|
|
21
21
|
|
|
22
22
|
/* eslint-disable no-null/no-null */
|
|
23
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
24
23
|
|
|
25
24
|
import { UUID } from '@theia/core/shared/@phosphor/coreutils';
|
|
26
25
|
import { illegalArgument } from '../common/errors';
|
|
@@ -38,6 +37,7 @@ import { es5ClassCompat } from '../common/types';
|
|
|
38
37
|
* A reviver that takes URI's transferred via JSON.stringify() and makes
|
|
39
38
|
* instances of our local plugin API URI class (below)
|
|
40
39
|
*/
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
41
|
export function reviver(key: string | undefined, value: any): any {
|
|
42
42
|
const revived = ObjectsTransferrer.reviver(key, value);
|
|
43
43
|
if (CodeURI.isUri(revived)) {
|
|
@@ -423,7 +423,7 @@ export class Position {
|
|
|
423
423
|
return false;
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
-
toJSON():
|
|
426
|
+
toJSON(): unknown {
|
|
427
427
|
return { line: this.line, character: this.character };
|
|
428
428
|
}
|
|
429
429
|
}
|
|
@@ -546,19 +546,17 @@ export class Range {
|
|
|
546
546
|
return new Range(start, end);
|
|
547
547
|
}
|
|
548
548
|
|
|
549
|
-
|
|
550
|
-
static isRange(thing: any): thing is theia.Range {
|
|
549
|
+
static isRange(thing: unknown): thing is theia.Range {
|
|
551
550
|
if (thing instanceof Range) {
|
|
552
551
|
return true;
|
|
553
552
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
&& Position.isPosition((<Range>thing).end);
|
|
553
|
+
const range = thing as theia.Range;
|
|
554
|
+
return !!thing && typeof thing === 'object'
|
|
555
|
+
&& Position.isPosition(range.start)
|
|
556
|
+
&& Position.isPosition(range.end);
|
|
559
557
|
}
|
|
560
558
|
|
|
561
|
-
toJSON():
|
|
559
|
+
toJSON(): unknown {
|
|
562
560
|
return [this.start, this.end];
|
|
563
561
|
}
|
|
564
562
|
}
|
|
@@ -1636,8 +1634,8 @@ export class FileSystemError extends Error {
|
|
|
1636
1634
|
|
|
1637
1635
|
// workaround when extending builtin objects and when compiling to ES5, see:
|
|
1638
1636
|
// https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
1639
|
-
if (typeof
|
|
1640
|
-
|
|
1637
|
+
if (typeof Object.setPrototypeOf === 'function') {
|
|
1638
|
+
Object.setPrototypeOf(this, FileSystemError.prototype);
|
|
1641
1639
|
}
|
|
1642
1640
|
|
|
1643
1641
|
if (typeof Error.captureStackTrace === 'function' && typeof terminator === 'function') {
|
|
@@ -2555,7 +2553,7 @@ export class SemanticTokensLegend {
|
|
|
2555
2553
|
}
|
|
2556
2554
|
}
|
|
2557
2555
|
|
|
2558
|
-
function isStrArrayOrUndefined(arg:
|
|
2556
|
+
function isStrArrayOrUndefined(arg: unknown): arg is string[] | undefined {
|
|
2559
2557
|
return ((typeof arg === 'undefined') || (Array.isArray(arg) && arg.every(e => typeof e === 'string')));
|
|
2560
2558
|
}
|
|
2561
2559
|
|
|
@@ -2593,7 +2591,7 @@ export class SemanticTokensBuilder {
|
|
|
2593
2591
|
|
|
2594
2592
|
public push(line: number, char: number, length: number, tokenType: number, tokenModifiers?: number): void;
|
|
2595
2593
|
public push(range: Range, tokenType: string, tokenModifiers?: string[]): void;
|
|
2596
|
-
public push(arg0:
|
|
2594
|
+
public push(arg0: number | Range, arg1: number | string, arg2?: number | string[], arg3?: number, arg4?: number): void {
|
|
2597
2595
|
if (typeof arg0 === 'number' && typeof arg1 === 'number' && typeof arg2 === 'number' && typeof arg3 === 'number' &&
|
|
2598
2596
|
(typeof arg4 === 'number' || typeof arg4 === 'undefined')) {
|
|
2599
2597
|
if (typeof arg4 === 'undefined') {
|