@theia/plugin-ext 1.29.0-next.9 → 1.30.0-next.1

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 (126) hide show
  1. package/lib/common/plugin-api-rpc.d.ts +17 -15
  2. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  3. package/lib/common/plugin-api-rpc.js.map +1 -1
  4. package/lib/common/rpc-protocol.d.ts +1 -1
  5. package/lib/common/rpc-protocol.d.ts.map +1 -1
  6. package/lib/common/rpc-protocol.js +3 -3
  7. package/lib/common/rpc-protocol.js.map +1 -1
  8. package/lib/main/browser/authentication-main.d.ts +3 -6
  9. package/lib/main/browser/authentication-main.d.ts.map +1 -1
  10. package/lib/main/browser/authentication-main.js +16 -37
  11. package/lib/main/browser/authentication-main.js.map +1 -1
  12. package/lib/main/browser/comments/comment-thread-widget.d.ts +2 -0
  13. package/lib/main/browser/comments/comment-thread-widget.d.ts.map +1 -1
  14. package/lib/main/browser/comments/comment-thread-widget.js +4 -3
  15. package/lib/main/browser/comments/comment-thread-widget.js.map +1 -1
  16. package/lib/main/browser/debug/debug-main.d.ts +1 -1
  17. package/lib/main/browser/debug/debug-main.d.ts.map +1 -1
  18. package/lib/main/browser/debug/debug-main.js +20 -10
  19. package/lib/main/browser/debug/debug-main.js.map +1 -1
  20. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +4 -4
  21. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
  22. package/lib/main/browser/debug/plugin-debug-session-factory.js.map +1 -1
  23. package/lib/main/browser/plugin-ext-frontend-module.d.ts +1 -0
  24. package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
  25. package/lib/main/browser/plugin-ext-frontend-module.js +1 -0
  26. package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
  27. package/lib/main/browser/terminal-main.d.ts.map +1 -1
  28. package/lib/main/browser/terminal-main.js +2 -1
  29. package/lib/main/browser/terminal-main.js.map +1 -1
  30. package/lib/main/browser/theme-icon-override.d.ts +2 -0
  31. package/lib/main/browser/theme-icon-override.d.ts.map +1 -0
  32. package/lib/main/browser/theme-icon-override.js +217 -0
  33. package/lib/main/browser/theme-icon-override.js.map +1 -0
  34. package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
  35. package/lib/main/browser/view/plugin-view-registry.js +0 -1
  36. package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
  37. package/lib/main/browser/view/plugin-view-widget.d.ts +9 -8
  38. package/lib/main/browser/view/plugin-view-widget.d.ts.map +1 -1
  39. package/lib/main/browser/view/plugin-view-widget.js +7 -4
  40. package/lib/main/browser/view/plugin-view-widget.js.map +1 -1
  41. package/lib/main/browser/view/tree-view-decorator-service.d.ts +1 -1
  42. package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
  43. package/lib/main/browser/view/tree-view-decorator-service.js +1 -1
  44. package/lib/main/browser/view/tree-view-decorator-service.js.map +1 -1
  45. package/lib/main/node/plugin-ext-backend-module.d.ts +1 -1
  46. package/lib/main/node/plugin-ext-backend-module.d.ts.map +1 -1
  47. package/lib/main/node/plugin-ext-backend-module.js +4 -1
  48. package/lib/main/node/plugin-ext-backend-module.js.map +1 -1
  49. package/lib/main/node/plugin-localization-backend-contribution.d.ts +10 -0
  50. package/lib/main/node/plugin-localization-backend-contribution.d.ts.map +1 -0
  51. package/lib/main/node/plugin-localization-backend-contribution.js +59 -0
  52. package/lib/main/node/plugin-localization-backend-contribution.js.map +1 -0
  53. package/lib/plugin/authentication-ext.d.ts +2 -12
  54. package/lib/plugin/authentication-ext.d.ts.map +1 -1
  55. package/lib/plugin/authentication-ext.js +3 -55
  56. package/lib/plugin/authentication-ext.js.map +1 -1
  57. package/lib/plugin/custom-editors.js +1 -1
  58. package/lib/plugin/custom-editors.js.map +1 -1
  59. package/lib/plugin/languages/code-action.d.ts.map +1 -1
  60. package/lib/plugin/languages/code-action.js +8 -9
  61. package/lib/plugin/languages/code-action.js.map +1 -1
  62. package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
  63. package/lib/plugin/languages/document-highlight.js +0 -1
  64. package/lib/plugin/languages/document-highlight.js.map +1 -1
  65. package/lib/plugin/languages/util.d.ts +2 -2
  66. package/lib/plugin/languages/util.d.ts.map +1 -1
  67. package/lib/plugin/languages/util.js +0 -2
  68. package/lib/plugin/languages/util.js.map +1 -1
  69. package/lib/plugin/plugin-context.d.ts.map +1 -1
  70. package/lib/plugin/plugin-context.js +3 -35
  71. package/lib/plugin/plugin-context.js.map +1 -1
  72. package/lib/plugin/preference-registry.d.ts.map +1 -1
  73. package/lib/plugin/preference-registry.js +5 -0
  74. package/lib/plugin/preference-registry.js.map +1 -1
  75. package/lib/plugin/preference-registry.spec.js +44 -1
  76. package/lib/plugin/preference-registry.spec.js.map +1 -1
  77. package/lib/plugin/quick-open.d.ts +5 -1
  78. package/lib/plugin/quick-open.d.ts.map +1 -1
  79. package/lib/plugin/quick-open.js +27 -4
  80. package/lib/plugin/quick-open.js.map +1 -1
  81. package/lib/plugin/type-converters.d.ts +7 -7
  82. package/lib/plugin/type-converters.d.ts.map +1 -1
  83. package/lib/plugin/type-converters.js +45 -53
  84. package/lib/plugin/type-converters.js.map +1 -1
  85. package/lib/plugin/types-impl.d.ts +13 -8
  86. package/lib/plugin/types-impl.d.ts.map +1 -1
  87. package/lib/plugin/types-impl.js +12 -10
  88. package/lib/plugin/types-impl.js.map +1 -1
  89. package/lib/plugin/workspace.d.ts.map +1 -1
  90. package/lib/plugin/workspace.js +6 -1
  91. package/lib/plugin/workspace.js.map +1 -1
  92. package/lib/plugin-ext-backend-electron-module.js +2 -2
  93. package/lib/plugin-ext-backend-electron-module.js.map +1 -1
  94. package/lib/plugin-ext-backend-module.js +2 -2
  95. package/lib/plugin-ext-backend-module.js.map +1 -1
  96. package/package.json +26 -26
  97. package/src/common/plugin-api-rpc.ts +11 -15
  98. package/src/common/rpc-protocol.ts +5 -5
  99. package/src/main/browser/authentication-main.ts +17 -42
  100. package/src/main/browser/comments/comment-thread-widget.tsx +5 -3
  101. package/src/main/browser/debug/debug-main.ts +20 -12
  102. package/src/main/browser/debug/plugin-debug-session-factory.ts +3 -3
  103. package/src/main/browser/plugin-ext-frontend-module.ts +1 -0
  104. package/src/main/browser/style/tree.css +2 -0
  105. package/src/main/browser/terminal-main.ts +2 -1
  106. package/src/main/browser/theme-icon-override.ts +221 -0
  107. package/src/main/browser/view/plugin-view-registry.ts +0 -1
  108. package/src/main/browser/view/plugin-view-widget.ts +14 -11
  109. package/src/main/browser/view/tree-view-decorator-service.ts +2 -2
  110. package/src/main/node/plugin-ext-backend-module.ts +6 -1
  111. package/src/main/node/plugin-localization-backend-contribution.ts +42 -0
  112. package/src/plugin/authentication-ext.ts +4 -71
  113. package/src/plugin/custom-editors.ts +1 -1
  114. package/src/plugin/debug/debug-ext.ts +1 -1
  115. package/src/plugin/languages/code-action.ts +9 -12
  116. package/src/plugin/languages/document-highlight.ts +1 -2
  117. package/src/plugin/languages/util.ts +2 -4
  118. package/src/plugin/plugin-context.ts +7 -41
  119. package/src/plugin/preference-registry.spec.ts +45 -1
  120. package/src/plugin/preference-registry.ts +5 -0
  121. package/src/plugin/quick-open.ts +32 -6
  122. package/src/plugin/type-converters.ts +46 -54
  123. package/src/plugin/types-impl.ts +25 -24
  124. package/src/plugin/workspace.ts +5 -1
  125. package/src/plugin-ext-backend-electron-module.ts +2 -2
  126. package/src/plugin-ext-backend-module.ts +2 -2
@@ -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(): any {
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
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
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
- if (!thing) {
555
- return false;
556
- }
557
- return Position.isPosition((<Range>thing).start)
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(): any {
559
+ toJSON(): unknown {
562
560
  return [this.start, this.end];
563
561
  }
564
562
  }
@@ -721,8 +719,7 @@ export class SnippetString {
721
719
 
722
720
  @es5ClassCompat
723
721
  export class ThemeColor {
724
- constructor(public id: string) {
725
- }
722
+ constructor(public id: string) { }
726
723
  }
727
724
 
728
725
  @es5ClassCompat
@@ -1100,18 +1097,18 @@ export class SignatureHelp {
1100
1097
  @es5ClassCompat
1101
1098
  export class Hover {
1102
1099
 
1103
- public contents: theia.MarkdownString[] | theia.MarkedString[];
1100
+ public contents: Array<theia.MarkdownString | theia.MarkedString>;
1104
1101
  public range?: Range;
1105
1102
 
1106
1103
  constructor(
1107
- contents: theia.MarkdownString | theia.MarkedString | theia.MarkdownString[] | theia.MarkedString[],
1104
+ contents: theia.MarkdownString | theia.MarkedString | Array<theia.MarkdownString | theia.MarkedString>,
1108
1105
  range?: Range
1109
1106
  ) {
1110
1107
  if (!contents) {
1111
1108
  illegalArgument('contents must be defined');
1112
1109
  }
1113
1110
  if (Array.isArray(contents)) {
1114
- this.contents = <theia.MarkdownString[] | theia.MarkedString[]>contents;
1111
+ this.contents = contents;
1115
1112
  } else {
1116
1113
  this.contents = [contents];
1117
1114
  }
@@ -1556,8 +1553,6 @@ export class QuickInputButtons {
1556
1553
  static readonly Back: theia.QuickInputButton = {
1557
1554
  iconPath: {
1558
1555
  id: 'Back',
1559
- dark: '',
1560
- light: ''
1561
1556
  },
1562
1557
  tooltip: 'Back'
1563
1558
  };
@@ -1636,8 +1631,8 @@ export class FileSystemError extends Error {
1636
1631
 
1637
1632
  // workaround when extending builtin objects and when compiling to ES5, see:
1638
1633
  // 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 (<any>Object).setPrototypeOf === 'function') {
1640
- (<any>Object).setPrototypeOf(this, FileSystemError.prototype);
1634
+ if (typeof Object.setPrototypeOf === 'function') {
1635
+ Object.setPrototypeOf(this, FileSystemError.prototype);
1641
1636
  }
1642
1637
 
1643
1638
  if (typeof Error.captureStackTrace === 'function' && typeof terminator === 'function') {
@@ -2555,7 +2550,7 @@ export class SemanticTokensLegend {
2555
2550
  }
2556
2551
  }
2557
2552
 
2558
- function isStrArrayOrUndefined(arg: any): arg is string[] | undefined {
2553
+ function isStrArrayOrUndefined(arg: unknown): arg is string[] | undefined {
2559
2554
  return ((typeof arg === 'undefined') || (Array.isArray(arg) && arg.every(e => typeof e === 'string')));
2560
2555
  }
2561
2556
 
@@ -2593,7 +2588,7 @@ export class SemanticTokensBuilder {
2593
2588
 
2594
2589
  public push(line: number, char: number, length: number, tokenType: number, tokenModifiers?: number): void;
2595
2590
  public push(range: Range, tokenType: string, tokenModifiers?: string[]): void;
2596
- public push(arg0: any, arg1: any, arg2: any, arg3?: any, arg4?: any): void {
2591
+ public push(arg0: number | Range, arg1: number | string, arg2?: number | string[], arg3?: number, arg4?: number): void {
2597
2592
  if (typeof arg0 === 'number' && typeof arg1 === 'number' && typeof arg2 === 'number' && typeof arg3 === 'number' &&
2598
2593
  (typeof arg4 === 'number' || typeof arg4 === 'undefined')) {
2599
2594
  if (typeof arg4 === 'undefined') {
@@ -2741,7 +2736,7 @@ export class SemanticTokensBuilder {
2741
2736
 
2742
2737
  @es5ClassCompat
2743
2738
  export class SemanticTokens {
2744
- readonly resultId?: string;
2739
+ readonly resultId: string | undefined;
2745
2740
  readonly data: Uint32Array;
2746
2741
 
2747
2742
  constructor(data: Uint32Array, resultId?: string) {
@@ -2754,7 +2749,7 @@ export class SemanticTokens {
2754
2749
  export class SemanticTokensEdit {
2755
2750
  readonly start: number;
2756
2751
  readonly deleteCount: number;
2757
- readonly data?: Uint32Array;
2752
+ readonly data: Uint32Array | undefined;
2758
2753
 
2759
2754
  constructor(start: number, deleteCount: number, data?: Uint32Array) {
2760
2755
  this.start = start;
@@ -2765,7 +2760,7 @@ export class SemanticTokensEdit {
2765
2760
 
2766
2761
  @es5ClassCompat
2767
2762
  export class SemanticTokensEdits {
2768
- readonly resultId?: string;
2763
+ readonly resultId: string | undefined;
2769
2764
  readonly edits: SemanticTokensEdit[];
2770
2765
 
2771
2766
  constructor(edits: SemanticTokensEdit[], resultId?: string) {
@@ -2774,4 +2769,10 @@ export class SemanticTokensEdits {
2774
2769
  }
2775
2770
  }
2776
2771
 
2772
+ export enum InputBoxValidationSeverity {
2773
+ Info = 1,
2774
+ Warning = 2,
2775
+ Error = 3
2776
+ }
2777
+
2777
2778
  // #endregion
@@ -243,8 +243,12 @@ export class WorkspaceExtImpl implements WorkspaceExt {
243
243
  // `file` and `untitled` schemas are reserved by `workspace.openTextDocument` API:
244
244
  // `file`-scheme for opening a file
245
245
  // `untitled`-scheme for opening a new file that should be saved
246
- if (scheme === Schemes.file || scheme === Schemes.untitled || this.documentContentProviders.has(scheme)) {
246
+ if (scheme === Schemes.file || scheme === Schemes.untitled) {
247
247
  throw new Error(`Text Content Document Provider for scheme '${scheme}' is already registered`);
248
+ } else if (this.documentContentProviders.has(scheme)) {
249
+ // TODO: we should be able to handle multiple registrations, but for now we should ensure that it doesn't crash plugin activation.
250
+ console.warn(`Repeat registration of TextContentDocumentProvider for scheme '${scheme}'. This registration will be ignored.`);
251
+ return { dispose: () => { } };
248
252
  }
249
253
 
250
254
  this.documentContentProviders.set(scheme, provider);
@@ -18,7 +18,7 @@ import { ContainerModule } from '@theia/core/shared/inversify';
18
18
  import { bindElectronBackend } from './hosted/node-electron/plugin-ext-hosted-electron-backend-module';
19
19
  import { bindMainBackend } from './main/node/plugin-ext-backend-module';
20
20
 
21
- export default new ContainerModule(bind => {
22
- bindMainBackend(bind);
21
+ export default new ContainerModule((bind, unbind, isBound, rebind) => {
22
+ bindMainBackend(bind, unbind, isBound, rebind);
23
23
  bindElectronBackend(bind);
24
24
  });
@@ -18,7 +18,7 @@ import { ContainerModule } from '@theia/core/shared/inversify';
18
18
  import { bindHostedBackend } from './hosted/node/plugin-ext-hosted-backend-module';
19
19
  import { bindMainBackend } from './main/node/plugin-ext-backend-module';
20
20
 
21
- export default new ContainerModule(bind => {
22
- bindMainBackend(bind);
21
+ export default new ContainerModule((bind, unbind, isBound, rebind) => {
22
+ bindMainBackend(bind, unbind, isBound, rebind);
23
23
  bindHostedBackend(bind);
24
24
  });