@theia/plugin 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.29.0-next.9+7b29ac6f2d1",
3
+ "version": "1.30.0-next.1+77e8a6029f3",
4
4
  "description": "Theia - Plugin API",
5
5
  "types": "./src/theia.d.ts",
6
6
  "publishConfig": {
@@ -27,10 +27,10 @@
27
27
  "watch": "theiaext watch"
28
28
  },
29
29
  "devDependencies": {
30
- "@theia/ext-scripts": "1.28.0"
30
+ "@theia/ext-scripts": "1.29.0"
31
31
  },
32
32
  "nyc": {
33
33
  "extends": "../../configs/nyc.json"
34
34
  },
35
- "gitHead": "7b29ac6f2d1a75b44b5c5d37ec7ae0200e0c3e99"
35
+ "gitHead": "77e8a6029f3d83183f823fd7a53ccdaa54beb47d"
36
36
  }
@@ -21,130 +21,6 @@
21
21
  * These API are NOT stable and subject to change. Use it on own risk.
22
22
  */
23
23
  export module '@theia/plugin' {
24
- // #region auth provider
25
-
26
- /**
27
- * An [event](#Event) which fires when an [AuthenticationProvider](#AuthenticationProvider) is added or removed.
28
- */
29
- export interface AuthenticationProvidersChangeEvent {
30
- /**
31
- * The ids of the [authenticationProvider](#AuthenticationProvider)s that have been added.
32
- */
33
- readonly added: ReadonlyArray<AuthenticationProviderInformation>;
34
-
35
- /**
36
- * The ids of the [authenticationProvider](#AuthenticationProvider)s that have been removed.
37
- */
38
- readonly removed: ReadonlyArray<AuthenticationProviderInformation>;
39
- }
40
-
41
- /**
42
- * An [event](#Event) which fires when an [AuthenticationSession](#AuthenticationSession) is added, removed, or changed.
43
- */
44
- export interface AuthenticationProviderAuthenticationSessionsChangeEvent {
45
- /**
46
- * The ids of the [AuthenticationSession](#AuthenticationSession)s that have been added.
47
- */
48
- readonly added: ReadonlyArray<string>;
49
-
50
- /**
51
- * The ids of the [AuthenticationSession](#AuthenticationSession)s that have been removed.
52
- */
53
- readonly removed: ReadonlyArray<string>;
54
-
55
- /**
56
- * The ids of the [AuthenticationSession](#AuthenticationSession)s that have been changed.
57
- */
58
- readonly changed: ReadonlyArray<string>;
59
- }
60
-
61
- /**
62
- * **WARNING** When writing an AuthenticationProvider, `id` should be treated as part of your extension's
63
- * API, changing it is a breaking change for all extensions relying on the provider. The id is
64
- * treated case-sensitively.
65
- */
66
- export interface AuthenticationProvider {
67
- /**
68
- * Used as an identifier for extensions trying to work with a particular
69
- * provider: 'microsoft', 'github', etc. id must be unique, registering
70
- * another provider with the same id will fail.
71
- */
72
- readonly id: string;
73
-
74
- /**
75
- * The human-readable name of the provider.
76
- */
77
- readonly label: string;
78
-
79
- /**
80
- * Whether it is possible to be signed into multiple accounts at once with this provider
81
- */
82
- readonly supportsMultipleAccounts: boolean;
83
-
84
- /**
85
- * Returns an array of current sessions.
86
- */
87
- getSessions(): Thenable<ReadonlyArray<AuthenticationSession>>;
88
-
89
- /**
90
- * Prompts a user to login.
91
- */
92
- login(scopes: string[]): Thenable<AuthenticationSession>;
93
-
94
- /**
95
- * Removes the session corresponding to session id.
96
- * @param sessionId The session id to log out of
97
- */
98
- logout(sessionId: string): Thenable<void>;
99
- }
100
-
101
- export namespace authentication {
102
- /**
103
- * Register an authentication provider.
104
- *
105
- * There can only be one provider per id and an error is being thrown when an id
106
- * has already been used by another provider.
107
- *
108
- * @param provider The authentication provider provider.
109
- * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
110
- */
111
- export function registerAuthenticationProvider(provider: AuthenticationProvider): Disposable;
112
-
113
- /**
114
- * Fires with the provider id that was registered or unregistered.
115
- */
116
- export const onDidChangeAuthenticationProviders: Event<AuthenticationProvidersChangeEvent>;
117
-
118
- /**
119
- * @deprecated
120
- * The ids of the currently registered authentication providers.
121
- * @returns An array of the ids of authentication providers that are currently registered.
122
- */
123
- export function getProviderIds(): Thenable<ReadonlyArray<string>>;
124
-
125
- /**
126
- * @deprecated
127
- * An array of the ids of authentication providers that are currently registered.
128
- */
129
- export const providerIds: ReadonlyArray<string>;
130
-
131
- /**
132
- * An array of the information of authentication providers that are currently registered.
133
- */
134
- export const providers: ReadonlyArray<AuthenticationProviderInformation>;
135
-
136
- /**
137
- * @deprecated
138
- * Logout of a specific session.
139
- * @param providerId The id of the provider to use
140
- * @param sessionId The session id to remove
141
- * provider
142
- */
143
- export function logout(providerId: string, sessionId: string): Thenable<void>;
144
- }
145
-
146
- // #endregion
147
-
148
24
  /**
149
25
  * The contiguous set of modified lines in a diff.
150
26
  */
@@ -456,6 +332,23 @@ export module '@theia/plugin' {
456
332
  matches: Range | Range[];
457
333
  }
458
334
 
335
+ /**
336
+ * Options to specify the size of the result text preview.
337
+ * These options don't affect the size of the match itself, just the amount of preview text.
338
+ */
339
+ export interface TextSearchPreviewOptions {
340
+ /**
341
+ * The maximum number of lines in the preview.
342
+ * Only search providers that support multiline search will ever return more than one line in the match.
343
+ */
344
+ matchLines: number;
345
+
346
+ /**
347
+ * The maximum number of characters included per line.
348
+ */
349
+ charsPerLine: number;
350
+ }
351
+
459
352
  /**
460
353
  * A line of context surrounding a TextSearchMatch.
461
354
  */
@@ -492,6 +385,18 @@ export module '@theia/plugin' {
492
385
  */
493
386
  limitHit?: boolean;
494
387
  }
388
+
389
+ export namespace workspace {
390
+ /**
391
+ * Find text in files across all [workspace folders] in the workspace
392
+ * @param query What to search
393
+ * @param optionsOrCallback
394
+ * @param callbackOrToken
395
+ * @param token
396
+ */
397
+ export function findTextInFiles(query: TextSearchQuery, optionsOrCallback: FindTextInFilesOptions | ((result: TextSearchResult) => void),
398
+ callbackOrToken?: CancellationToken | ((result: TextSearchResult) => void), token?: CancellationToken): Promise<TextSearchComplete>;
399
+ }
495
400
  // #endregion
496
401
 
497
402
  // #region read/write in chunks: https://github.com/microsoft/vscode/issues/84515
@@ -705,3 +610,21 @@ export module '@theia/plugin' {
705
610
 
706
611
  // #endregion
707
612
  }
613
+
614
+ /**
615
+ * Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise,
616
+ * and others. This API makes no assumption about what promise library is being used which
617
+ * enables reusing existing code without migrating to a specific promise implementation. Still,
618
+ * we recommend the use of native promises which are available in this editor.
619
+ */
620
+ interface Thenable<T> {
621
+ /**
622
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
623
+ * @param onfulfilled The callback to execute when the Promise is resolved.
624
+ * @param onrejected The callback to execute when the Promise is rejected.
625
+ * @returns A Promise for the completion of which ever callback is executed.
626
+ */
627
+ then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
628
+ then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
629
+ }
630
+