@theia/plugin-ext 1.75.0-next.21 → 1.75.0-next.28

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 (73) hide show
  1. package/lib/common/errors.d.ts +1 -14
  2. package/lib/common/errors.d.ts.map +1 -1
  3. package/lib/common/errors.js +3 -16
  4. package/lib/common/errors.js.map +1 -1
  5. package/lib/common/plugin-protocol.d.ts +45 -648
  6. package/lib/common/plugin-protocol.d.ts.map +1 -1
  7. package/lib/common/plugin-protocol.js +11 -34
  8. package/lib/common/plugin-protocol.js.map +1 -1
  9. package/lib/hosted/browser/worker/plugin-manifest-loader.d.ts.map +1 -1
  10. package/lib/hosted/browser/worker/plugin-manifest-loader.js +5 -36
  11. package/lib/hosted/browser/worker/plugin-manifest-loader.js.map +1 -1
  12. package/lib/hosted/browser/worker/worker-main.js +2 -1
  13. package/lib/hosted/browser/worker/worker-main.js.map +1 -1
  14. package/lib/hosted/node/hosted-plugin-localization-service.d.ts.map +1 -1
  15. package/lib/hosted/node/hosted-plugin-localization-service.js +4 -68
  16. package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
  17. package/lib/hosted/node/plugin-host-rpc.d.ts.map +1 -1
  18. package/lib/hosted/node/plugin-host-rpc.js +2 -2
  19. package/lib/hosted/node/plugin-host-rpc.js.map +1 -1
  20. package/lib/hosted/node/plugin-reader.d.ts.map +1 -1
  21. package/lib/hosted/node/plugin-reader.js +4 -3
  22. package/lib/hosted/node/plugin-reader.js.map +1 -1
  23. package/lib/hosted/node/scanners/grammars-reader.d.ts +3 -2
  24. package/lib/hosted/node/scanners/grammars-reader.d.ts.map +1 -1
  25. package/lib/hosted/node/scanners/grammars-reader.js +5 -23
  26. package/lib/hosted/node/scanners/grammars-reader.js.map +1 -1
  27. package/lib/hosted/node/scanners/scanner-theia.d.ts +38 -71
  28. package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
  29. package/lib/hosted/node/scanners/scanner-theia.js +117 -768
  30. package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
  31. package/lib/hosted/node/scanners/scanner-theia.spec.js +191 -0
  32. package/lib/hosted/node/scanners/scanner-theia.spec.js.map +1 -1
  33. package/lib/main/browser/plugin-contribution-handler.js +1 -1
  34. package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
  35. package/lib/main/browser/plugin-icon-service.d.ts.map +1 -1
  36. package/lib/main/browser/plugin-icon-service.js +2 -1
  37. package/lib/main/browser/plugin-icon-service.js.map +1 -1
  38. package/lib/main/browser/plugin-icon-theme-service.d.ts.map +1 -1
  39. package/lib/main/browser/plugin-icon-theme-service.js +2 -1
  40. package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
  41. package/lib/main/browser/plugin-shared-style.d.ts.map +1 -1
  42. package/lib/main/browser/plugin-shared-style.js +2 -1
  43. package/lib/main/browser/plugin-shared-style.js.map +1 -1
  44. package/package.json +31 -30
  45. package/src/common/errors.ts +1 -25
  46. package/src/common/plugin-protocol.ts +195 -662
  47. package/src/hosted/browser/worker/plugin-manifest-loader.ts +8 -41
  48. package/src/hosted/browser/worker/worker-main.ts +2 -1
  49. package/src/hosted/node/hosted-plugin-localization-service.ts +3 -82
  50. package/src/hosted/node/plugin-host-rpc.ts +3 -3
  51. package/src/hosted/node/plugin-reader.ts +4 -3
  52. package/src/hosted/node/scanners/grammars-reader.ts +14 -23
  53. package/src/hosted/node/scanners/scanner-theia.spec.ts +225 -1
  54. package/src/hosted/node/scanners/scanner-theia.ts +204 -881
  55. package/src/main/browser/plugin-contribution-handler.ts +1 -1
  56. package/src/main/browser/plugin-icon-service.ts +2 -1
  57. package/src/main/browser/plugin-icon-theme-service.ts +2 -1
  58. package/src/main/browser/plugin-shared-style.ts +2 -1
  59. package/lib/hosted/node/plugin-activation-events.d.ts +0 -7
  60. package/lib/hosted/node/plugin-activation-events.d.ts.map +0 -1
  61. package/lib/hosted/node/plugin-activation-events.js +0 -95
  62. package/lib/hosted/node/plugin-activation-events.js.map +0 -1
  63. package/lib/hosted/node/plugin-manifest-loader.d.ts +0 -3
  64. package/lib/hosted/node/plugin-manifest-loader.d.ts.map +0 -1
  65. package/lib/hosted/node/plugin-manifest-loader.js +0 -34
  66. package/lib/hosted/node/plugin-manifest-loader.js.map +0 -1
  67. package/lib/main/node/errors.spec.d.ts +0 -2
  68. package/lib/main/node/errors.spec.d.ts.map +0 -1
  69. package/lib/main/node/errors.spec.js +0 -36
  70. package/lib/main/node/errors.spec.js.map +0 -1
  71. package/src/hosted/node/plugin-activation-events.ts +0 -112
  72. package/src/hosted/node/plugin-manifest-loader.ts +0 -32
  73. package/src/main/node/errors.spec.ts +0 -37
@@ -2,335 +2,48 @@ import { RpcServer } from '@theia/core/lib/common/messaging/proxy-factory';
2
2
  import { RPCProtocol } from './rpc-protocol';
3
3
  import { Disposable } from '@theia/core/lib/common/disposable';
4
4
  import { LogPart, KeysToAnyValues, KeysToKeysToAnyValue } from './types';
5
- import { CharacterPair, CommentRule, PluginAPIFactory, Plugin, ThemeIcon } from './plugin-api-rpc';
5
+ import { PluginAPIFactory, Plugin } from './plugin-api-rpc';
6
6
  import { ExtPluginApi } from './plugin-ext-api-contribution';
7
- import { IJSONSchema, IJSONSchemaSnippet } from '@theia/core/lib/common/json-schema';
8
7
  import { ProblemMatcherContribution, ProblemPatternContribution, TaskDefinition } from '@theia/task/lib/common';
9
8
  import { ColorDefinition } from '@theia/core/lib/common/color';
10
9
  import { ResourceLabelFormatter } from '@theia/core/lib/common/label-protocol';
11
- import { PluginIdentifiers } from './plugin-identifiers';
12
- import { JSONObject } from '@theia/core/shared/@lumino/coreutils';
13
10
  import { PreferenceSchema } from '@theia/core';
11
+ import { PluginIdentifiers } from './plugin-identifiers';
12
+ import { getPluginId, toPluginUrl as toPluginUrlFromUtils } from '@theia/plugin-utils/lib/common/plugin-model';
13
+ import { PLUGIN_HOST_BACKEND, PluginEntryPoint, PluginLifecycle, PluginManifest, PluginMetadata, PluginModel, PluginPackageCapabilities, PluginType, DeployedPlugin as DeployedPluginBase } from '@theia/plugin-utils/lib/common/manifest-types';
14
+ import { AutoClosingPair, AutoClosingPairConditional, CustomEditorPriority, CustomEditorSelector, EnterAction, FoldingMarkers, FoldingRules, IndentationRules, OnEnterRule, PluginColorContribution, PluginIconContribution, PluginIconThemeContribution, PluginJsonValidationContribution, PluginManifestContribution, PluginNotebookRendererContribution, PluginPackageAuthenticationProvider, PluginPackageCommand, PluginPackageCustomEditor, PluginPackageDebuggersContribution, PluginPackageGrammarsContribution, PluginPackageKeybinding, PluginPackageLanguageContribution, PluginPackageLanguageContributionConfiguration, PluginPackageLanguageModelToolContribution, PluginPackageLocalization, PluginPackageMcpServerDefinitionProviderContribution, PluginPackageMenu, PluginPackageNotebook, PluginPackageNotebookPreload, PluginPackageSnippetsContribution, PluginPackageSubmenu, PluginPackageTerminal, PluginPackageTerminalProfile, PluginPackageTranslation, PluginPackageView, PluginPackageViewContainer, PluginPackageViewWelcome, PluginPackageWalkthrough, PluginPackageWalkthroughStep, PluginPackageWalkthroughStepMedia, PluginTaskDefinitionContribution, PluginThemeContribution, PluginUiTheme, PluginViewType, PlatformSpecificAdapterContribution, RegExpOptions, ScopeMap, type GrammarsContribution, type IconUrl, type JSONObject, type NormalizedCommand, type NormalizedCustomEditor, type NormalizedIcon, type NormalizedIconTheme, type NormalizedKeybinding, type NormalizedLanguage, type NormalizedLanguageConfiguration, type NormalizedLocalization, type NormalizedPluginContribution, type NormalizedSnippet, type NormalizedSubmenu, type NormalizedTerminalProfile, type NormalizedTheme, type NormalizedTranslation, type NormalizedViewContainer, type NormalizedViewWelcome, type WalkthroughContribution, type WalkthroughStepContribution, type WalkthroughStepMedia } from '@theia/plugin-utils/lib/common/contribution-types';
14
15
  export { PluginIdentifiers };
16
+ export { getPluginId };
17
+ export { toPluginUrlFromUtils as toPluginUrl };
18
+ export { PLUGIN_HOST_BACKEND, PluginEntryPoint, PluginLifecycle, PluginManifest, PluginModel, PluginPackageCapabilities, PluginMetadata, PluginType };
15
19
  export declare const hostedServicePath = "/services/hostedPlugin";
16
20
  /**
17
21
  * Plugin engine (API) type, i.e. 'theiaPlugin', 'vscode', 'theiaHeadlessPlugin', etc.
18
22
  */
19
23
  export type PluginEngine = string;
20
24
  /**
21
- * This interface describes a package.json object.
25
+ * Loaded plugin package with stricter fields used by `@theia/plugin-ext`.
22
26
  */
23
- export interface PluginPackage {
24
- name: string;
27
+ export interface PluginPackage extends PluginManifest {
25
28
  publisher: string | undefined;
26
- version: string;
27
29
  engines: {
28
30
  [type in PluginEngine]: string;
29
31
  };
30
- theiaPlugin?: {
31
- frontend?: string;
32
- backend?: string;
33
- headless?: string;
34
- };
35
- main?: string;
36
- browser?: string;
37
32
  displayName: string;
38
33
  description: string;
39
34
  contributes?: PluginPackageContribution;
40
- packagePath: string;
41
- activationEvents?: string[];
42
- extensionDependencies?: string[];
43
- extensionPack?: string[];
44
- l10n?: string;
45
- icon?: string;
46
- type?: 'module' | 'commonjs';
47
- extensionKind?: Array<'ui' | 'workspace'>;
48
- capabilities?: {
49
- untrustedWorkspaces?: {
50
- supported: boolean | 'limited';
51
- description?: string;
52
- restrictedConfigurations?: string[];
53
- };
54
- };
55
35
  }
56
36
  export declare namespace PluginPackage {
57
- function toPluginUrl(pck: PluginPackage | PluginModel, relativePath: string): string;
37
+ const toPluginUrl: typeof toPluginUrlFromUtils;
58
38
  }
39
+ export { AutoClosingPair, AutoClosingPairConditional, CustomEditorPriority, CustomEditorSelector, EnterAction, FoldingMarkers, FoldingRules, type GrammarsContribution, IndentationRules, OnEnterRule, PluginColorContribution, PluginIconContribution, PluginIconThemeContribution, PluginJsonValidationContribution, PluginManifestContribution, PluginNotebookRendererContribution, PluginPackageAuthenticationProvider, PluginPackageCommand, PluginPackageCustomEditor, PluginPackageDebuggersContribution, PluginPackageGrammarsContribution, PluginPackageKeybinding, PluginPackageLanguageContribution, PluginPackageLanguageContributionConfiguration, PluginPackageLanguageModelToolContribution, PluginPackageLocalization, PluginPackageMcpServerDefinitionProviderContribution, PluginPackageMenu, PluginPackageNotebook, PluginPackageNotebookPreload, PluginPackageSnippetsContribution, PluginPackageSubmenu, PluginPackageTerminal, PluginPackageTerminalProfile, PluginPackageTranslation, PluginPackageView, PluginPackageViewContainer, PluginPackageViewWelcome, PluginPackageWalkthrough, PluginPackageWalkthroughStep, PluginPackageWalkthroughStepMedia, PluginTaskDefinitionContribution, PluginThemeContribution, PluginUiTheme, PluginViewType, PlatformSpecificAdapterContribution, RegExpOptions, ScopeMap, type IconUrl, type JSONObject, type WalkthroughContribution, type WalkthroughStepContribution, type WalkthroughStepMedia, };
59
40
  /**
60
- * This interface describes a package.json contribution section object.
41
+ * Strict `contributes` typing for scanned plugin packages.
61
42
  */
62
- export interface PluginPackageContribution {
63
- authentication?: PluginPackageAuthenticationProvider[];
64
- configuration?: JSONObject | JSONObject[];
65
- configurationDefaults?: JSONObject;
66
- languages?: PluginPackageLanguageContribution[];
67
- grammars?: PluginPackageGrammarsContribution[];
68
- customEditors?: PluginPackageCustomEditor[];
69
- viewsContainers?: {
70
- [location: string]: PluginPackageViewContainer[];
71
- };
72
- views?: {
73
- [location: string]: PluginPackageView[];
74
- };
75
- viewsWelcome?: PluginPackageViewWelcome[];
76
- commands?: PluginPackageCommand | PluginPackageCommand[];
77
- menus?: {
78
- [location: string]: PluginPackageMenu[];
79
- };
80
- submenus?: PluginPackageSubmenu[];
81
- keybindings?: PluginPackageKeybinding | PluginPackageKeybinding[];
82
- debuggers?: PluginPackageDebuggersContribution[];
83
- snippets?: PluginPackageSnippetsContribution[];
84
- themes?: PluginThemeContribution[];
85
- iconThemes?: PluginIconThemeContribution[];
86
- icons?: PluginIconContribution[];
87
- colors?: PluginColorContribution[];
88
- taskDefinitions?: PluginTaskDefinitionContribution[];
43
+ export interface PluginPackageContribution extends PluginManifestContribution {
89
44
  problemMatchers?: PluginProblemMatcherContribution[];
90
45
  problemPatterns?: PluginProblemPatternContribution[];
91
- jsonValidation?: PluginJsonValidationContribution[];
92
46
  resourceLabelFormatters?: ResourceLabelFormatter[];
93
- localizations?: PluginPackageLocalization[];
94
- terminal?: PluginPackageTerminal;
95
- notebooks?: PluginPackageNotebook[];
96
- notebookRenderer?: PluginNotebookRendererContribution[];
97
- notebookPreload?: PluginPackageNotebookPreload[];
98
- mcpServerDefinitionProviders?: PluginPackageMcpServerDefinitionProviderContribution[];
99
- languageModelTools?: PluginPackageLanguageModelToolContribution[];
100
- }
101
- export interface PluginPackageNotebook {
102
- type: string;
103
- displayName: string;
104
- selector?: readonly {
105
- filenamePattern?: string;
106
- excludeFileNamePattern?: string;
107
- }[];
108
- priority?: string;
109
- }
110
- export interface PluginNotebookRendererContribution {
111
- readonly id: string;
112
- readonly displayName: string;
113
- readonly mimeTypes: string[];
114
- readonly entrypoint: string | {
115
- readonly extends: string;
116
- readonly path: string;
117
- };
118
- readonly requiresMessaging?: 'always' | 'optional' | 'never';
119
- }
120
- export interface PluginPackageNotebookPreload {
121
- type: string;
122
- entrypoint: string;
123
- }
124
- export interface PluginPackageMcpServerDefinitionProviderContribution {
125
- id: string;
126
- label: string;
127
- description?: string;
128
- }
129
- export interface PluginPackageLanguageModelToolContribution {
130
- name: string;
131
- modelDescription?: string;
132
- userDescription?: string;
133
- inputSchema?: object;
134
- tags?: string[];
135
- }
136
- export interface PluginPackageAuthenticationProvider {
137
- id: string;
138
- label: string;
139
- }
140
- export interface PluginPackageTerminalProfile {
141
- title: string;
142
- id: string;
143
- icon?: string;
144
- }
145
- export interface PluginPackageTerminal {
146
- profiles: PluginPackageTerminalProfile[];
147
- }
148
- export interface PluginPackageLocalization {
149
- languageId: string;
150
- languageName?: string;
151
- localizedLanguageName?: string;
152
- translations: PluginPackageTranslation[];
153
- minimalTranslations?: {
154
- [key: string]: string;
155
- };
156
- }
157
- export interface PluginPackageTranslation {
158
- id: string;
159
- path: string;
160
- }
161
- export interface PluginPackageCustomEditor {
162
- viewType: string;
163
- displayName: string;
164
- selector?: CustomEditorSelector[];
165
- priority?: CustomEditorPriority;
166
- }
167
- export interface CustomEditorSelector {
168
- readonly filenamePattern?: string;
169
- }
170
- export declare enum CustomEditorPriority {
171
- default = "default",
172
- builtin = "builtin",
173
- option = "option"
174
- }
175
- export interface PluginPackageViewContainer {
176
- id: string;
177
- title: string;
178
- icon: string;
179
- when?: string;
180
- }
181
- export declare enum PluginViewType {
182
- Tree = "tree",
183
- Webview = "webview"
184
- }
185
- export interface PluginPackageView {
186
- id: string;
187
- name: string;
188
- when?: string;
189
- type?: string;
190
- }
191
- export interface PluginPackageViewWelcome {
192
- view: string;
193
- contents: string;
194
- when?: string;
195
- enablement?: string;
196
- }
197
- export interface PluginPackageCommand {
198
- command: string;
199
- title: string;
200
- shortTitle?: string;
201
- original?: string;
202
- category?: string;
203
- icon?: string | {
204
- light: string;
205
- dark: string;
206
- };
207
- enablement?: string;
208
- }
209
- export interface PluginPackageMenu {
210
- command?: string;
211
- submenu?: string;
212
- alt?: string;
213
- group?: string;
214
- when?: string;
215
- }
216
- export interface PluginPackageSubmenu {
217
- id: string;
218
- label: string;
219
- icon: IconUrl;
220
- }
221
- export interface PluginPackageKeybinding {
222
- key?: string;
223
- command: string;
224
- when?: string;
225
- mac?: string;
226
- linux?: string;
227
- win?: string;
228
- args?: any;
229
- }
230
- export interface PluginPackageGrammarsContribution {
231
- language?: string;
232
- scopeName: string;
233
- path: string;
234
- embeddedLanguages?: ScopeMap;
235
- tokenTypes?: ScopeMap;
236
- injectTo?: string[];
237
- }
238
- export interface ScopeMap {
239
- [scopeName: string]: string;
240
- }
241
- export interface PluginPackageSnippetsContribution {
242
- language?: string;
243
- path?: string;
244
- }
245
- export interface PluginColorContribution {
246
- id?: string;
247
- description?: string;
248
- defaults?: {
249
- light?: string;
250
- dark?: string;
251
- highContrast?: string;
252
- };
253
- }
254
- export type PluginUiTheme = 'vs' | 'vs-dark' | 'hc-black';
255
- export interface PluginThemeContribution {
256
- id?: string;
257
- label?: string;
258
- description?: string;
259
- path?: string;
260
- uiTheme?: PluginUiTheme;
261
- }
262
- export interface PluginIconThemeContribution {
263
- id?: string;
264
- label?: string;
265
- description?: string;
266
- path?: string;
267
- uiTheme?: PluginUiTheme;
268
- }
269
- export interface PluginIconContribution {
270
- [id: string]: {
271
- description: string;
272
- default: {
273
- fontPath: string;
274
- fontCharacter: string;
275
- } | string;
276
- };
277
- }
278
- export interface PlatformSpecificAdapterContribution {
279
- program?: string;
280
- args?: string[];
281
- runtime?: string;
282
- runtimeArgs?: string[];
283
- }
284
- /**
285
- * This interface describes a package.json debuggers contribution section object.
286
- */
287
- export interface PluginPackageDebuggersContribution extends PlatformSpecificAdapterContribution {
288
- type: string;
289
- label?: string;
290
- languages?: string[];
291
- enableBreakpointsFor?: {
292
- languageIds: string[];
293
- };
294
- configurationAttributes: {
295
- [request: string]: IJSONSchema;
296
- };
297
- configurationSnippets: IJSONSchemaSnippet[];
298
- variables?: ScopeMap;
299
- adapterExecutableCommand?: string;
300
- win?: PlatformSpecificAdapterContribution;
301
- winx86?: PlatformSpecificAdapterContribution;
302
- windows?: PlatformSpecificAdapterContribution;
303
- osx?: PlatformSpecificAdapterContribution;
304
- linux?: PlatformSpecificAdapterContribution;
305
- }
306
- /**
307
- * This interface describes a package.json languages contribution section object.
308
- */
309
- export interface PluginPackageLanguageContribution {
310
- id: string;
311
- extensions?: string[];
312
- filenames?: string[];
313
- filenamePatterns?: string[];
314
- firstLine?: string;
315
- aliases?: string[];
316
- mimetypes?: string[];
317
- configuration?: string;
318
- icon?: IconUrl;
319
- }
320
- export interface PluginPackageLanguageContributionConfiguration {
321
- comments?: CommentRule;
322
- brackets?: CharacterPair[];
323
- autoClosingPairs?: (CharacterPair | AutoClosingPairConditional)[];
324
- surroundingPairs?: (CharacterPair | AutoClosingPair)[];
325
- wordPattern?: string;
326
- indentationRules?: IndentationRules;
327
- folding?: FoldingRules;
328
- onEnterRules?: OnEnterRule[];
329
- }
330
- export interface PluginTaskDefinitionContribution {
331
- type: string;
332
- required: string[];
333
- properties?: IJSONSchema['properties'];
334
47
  }
335
48
  export interface PluginProblemMatcherContribution extends ProblemMatcherContribution {
336
49
  name: string;
@@ -338,10 +51,6 @@ export interface PluginProblemMatcherContribution extends ProblemMatcherContribu
338
51
  export interface PluginProblemPatternContribution extends ProblemPatternContribution {
339
52
  name: string;
340
53
  }
341
- export interface PluginJsonValidationContribution {
342
- fileMatch: string | string[];
343
- url: string;
344
- }
345
54
  export declare const PluginScanner: unique symbol;
346
55
  /**
347
56
  * This scanner process package.json object and returns plugin metadata objects.
@@ -420,13 +129,6 @@ export declare enum PluginDeployerEntryType {
420
129
  BACKEND = 1,
421
130
  HEADLESS = 2
422
131
  }
423
- /**
424
- * Whether a plugin installed by a user or system.
425
- */
426
- export declare enum PluginType {
427
- System = 0,
428
- User = 1
429
- }
430
132
  export interface UnresolvedPluginEntry {
431
133
  id: string;
432
134
  type?: PluginType;
@@ -488,356 +190,68 @@ export interface PluginDeployerDirectoryHandlerContext {
488
190
  pluginEntry(): PluginDeployerEntry;
489
191
  }
490
192
  /**
491
- * This interface describes a plugin model object, which is populated from package.json.
492
- */
493
- export interface PluginModel {
494
- id: string;
495
- name: string;
496
- publisher: string;
497
- version: string;
498
- displayName: string;
499
- description: string;
500
- engine: {
501
- type: PluginEngine;
502
- version: string;
503
- };
504
- entryPoint: PluginEntryPoint;
505
- packageUri: string;
506
- /**
507
- * @deprecated since 1.1.0 - because it lead to problems with getting a relative path
508
- * needed by Icon Themes to correctly load Fonts, use packageUri instead.
509
- */
510
- packagePath: string;
511
- iconUrl?: string;
512
- l10n?: string;
513
- readmeUrl?: string;
514
- licenseUrl?: string;
515
- untrustedWorkspacesSupport?: boolean | 'limited';
516
- }
517
- export interface PluginEntryPoint {
518
- frontend?: string;
519
- backend?: string;
520
- headless?: string;
521
- }
522
- /**
523
- * This interface describes some static plugin contributions.
193
+ * Static plugin contributions after normalization.
194
+ * Narrows shim/`unknown` fields from {@link NormalizedPluginContribution} to core/task types.
524
195
  */
525
- export interface PluginContribution {
526
- activationEvents?: string[];
527
- authentication?: AuthenticationProviderInformation[];
196
+ export type PluginContribution = Omit<NormalizedPluginContribution, 'configuration' | 'colors' | 'taskDefinitions' | 'problemMatchers' | 'problemPatterns' | 'resourceLabelFormatters'> & {
528
197
  configuration?: PreferenceSchema[];
529
- configurationDefaults?: JSONObject;
530
- languages?: LanguageContribution[];
531
- grammars?: GrammarsContribution[];
532
- customEditors?: CustomEditor[];
533
- viewsContainers?: {
534
- [location: string]: ViewContainer[];
535
- };
536
- views?: {
537
- [location: string]: View[];
538
- };
539
- viewsWelcome?: ViewWelcome[];
540
- commands?: PluginCommand[];
541
- menus?: {
542
- [location: string]: Menu[];
543
- };
544
- submenus?: Submenu[];
545
- keybindings?: Keybinding[];
546
- debuggers?: DebuggerContribution[];
547
- snippets?: SnippetContribution[];
548
- themes?: ThemeContribution[];
549
- iconThemes?: IconThemeContribution[];
550
- icons?: IconContribution[];
551
198
  colors?: ColorDefinition[];
552
199
  taskDefinitions?: TaskDefinition[];
553
200
  problemMatchers?: ProblemMatcherContribution[];
554
201
  problemPatterns?: ProblemPatternContribution[];
555
202
  resourceLabelFormatters?: ResourceLabelFormatter[];
556
- localizations?: Localization[];
557
- terminalProfiles?: TerminalProfile[];
558
- notebooks?: NotebookContribution[];
559
- notebookRenderer?: NotebookRendererContribution[];
560
- notebookPreload?: notebookPreloadContribution[];
561
- }
562
- export interface NotebookContribution {
563
- type: string;
564
- displayName: string;
565
- selector?: readonly {
566
- filenamePattern?: string;
567
- excludeFileNamePattern?: string;
568
- }[];
569
- priority?: string;
570
- }
571
- export interface NotebookRendererContribution {
572
- readonly id: string;
573
- readonly displayName: string;
574
- readonly mimeTypes: string[];
575
- readonly entrypoint: string | {
576
- readonly extends: string;
577
- readonly path: string;
578
- };
579
- readonly requiresMessaging?: 'always' | 'optional' | 'never';
580
- }
581
- export interface notebookPreloadContribution {
582
- type: string;
583
- entrypoint: string;
584
- }
585
- export interface AuthenticationProviderInformation {
586
- id: string;
587
- label: string;
588
- }
589
- export interface TerminalProfile {
590
- title: string;
591
- id: string;
592
- icon?: string;
593
- }
594
- export interface Localization {
595
- languageId: string;
596
- languageName?: string;
597
- localizedLanguageName?: string;
598
- translations: Translation[];
599
- minimalTranslations?: {
600
- [key: string]: string;
601
- };
602
- }
603
- export interface Translation {
604
- id: string;
605
- path: string;
606
- cachedContents?: {
607
- [scope: string]: {
608
- [key: string]: string;
609
- };
610
- };
611
- }
612
- export interface SnippetContribution {
613
- uri: string;
614
- source: string;
615
- language?: string;
616
- }
617
- export type UiTheme = 'vs' | 'vs-dark' | 'hc-black';
618
- export interface ThemeContribution {
619
- id?: string;
620
- label?: string;
621
- description?: string;
622
- uri: string;
623
- uiTheme?: UiTheme;
624
- }
625
- export interface IconThemeContribution {
626
- id: string;
627
- label?: string;
628
- description?: string;
629
- uri: string;
630
- uiTheme?: UiTheme;
631
- }
632
- export interface IconDefinition {
203
+ };
204
+ export type NotebookContribution = PluginPackageNotebook;
205
+ export type NotebookRendererContribution = PluginNotebookRendererContribution;
206
+ export type notebookPreloadContribution = PluginPackageNotebookPreload;
207
+ export type AuthenticationProviderInformation = PluginPackageAuthenticationProvider;
208
+ export type TerminalProfile = NormalizedTerminalProfile;
209
+ export type Localization = NormalizedLocalization;
210
+ export type Translation = NormalizedTranslation;
211
+ export type SnippetContribution = NormalizedSnippet;
212
+ export type UiTheme = PluginUiTheme;
213
+ export type ThemeContribution = NormalizedTheme;
214
+ export type IconThemeContribution = NormalizedIconTheme;
215
+ export type IconDefinition = Extract<NormalizedIcon['defaults'], {
633
216
  fontCharacter: string;
634
- location: string;
635
- }
636
- export type IconDefaults = ThemeIcon | IconDefinition;
637
- export interface IconContribution {
638
- id: string;
639
- extensionId: string;
640
- description: string | undefined;
641
- defaults: IconDefaults;
642
- }
217
+ }>;
218
+ export type IconDefaults = NormalizedIcon['defaults'];
219
+ export type IconContribution = NormalizedIcon;
643
220
  export declare namespace IconContribution {
644
221
  function isIconDefinition(defaults: IconDefaults): defaults is IconDefinition;
645
222
  }
646
- export interface GrammarsContribution {
647
- format: 'json' | 'plist';
648
- language?: string;
649
- scope: string;
650
- grammar?: string | object;
651
- grammarLocation?: string;
652
- embeddedLanguages?: ScopeMap;
653
- tokenTypes?: ScopeMap;
654
- injectTo?: string[];
655
- balancedBracketScopes?: string[];
656
- unbalancedBracketScopes?: string[];
657
- }
658
223
  /**
659
224
  * The language contribution
660
225
  */
661
- export interface LanguageContribution {
662
- id: string;
663
- extensions?: string[];
664
- filenames?: string[];
665
- filenamePatterns?: string[];
666
- firstLine?: string;
667
- aliases?: string[];
668
- mimetypes?: string[];
669
- configuration?: LanguageConfiguration;
670
- /**
671
- * @internal
672
- */
673
- icon?: IconUrl;
674
- }
675
- export interface RegExpOptions {
676
- pattern: string;
677
- flags?: string;
678
- }
679
- export interface LanguageConfiguration {
680
- brackets?: CharacterPair[];
681
- indentationRules?: IndentationRules;
682
- surroundingPairs?: AutoClosingPair[];
683
- autoClosingPairs?: AutoClosingPairConditional[];
684
- comments?: CommentRule;
685
- folding?: FoldingRules;
686
- wordPattern?: string | RegExpOptions;
687
- onEnterRules?: OnEnterRule[];
688
- }
689
- /**
690
- * This interface describes a package.json debuggers contribution section object.
691
- */
692
- export interface DebuggerContribution extends PlatformSpecificAdapterContribution {
693
- type: string;
694
- label?: string;
695
- languages?: string[];
696
- enableBreakpointsFor?: {
697
- languageIds: string[];
698
- };
699
- configurationAttributes?: {
700
- [request: string]: IJSONSchema;
701
- };
702
- configurationSnippets?: IJSONSchemaSnippet[];
703
- variables?: ScopeMap;
704
- adapterExecutableCommand?: string;
705
- win?: PlatformSpecificAdapterContribution;
706
- winx86?: PlatformSpecificAdapterContribution;
707
- windows?: PlatformSpecificAdapterContribution;
708
- osx?: PlatformSpecificAdapterContribution;
709
- linux?: PlatformSpecificAdapterContribution;
710
- }
711
- export interface IndentationRules {
712
- increaseIndentPattern: string | RegExpOptions;
713
- decreaseIndentPattern: string | RegExpOptions;
714
- unIndentedLinePattern?: string | RegExpOptions;
715
- indentNextLinePattern?: string | RegExpOptions;
716
- }
717
- export interface AutoClosingPair {
718
- close: string;
719
- open: string;
720
- }
721
- export interface AutoClosingPairConditional extends AutoClosingPair {
722
- notIn?: string[];
723
- }
724
- export interface FoldingMarkers {
725
- start: string | RegExpOptions;
726
- end: string | RegExpOptions;
727
- }
728
- export interface FoldingRules {
729
- offSide?: boolean;
730
- markers?: FoldingMarkers;
731
- }
732
- export interface OnEnterRule {
733
- beforeText: string | RegExpOptions;
734
- afterText?: string | RegExpOptions;
735
- previousLineText?: string | RegExpOptions;
736
- action: EnterAction;
737
- }
738
- export interface EnterAction {
739
- indent: 'none' | 'indent' | 'outdent' | 'indentOutdent';
740
- appendText?: string;
741
- removeText?: number;
742
- }
226
+ export type LanguageContribution = NormalizedLanguage;
227
+ export type LanguageConfiguration = NormalizedLanguageConfiguration;
228
+ export type DebuggerContribution = PluginPackageDebuggersContribution;
743
229
  /**
744
230
  * Custom Editors contribution
745
231
  */
746
- export interface CustomEditor {
747
- viewType: string;
748
- displayName: string;
749
- selector: CustomEditorSelector[];
750
- priority: CustomEditorPriority;
751
- }
232
+ export type CustomEditor = NormalizedCustomEditor;
752
233
  /**
753
234
  * Views Containers contribution
754
235
  */
755
- export interface ViewContainer {
756
- id: string;
757
- title: string;
758
- iconUrl: string;
759
- themeIcon?: string;
760
- when?: string;
761
- }
236
+ export type ViewContainer = NormalizedViewContainer;
762
237
  /**
763
238
  * View contribution
764
239
  */
765
- export interface View {
766
- id: string;
767
- name: string;
768
- when?: string;
769
- type?: string;
770
- }
240
+ export type View = PluginPackageView;
771
241
  /**
772
242
  * View Welcome contribution
773
243
  */
774
- export interface ViewWelcome {
775
- view: string;
776
- content: string;
777
- when?: string;
778
- enablement?: string;
779
- order: number;
780
- }
781
- export interface PluginCommand {
782
- command: string;
783
- title: string;
784
- shortTitle?: string;
785
- originalTitle?: string;
786
- category?: string;
787
- iconUrl?: IconUrl;
788
- themeIcon?: string;
789
- enablement?: string;
790
- }
791
- export type IconUrl = string | {
792
- light: string;
793
- dark: string;
794
- };
244
+ export type ViewWelcome = NormalizedViewWelcome;
245
+ export type PluginCommand = NormalizedCommand;
795
246
  /**
796
247
  * Menu contribution
797
248
  */
798
- export interface Menu {
799
- command?: string;
800
- submenu?: string;
801
- alt?: string;
802
- group?: string;
803
- when?: string;
804
- }
805
- export interface Submenu {
806
- id: string;
807
- label: string;
808
- icon?: IconUrl;
809
- }
249
+ export type Menu = PluginPackageMenu;
250
+ export type Submenu = NormalizedSubmenu;
810
251
  /**
811
252
  * Keybinding contribution
812
253
  */
813
- export interface Keybinding {
814
- keybinding?: string;
815
- command: string;
816
- when?: string;
817
- mac?: string;
818
- linux?: string;
819
- win?: string;
820
- args?: any;
821
- }
822
- /**
823
- * This interface describes a plugin lifecycle object.
824
- */
825
- export interface PluginLifecycle {
826
- startMethod: string;
827
- stopMethod: string;
828
- /**
829
- * Frontend module name, frontend plugin should expose this name.
830
- */
831
- frontendModuleName?: string;
832
- /**
833
- * Path to the script which should do some initialization before frontend plugin is loaded.
834
- */
835
- frontendInitPath?: string;
836
- /**
837
- * Path to the script which should do some initialization before backend plugin is loaded.
838
- */
839
- backendInitPath?: string;
840
- }
254
+ export type Keybinding = NormalizedKeybinding;
841
255
  /**
842
256
  * The export function of initialization module of backend plugin.
843
257
  */
@@ -853,19 +267,10 @@ export interface PluginContext {
853
267
  export interface ExtensionContext {
854
268
  subscriptions: Disposable[];
855
269
  }
856
- export interface PluginMetadata {
857
- host: string;
858
- model: PluginModel;
859
- lifecycle: PluginLifecycle;
860
- isUnderDevelopment?: boolean;
861
- outOfSync: boolean;
862
- }
863
270
  export declare const MetadataProcessor: unique symbol;
864
271
  export interface MetadataProcessor {
865
272
  process(pluginMetadata: PluginMetadata): void;
866
273
  }
867
- export declare function getPluginId(plugin: PluginPackage | PluginModel): string;
868
- export declare function buildFrontendModuleName(plugin: PluginPackage | PluginModel): string;
869
274
  export declare const HostedPluginClient: unique symbol;
870
275
  export interface HostedPluginClient {
871
276
  postMessage(pluginHost: string, buffer: Uint8Array): Promise<void>;
@@ -914,14 +319,7 @@ export interface PluginDeployerHandler {
914
319
  */
915
320
  enablePlugin(pluginId: PluginIdentifiers.UnversionedId): Promise<boolean>;
916
321
  }
917
- export interface DeployedPlugin {
918
- /**
919
- * defaults to system
920
- */
921
- type?: PluginType;
922
- metadata: PluginMetadata;
923
- contributes?: PluginContribution;
924
- }
322
+ export type DeployedPlugin = DeployedPluginBase<PluginContribution>;
925
323
  export declare const HostedPluginServer: unique symbol;
926
324
  export interface HostedPluginServer extends RpcServer<HostedPluginClient> {
927
325
  getDeployedPluginIds(): Promise<PluginIdentifiers.VersionedId[]>;
@@ -932,7 +330,6 @@ export interface HostedPluginServer extends RpcServer<HostedPluginClient> {
932
330
  getExtPluginAPI(): Promise<ExtPluginApi[]>;
933
331
  onMessage(targetHost: string, message: Uint8Array): Promise<void>;
934
332
  }
935
- export declare const PLUGIN_HOST_BACKEND = "main";
936
333
  export interface WorkspaceStorageKind {
937
334
  workspace?: string | undefined;
938
335
  roots: string[];