@theia/plugin-ext 1.55.0-next.4 → 1.55.0
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-model.d.ts +1 -0
- package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +1 -0
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/main/browser/authentication-main.d.ts +1 -0
- package/lib/main/browser/authentication-main.d.ts.map +1 -1
- package/lib/main/browser/command-registry-main.d.ts +1 -0
- package/lib/main/browser/command-registry-main.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts +1 -0
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-service.d.ts +1 -0
- package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
- package/lib/main/browser/editors-and-documents-main.js +6 -3
- package/lib/main/browser/editors-and-documents-main.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts +1 -0
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +8 -7
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -1
- package/lib/main/browser/notebooks/notebooks-main.d.ts +5 -12
- package/lib/main/browser/notebooks/notebooks-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/notebooks-main.js +6 -4
- package/lib/main/browser/notebooks/notebooks-main.js.map +1 -1
- package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts +22 -12
- package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -1
- package/lib/main/browser/notebooks/renderers/cell-output-webview.js +145 -74
- package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -1
- package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -1
- package/lib/main/browser/notebooks/renderers/output-webview-internal.js +198 -69
- package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -1
- package/lib/main/browser/notebooks/renderers/webview-communication.d.ts +56 -6
- package/lib/main/browser/notebooks/renderers/webview-communication.d.ts.map +1 -1
- package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
- package/lib/main/browser/plugin-ext-frontend-module.js +2 -1
- package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
- package/lib/main/browser/quick-open-main.d.ts +1 -0
- package/lib/main/browser/quick-open-main.d.ts.map +1 -1
- package/lib/main/browser/tabs/tabs-main.d.ts +2 -0
- package/lib/main/browser/tabs/tabs-main.d.ts.map +1 -1
- package/lib/main/browser/tabs/tabs-main.js +17 -2
- package/lib/main/browser/tabs/tabs-main.js.map +1 -1
- package/lib/main/browser/terminal-main.d.ts +1 -0
- package/lib/main/browser/terminal-main.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-decorator-service.d.ts +1 -0
- package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +1 -0
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-views-main.d.ts +1 -0
- package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.d.ts +1 -0
- package/lib/main/browser/webview/webview.d.ts.map +1 -1
- package/lib/main/browser/webview-views/webview-views-main.d.ts +1 -0
- package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
- package/lib/main/browser/webviews-main.d.ts +1 -0
- package/lib/main/browser/webviews-main.d.ts.map +1 -1
- package/lib/main/browser/workspace-main.d.ts +1 -0
- package/lib/main/browser/workspace-main.d.ts.map +1 -1
- package/lib/plugin/authentication-ext.d.ts +1 -0
- package/lib/plugin/authentication-ext.d.ts.map +1 -1
- package/lib/plugin/clipboard-ext.d.ts +1 -0
- package/lib/plugin/clipboard-ext.d.ts.map +1 -1
- package/lib/plugin/command-registry.d.ts +1 -0
- package/lib/plugin/command-registry.d.ts.map +1 -1
- package/lib/plugin/comments.d.ts +1 -0
- package/lib/plugin/comments.d.ts.map +1 -1
- package/lib/plugin/custom-editors.d.ts +1 -0
- package/lib/plugin/custom-editors.d.ts.map +1 -1
- package/lib/plugin/debug/debug-ext.d.ts +1 -0
- package/lib/plugin/debug/debug-ext.d.ts.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +1 -0
- package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-session.d.ts +1 -0
- package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts +1 -0
- package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts.map +1 -1
- package/lib/plugin/decorations.d.ts +1 -0
- package/lib/plugin/decorations.d.ts.map +1 -1
- package/lib/plugin/dialogs.d.ts +1 -0
- package/lib/plugin/dialogs.d.ts.map +1 -1
- package/lib/plugin/document-data.d.ts +1 -0
- package/lib/plugin/document-data.d.ts.map +1 -1
- package/lib/plugin/documents.d.ts +1 -0
- package/lib/plugin/documents.d.ts.map +1 -1
- package/lib/plugin/env.d.ts +1 -0
- package/lib/plugin/env.d.ts.map +1 -1
- package/lib/plugin/file-system-event-service-ext-impl.d.ts +17 -1
- package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
- package/lib/plugin/file-system-event-service-ext-impl.js +9 -7
- package/lib/plugin/file-system-event-service-ext-impl.js.map +1 -1
- package/lib/plugin/file-system-ext-impl.d.ts +28 -3
- package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
- package/lib/plugin/file-system-ext-impl.js +4 -2
- package/lib/plugin/file-system-ext-impl.js.map +1 -1
- package/lib/plugin/file-system-watcher.spec.d.ts +2 -0
- package/lib/plugin/file-system-watcher.spec.d.ts.map +1 -0
- package/lib/plugin/file-system-watcher.spec.js +108 -0
- package/lib/plugin/file-system-watcher.spec.js.map +1 -0
- package/lib/plugin/label-service.d.ts +1 -0
- package/lib/plugin/label-service.d.ts.map +1 -1
- package/lib/plugin/languages/call-hierarchy.d.ts +1 -0
- package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
- package/lib/plugin/languages/code-action.d.ts +1 -0
- package/lib/plugin/languages/code-action.d.ts.map +1 -1
- package/lib/plugin/languages/color.d.ts +1 -0
- package/lib/plugin/languages/color.d.ts.map +1 -1
- package/lib/plugin/languages/completion.d.ts +1 -0
- package/lib/plugin/languages/completion.d.ts.map +1 -1
- package/lib/plugin/languages/declaration.d.ts +1 -0
- package/lib/plugin/languages/declaration.d.ts.map +1 -1
- package/lib/plugin/languages/definition.d.ts +1 -0
- package/lib/plugin/languages/definition.d.ts.map +1 -1
- package/lib/plugin/languages/diagnostics.d.ts +1 -0
- package/lib/plugin/languages/diagnostics.d.ts.map +1 -1
- package/lib/plugin/languages/document-drop-edit.d.ts +1 -0
- package/lib/plugin/languages/document-drop-edit.d.ts.map +1 -1
- package/lib/plugin/languages/document-formatting.d.ts +1 -0
- package/lib/plugin/languages/document-formatting.d.ts.map +1 -1
- package/lib/plugin/languages/document-highlight.d.ts +1 -0
- package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
- package/lib/plugin/languages/evaluatable-expression.d.ts +1 -0
- package/lib/plugin/languages/evaluatable-expression.d.ts.map +1 -1
- package/lib/plugin/languages/folding.d.ts +1 -0
- package/lib/plugin/languages/folding.d.ts.map +1 -1
- package/lib/plugin/languages/hover.d.ts +1 -0
- package/lib/plugin/languages/hover.d.ts.map +1 -1
- package/lib/plugin/languages/implementation.d.ts +1 -0
- package/lib/plugin/languages/implementation.d.ts.map +1 -1
- package/lib/plugin/languages/inlay-hints.d.ts +1 -0
- package/lib/plugin/languages/inlay-hints.d.ts.map +1 -1
- package/lib/plugin/languages/inline-completion.d.ts +1 -0
- package/lib/plugin/languages/inline-completion.d.ts.map +1 -1
- package/lib/plugin/languages/inline-values.d.ts +1 -0
- package/lib/plugin/languages/inline-values.d.ts.map +1 -1
- package/lib/plugin/languages/lens.d.ts +1 -0
- package/lib/plugin/languages/lens.d.ts.map +1 -1
- package/lib/plugin/languages/link-provider.d.ts +1 -0
- package/lib/plugin/languages/link-provider.d.ts.map +1 -1
- package/lib/plugin/languages/linked-editing-range.d.ts +1 -0
- package/lib/plugin/languages/linked-editing-range.d.ts.map +1 -1
- package/lib/plugin/languages/on-type-formatting.d.ts +1 -0
- package/lib/plugin/languages/on-type-formatting.d.ts.map +1 -1
- package/lib/plugin/languages/outline.d.ts +1 -0
- package/lib/plugin/languages/outline.d.ts.map +1 -1
- package/lib/plugin/languages/range-formatting.d.ts +1 -0
- package/lib/plugin/languages/range-formatting.d.ts.map +1 -1
- package/lib/plugin/languages/reference.d.ts +1 -0
- package/lib/plugin/languages/reference.d.ts.map +1 -1
- package/lib/plugin/languages/rename.d.ts +1 -0
- package/lib/plugin/languages/rename.d.ts.map +1 -1
- package/lib/plugin/languages/selection-range.d.ts +1 -0
- package/lib/plugin/languages/selection-range.d.ts.map +1 -1
- package/lib/plugin/languages/semantic-highlighting.d.ts +1 -0
- package/lib/plugin/languages/semantic-highlighting.d.ts.map +1 -1
- package/lib/plugin/languages/signature.d.ts +1 -0
- package/lib/plugin/languages/signature.d.ts.map +1 -1
- package/lib/plugin/languages/type-definition.d.ts +1 -0
- package/lib/plugin/languages/type-definition.d.ts.map +1 -1
- package/lib/plugin/languages/type-hierarchy.d.ts +1 -0
- package/lib/plugin/languages/type-hierarchy.d.ts.map +1 -1
- package/lib/plugin/languages/util.d.ts +1 -0
- package/lib/plugin/languages/util.d.ts.map +1 -1
- package/lib/plugin/languages/workspace-symbol.d.ts +1 -0
- package/lib/plugin/languages/workspace-symbol.d.ts.map +1 -1
- package/lib/plugin/languages-utils.d.ts +1 -0
- package/lib/plugin/languages-utils.d.ts.map +1 -1
- package/lib/plugin/languages.d.ts +1 -0
- package/lib/plugin/languages.d.ts.map +1 -1
- package/lib/plugin/markdown-string.d.ts +1 -0
- package/lib/plugin/markdown-string.d.ts.map +1 -1
- package/lib/plugin/message-registry.d.ts +1 -0
- package/lib/plugin/message-registry.d.ts.map +1 -1
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +1 -0
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-document.d.ts +1 -0
- package/lib/plugin/notebook/notebook-document.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-documents.d.ts +1 -0
- package/lib/plugin/notebook/notebook-documents.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-editor.d.ts +1 -0
- package/lib/plugin/notebook/notebook-editor.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-editors.d.ts +1 -0
- package/lib/plugin/notebook/notebook-editors.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-kernels.d.ts +1 -0
- package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-renderers.d.ts +1 -0
- package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -1
- package/lib/plugin/notebook/notebooks.d.ts +4 -2
- package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
- package/lib/plugin/notebook/notebooks.js +2 -2
- package/lib/plugin/notebook/notebooks.js.map +1 -1
- package/lib/plugin/notification.d.ts +1 -0
- package/lib/plugin/notification.d.ts.map +1 -1
- package/lib/plugin/output-channel/log-output-channel.d.ts +1 -0
- package/lib/plugin/output-channel/log-output-channel.d.ts.map +1 -1
- package/lib/plugin/output-channel/output-channel-item.d.ts +1 -0
- package/lib/plugin/output-channel/output-channel-item.d.ts.map +1 -1
- package/lib/plugin/output-channel-registry.d.ts +1 -0
- package/lib/plugin/output-channel-registry.d.ts.map +1 -1
- package/lib/plugin/plugin-context.d.ts +2 -0
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +47 -15
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/plugin-manager.d.ts +1 -0
- package/lib/plugin/plugin-manager.d.ts.map +1 -1
- package/lib/plugin/plugin-storage.d.ts +1 -0
- package/lib/plugin/plugin-storage.d.ts.map +1 -1
- package/lib/plugin/preference-registry.d.ts +1 -0
- package/lib/plugin/preference-registry.d.ts.map +1 -1
- package/lib/plugin/quick-open.d.ts +1 -0
- package/lib/plugin/quick-open.d.ts.map +1 -1
- package/lib/plugin/scm.d.ts +2 -0
- package/lib/plugin/scm.d.ts.map +1 -1
- package/lib/plugin/scm.js +3 -3
- package/lib/plugin/scm.js.map +1 -1
- package/lib/plugin/secrets-ext.d.ts +1 -0
- package/lib/plugin/secrets-ext.d.ts.map +1 -1
- package/lib/plugin/status-bar/status-bar-item.d.ts +1 -0
- package/lib/plugin/status-bar/status-bar-item.d.ts.map +1 -1
- package/lib/plugin/status-bar-message-registry.d.ts +1 -0
- package/lib/plugin/status-bar-message-registry.d.ts.map +1 -1
- package/lib/plugin/tabs.d.ts +1 -0
- package/lib/plugin/tabs.d.ts.map +1 -1
- package/lib/plugin/tasks/task-provider.d.ts +1 -0
- package/lib/plugin/tasks/task-provider.d.ts.map +1 -1
- package/lib/plugin/tasks/tasks.d.ts +1 -0
- package/lib/plugin/tasks/tasks.d.ts.map +1 -1
- package/lib/plugin/terminal-ext.d.ts +1 -0
- package/lib/plugin/terminal-ext.d.ts.map +1 -1
- package/lib/plugin/test-item.d.ts +1 -0
- package/lib/plugin/test-item.d.ts.map +1 -1
- package/lib/plugin/tests.d.ts +1 -0
- package/lib/plugin/tests.d.ts.map +1 -1
- package/lib/plugin/text-editor.d.ts +1 -0
- package/lib/plugin/text-editor.d.ts.map +1 -1
- package/lib/plugin/text-editors.d.ts +1 -0
- package/lib/plugin/text-editors.d.ts.map +1 -1
- package/lib/plugin/timeline.d.ts +1 -0
- package/lib/plugin/timeline.d.ts.map +1 -1
- package/lib/plugin/tree/tree-views.d.ts +1 -0
- package/lib/plugin/tree/tree-views.d.ts.map +1 -1
- package/lib/plugin/type-converters.d.ts +1 -0
- package/lib/plugin/type-converters.d.ts.map +1 -1
- package/lib/plugin/types-impl.d.ts +1 -0
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/uri-ext.d.ts +1 -0
- package/lib/plugin/uri-ext.d.ts.map +1 -1
- package/lib/plugin/webview-views.d.ts +1 -0
- package/lib/plugin/webview-views.d.ts.map +1 -1
- package/lib/plugin/webviews.d.ts +1 -0
- package/lib/plugin/webviews.d.ts.map +1 -1
- package/lib/plugin/window-state.d.ts +2 -1
- package/lib/plugin/window-state.d.ts.map +1 -1
- package/lib/plugin/window-state.js +8 -1
- package/lib/plugin/window-state.js.map +1 -1
- package/lib/plugin/workspace.d.ts +1 -0
- package/lib/plugin/workspace.d.ts.map +1 -1
- package/package.json +29 -29
- package/src/main/browser/editors-and-documents-main.ts +5 -3
- package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +9 -8
- package/src/main/browser/notebooks/notebook-kernels-main.ts +2 -2
- package/src/main/browser/notebooks/notebooks-main.ts +13 -18
- package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +170 -74
- package/src/main/browser/notebooks/renderers/output-webview-internal.ts +237 -73
- package/src/main/browser/notebooks/renderers/webview-communication.ts +78 -7
- package/src/main/browser/plugin-ext-frontend-module.ts +6 -5
- package/src/main/browser/tabs/tabs-main.ts +17 -2
- package/src/plugin/file-system-event-service-ext-impl.ts +11 -8
- package/src/plugin/file-system-ext-impl.ts +7 -3
- package/src/plugin/file-system-watcher.spec.ts +125 -0
- package/src/plugin/notebook/notebooks.ts +5 -5
- package/src/plugin/plugin-context.ts +55 -15
- package/src/plugin/scm.ts +5 -4
- package/src/plugin/window-state.ts +7 -1
|
@@ -48,7 +48,7 @@ type Event<T> = vscode.Event<T>;
|
|
|
48
48
|
type IExtensionDescription = Plugin;
|
|
49
49
|
type IWaitUntil = WaitUntilEvent;
|
|
50
50
|
|
|
51
|
-
class FileSystemWatcher implements vscode.FileSystemWatcher {
|
|
51
|
+
export class FileSystemWatcher implements vscode.FileSystemWatcher {
|
|
52
52
|
|
|
53
53
|
private readonly _onDidCreate = new Emitter<vscode.Uri>();
|
|
54
54
|
private readonly _onDidChange = new Emitter<vscode.Uri>();
|
|
@@ -68,7 +68,8 @@ class FileSystemWatcher implements vscode.FileSystemWatcher {
|
|
|
68
68
|
return Boolean(this._config & 0b100);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
constructor(dispatcher: Event<FileSystemEvents>, globPattern: string | IRelativePattern,
|
|
71
|
+
constructor(dispatcher: Event<FileSystemEvents>, globPattern: string | IRelativePattern,
|
|
72
|
+
ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean, excludes?: string[]) {
|
|
72
73
|
|
|
73
74
|
this._config = 0;
|
|
74
75
|
if (ignoreCreateEvents) {
|
|
@@ -82,12 +83,13 @@ class FileSystemWatcher implements vscode.FileSystemWatcher {
|
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
const parsedPattern = parse(globPattern);
|
|
86
|
+
const excludePatterns = excludes?.map(exclude => parse(exclude)) || [];
|
|
85
87
|
|
|
86
88
|
const subscription = dispatcher(events => {
|
|
87
89
|
if (!ignoreCreateEvents) {
|
|
88
90
|
for (const created of events.created) {
|
|
89
91
|
const uri = URI.revive(created);
|
|
90
|
-
if (parsedPattern(uri.fsPath)) {
|
|
92
|
+
if (parsedPattern(uri.fsPath) && !excludePatterns.some(p => p(uri.fsPath))) {
|
|
91
93
|
this._onDidCreate.fire(uri);
|
|
92
94
|
}
|
|
93
95
|
}
|
|
@@ -95,7 +97,7 @@ class FileSystemWatcher implements vscode.FileSystemWatcher {
|
|
|
95
97
|
if (!ignoreChangeEvents) {
|
|
96
98
|
for (const changed of events.changed) {
|
|
97
99
|
const uri = URI.revive(changed);
|
|
98
|
-
if (parsedPattern(uri.fsPath)) {
|
|
100
|
+
if (parsedPattern(uri.fsPath) && !excludePatterns.some(p => p(uri.fsPath))) {
|
|
99
101
|
this._onDidChange.fire(uri);
|
|
100
102
|
}
|
|
101
103
|
}
|
|
@@ -103,7 +105,7 @@ class FileSystemWatcher implements vscode.FileSystemWatcher {
|
|
|
103
105
|
if (!ignoreDeleteEvents) {
|
|
104
106
|
for (const deleted of events.deleted) {
|
|
105
107
|
const uri = URI.revive(deleted);
|
|
106
|
-
if (parsedPattern(uri.fsPath)) {
|
|
108
|
+
if (parsedPattern(uri.fsPath) && !excludePatterns.some(p => p(uri.fsPath))) {
|
|
107
109
|
this._onDidDelete.fire(uri);
|
|
108
110
|
}
|
|
109
111
|
}
|
|
@@ -113,7 +115,7 @@ class FileSystemWatcher implements vscode.FileSystemWatcher {
|
|
|
113
115
|
this._disposable = Disposable.from(this._onDidCreate, this._onDidChange, this._onDidDelete, subscription);
|
|
114
116
|
}
|
|
115
117
|
|
|
116
|
-
dispose() {
|
|
118
|
+
dispose(): void {
|
|
117
119
|
this._disposable.dispose();
|
|
118
120
|
}
|
|
119
121
|
|
|
@@ -160,8 +162,9 @@ export class ExtHostFileSystemEventService implements ExtHostFileSystemEventServ
|
|
|
160
162
|
|
|
161
163
|
// --- file events
|
|
162
164
|
|
|
163
|
-
createFileSystemWatcher(globPattern: string | IRelativePattern, ignoreCreateEvents?: boolean,
|
|
164
|
-
|
|
165
|
+
createFileSystemWatcher(globPattern: string | IRelativePattern, ignoreCreateEvents?: boolean,
|
|
166
|
+
ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean, excludes?: string[]): vscode.FileSystemWatcher {
|
|
167
|
+
return new FileSystemWatcher(this._onFileSystemEvent.event, globPattern, ignoreCreateEvents, ignoreChangeEvents, ignoreDeleteEvents, excludes);
|
|
165
168
|
}
|
|
166
169
|
|
|
167
170
|
$onFileEvent(events: FileSystemEvents) {
|
|
@@ -40,8 +40,9 @@ import { State, StateMachine, LinkComputer, Edge } from '../common/link-computer
|
|
|
40
40
|
import { commonPrefixLength } from '@theia/core/lib/common/strings';
|
|
41
41
|
import { CharCode } from '@theia/core/lib/common/char-code';
|
|
42
42
|
import { BinaryBuffer } from '@theia/core/lib/common/buffer';
|
|
43
|
-
import { Emitter } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
44
43
|
import { MarkdownString } from '../common/plugin-api-rpc-model';
|
|
44
|
+
import { Emitter } from '@theia/core/lib/common';
|
|
45
|
+
import { createAPIObject } from './plugin-context';
|
|
45
46
|
|
|
46
47
|
type IDisposable = vscode.Disposable;
|
|
47
48
|
|
|
@@ -137,8 +138,11 @@ export class FsLinkProvider {
|
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
class ConsumerFileSystem implements vscode.FileSystem {
|
|
141
|
+
apiObject: vscode.FileSystem;
|
|
140
142
|
|
|
141
|
-
constructor(private _proxy: FileSystemMain, private _capabilities: Map<string, number>) {
|
|
143
|
+
constructor(private _proxy: FileSystemMain, private _capabilities: Map<string, number>) {
|
|
144
|
+
this.apiObject = createAPIObject(this);
|
|
145
|
+
}
|
|
142
146
|
|
|
143
147
|
stat(uri: vscode.Uri): Promise<vscode.FileStat> {
|
|
144
148
|
return this._proxy.$stat(uri).catch(ConsumerFileSystem._handleError);
|
|
@@ -210,7 +214,7 @@ export class FileSystemExtImpl implements FileSystemExt {
|
|
|
210
214
|
|
|
211
215
|
private _handlePool: number = 0;
|
|
212
216
|
|
|
213
|
-
readonly fileSystem:
|
|
217
|
+
readonly fileSystem: ConsumerFileSystem;
|
|
214
218
|
|
|
215
219
|
constructor(rpc: RPCProtocol) {
|
|
216
220
|
this._proxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.FILE_SYSTEM_MAIN);
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2019 Red Hat, Inc. and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import * as assert from 'assert';
|
|
18
|
+
import { FileSystemWatcher } from './file-system-event-service-ext-impl';
|
|
19
|
+
import { DisposableCollection, Emitter } from '@theia/core';
|
|
20
|
+
import { FileSystemEvents } from '../common';
|
|
21
|
+
import { URI } from './types-impl';
|
|
22
|
+
|
|
23
|
+
const eventSource = new Emitter<FileSystemEvents>();
|
|
24
|
+
let disposables = new DisposableCollection();
|
|
25
|
+
|
|
26
|
+
function checkIgnore(ignoreCreate: number, ignoreChange: number, ignoreDelete: number): void {
|
|
27
|
+
const watcher = new FileSystemWatcher(eventSource.event, '**/*.js', !ignoreCreate, !ignoreChange, !ignoreDelete);
|
|
28
|
+
disposables.push(watcher);
|
|
29
|
+
const matching = URI.file('/foo/bar/zoz.js');
|
|
30
|
+
|
|
31
|
+
const changed: URI[] = [];
|
|
32
|
+
const created: URI[] = [];
|
|
33
|
+
const deleted: URI[] = [];
|
|
34
|
+
watcher.onDidChange(e => {
|
|
35
|
+
changed.push(e);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
watcher.onDidCreate(e => {
|
|
39
|
+
created.push(e);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
watcher.onDidDelete(e => {
|
|
43
|
+
deleted.push(e);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
eventSource.fire({ changed: [matching], created: [matching], deleted: [matching] });
|
|
47
|
+
|
|
48
|
+
assert.equal(created.length, ignoreCreate);
|
|
49
|
+
assert.equal(deleted.length, ignoreDelete);
|
|
50
|
+
assert.equal(changed.length, ignoreChange);
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
describe('File Watcher Test', () => {
|
|
55
|
+
afterEach(() => {
|
|
56
|
+
disposables.dispose();
|
|
57
|
+
disposables = new DisposableCollection();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('Should match files', () => {
|
|
61
|
+
const watcher = new FileSystemWatcher(eventSource.event, '**/*.js');
|
|
62
|
+
disposables.push(watcher);
|
|
63
|
+
const matching = URI.file('/foo/bar/zoz.js');
|
|
64
|
+
const notMatching = URI.file('/foo/bar/zoz.ts');
|
|
65
|
+
const changed: URI[] = [];
|
|
66
|
+
const created: URI[] = [];
|
|
67
|
+
const deleted: URI[] = [];
|
|
68
|
+
watcher.onDidChange(e => {
|
|
69
|
+
changed.push(e);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
watcher.onDidCreate(e => {
|
|
73
|
+
created.push(e);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
watcher.onDidDelete(e => {
|
|
77
|
+
deleted.push(e);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const URIs = [matching, notMatching];
|
|
81
|
+
eventSource.fire({ changed: URIs, created: URIs, deleted: URIs });
|
|
82
|
+
assert.equal(matching.toString(), changed[0]?.toString());
|
|
83
|
+
assert.equal(matching.toString(), created[0]?.toString());
|
|
84
|
+
assert.equal(matching.toString(), deleted[0]?.toString());
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('Should ignore created', () => {
|
|
88
|
+
checkIgnore(0, 1, 1);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('Should ignore changed', () => {
|
|
92
|
+
checkIgnore(1, 0, 1);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('Should ignore deleted', () => {
|
|
96
|
+
checkIgnore(1, 1, 0);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('Should exclude files', () => {
|
|
100
|
+
const watcher = new FileSystemWatcher(eventSource.event, '**/*.js', false, false, false, ['**/bar/**']);
|
|
101
|
+
disposables.push(watcher);
|
|
102
|
+
const notMatching = URI.file('/foo/bar/zoz.js');
|
|
103
|
+
const matching = URI.file('/foo/gux/zoz.js');
|
|
104
|
+
const changed: URI[] = [];
|
|
105
|
+
const created: URI[] = [];
|
|
106
|
+
const deleted: URI[] = [];
|
|
107
|
+
watcher.onDidChange(e => {
|
|
108
|
+
changed.push(e);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
watcher.onDidCreate(e => {
|
|
112
|
+
created.push(e);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
watcher.onDidDelete(e => {
|
|
116
|
+
deleted.push(e);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
const URIs = [matching, notMatching];
|
|
120
|
+
eventSource.fire({ changed: URIs, created: URIs, deleted: URIs });
|
|
121
|
+
assert.equal(matching.toString(), changed[0]?.toString());
|
|
122
|
+
assert.equal(matching.toString(), created[0]?.toString());
|
|
123
|
+
assert.equal(matching.toString(), deleted[0]?.toString());
|
|
124
|
+
});
|
|
125
|
+
});
|
|
@@ -22,14 +22,14 @@ import { CancellationToken, Disposable, DisposableCollection, Emitter, Event, UR
|
|
|
22
22
|
import { URI as TheiaURI } from '../types-impl';
|
|
23
23
|
import * as theia from '@theia/plugin';
|
|
24
24
|
import {
|
|
25
|
-
|
|
25
|
+
NotebookCellStatusBarListDto, NotebookDataDto,
|
|
26
26
|
NotebookDocumentsAndEditorsDelta, NotebookDocumentShowOptions, NotebookDocumentsMain, NotebookEditorAddData, NotebookEditorsMain, NotebooksExt, NotebooksMain, Plugin,
|
|
27
27
|
PLUGIN_RPC_CONTEXT
|
|
28
28
|
} from '../../common';
|
|
29
29
|
import { Cache } from '../../common/cache';
|
|
30
30
|
import { RPCProtocol } from '../../common/rpc-protocol';
|
|
31
31
|
import { UriComponents } from '../../common/uri-components';
|
|
32
|
-
import { CommandsConverter } from '../command-registry';
|
|
32
|
+
import { CommandRegistryImpl, CommandsConverter } from '../command-registry';
|
|
33
33
|
import * as typeConverters from '../type-converters';
|
|
34
34
|
import { BinaryBuffer } from '@theia/core/lib/common/buffer';
|
|
35
35
|
import { Cell, NotebookDocument } from './notebook-document';
|
|
@@ -74,10 +74,11 @@ export class NotebooksExtImpl implements NotebooksExt {
|
|
|
74
74
|
|
|
75
75
|
constructor(
|
|
76
76
|
rpc: RPCProtocol,
|
|
77
|
-
commands:
|
|
77
|
+
commands: CommandRegistryImpl,
|
|
78
78
|
private textDocumentsAndEditors: EditorsAndDocumentsExtImpl,
|
|
79
79
|
private textDocuments: DocumentsExtImpl,
|
|
80
80
|
) {
|
|
81
|
+
this.commandsConverter = commands.converter;
|
|
81
82
|
this.notebookProxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.NOTEBOOKS_MAIN);
|
|
82
83
|
this.notebookDocumentsProxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.NOTEBOOK_DOCUMENTS_MAIN);
|
|
83
84
|
this.notebookEditors = rpc.getProxy(PLUGIN_RPC_CONTEXT.NOTEBOOK_EDITORS_MAIN);
|
|
@@ -329,6 +330,7 @@ export class NotebooksExtImpl implements NotebooksExt {
|
|
|
329
330
|
if (delta.newActiveEditor === null) {
|
|
330
331
|
// clear active notebook as current active editor is non-notebook editor
|
|
331
332
|
this.activeNotebookEditor = undefined;
|
|
333
|
+
this.onDidChangeActiveNotebookEditorEmitter.fire(undefined);
|
|
332
334
|
} else if (delta.newActiveEditor) {
|
|
333
335
|
const activeEditor = this.editors.get(delta.newActiveEditor);
|
|
334
336
|
if (!activeEditor) {
|
|
@@ -340,8 +342,6 @@ export class NotebooksExtImpl implements NotebooksExt {
|
|
|
340
342
|
newActiveEditor: null
|
|
341
343
|
});
|
|
342
344
|
}
|
|
343
|
-
}
|
|
344
|
-
if (delta.newActiveEditor !== undefined) {
|
|
345
345
|
this.onDidChangeActiveNotebookEditorEmitter.fire(this.activeNotebookEditor?.apiEditor);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
@@ -278,6 +278,22 @@ import { NotebookDocumentsExtImpl } from './notebook/notebook-documents';
|
|
|
278
278
|
import { NotebookEditorsExtImpl } from './notebook/notebook-editors';
|
|
279
279
|
import { TestingExtImpl } from './tests';
|
|
280
280
|
import { UriExtImpl } from './uri-ext';
|
|
281
|
+
import { isObject } from '@theia/core';
|
|
282
|
+
|
|
283
|
+
export function createAPIObject<T extends Object>(rawObject: T): T {
|
|
284
|
+
return new Proxy(rawObject, {
|
|
285
|
+
get(target, p, receiver) {
|
|
286
|
+
const isOwnProperty = !!Object.getOwnPropertyDescriptor(target, p);
|
|
287
|
+
const val = Reflect.get(target, p);
|
|
288
|
+
if (!isOwnProperty && typeof val === 'function') {
|
|
289
|
+
// bind functions that are inherited from the prototype to the object itself.
|
|
290
|
+
// This should handle the case of events.
|
|
291
|
+
return val.bind(target);
|
|
292
|
+
}
|
|
293
|
+
return val;
|
|
294
|
+
},
|
|
295
|
+
}) as T;
|
|
296
|
+
}
|
|
281
297
|
|
|
282
298
|
export function createAPIFactory(
|
|
283
299
|
rpc: RPCProtocol,
|
|
@@ -496,7 +512,8 @@ export function createAPIFactory(
|
|
|
496
512
|
return quickOpenExt.showQuickPick(plugin, items, options, token);
|
|
497
513
|
},
|
|
498
514
|
createQuickPick<T extends theia.QuickPickItem>(): theia.QuickPick<T> {
|
|
499
|
-
|
|
515
|
+
|
|
516
|
+
return createAPIObject(quickOpenExt.createQuickPick(plugin));
|
|
500
517
|
},
|
|
501
518
|
showWorkspaceFolderPick(options?: theia.WorkspaceFolderPickOptions): PromiseLike<theia.WorkspaceFolder | undefined> {
|
|
502
519
|
return workspaceExt.pickWorkspaceFolder(options);
|
|
@@ -535,9 +552,12 @@ export function createAPIFactory(
|
|
|
535
552
|
priority = priorityOrAlignment;
|
|
536
553
|
}
|
|
537
554
|
|
|
555
|
+
// TODO: here
|
|
538
556
|
return statusBarMessageRegistryExt.createStatusBarItem(alignment, priority, id);
|
|
539
557
|
},
|
|
540
558
|
createOutputChannel(name: string, options?: { log: true }): any {
|
|
559
|
+
|
|
560
|
+
// TODO: here
|
|
541
561
|
return !options
|
|
542
562
|
? outputChannelRegistryExt.createOutputChannel(name, pluginToPluginInfo(plugin))
|
|
543
563
|
: outputChannelRegistryExt.createOutputChannel(name, pluginToPluginInfo(plugin), options);
|
|
@@ -546,7 +566,7 @@ export function createAPIFactory(
|
|
|
546
566
|
title: string,
|
|
547
567
|
showOptions: theia.ViewColumn | theia.WebviewPanelShowOptions,
|
|
548
568
|
options: theia.WebviewPanelOptions & theia.WebviewOptions = {}): theia.WebviewPanel {
|
|
549
|
-
return webviewExt.createWebview(viewType, title, showOptions, options, plugin);
|
|
569
|
+
return createAPIObject(webviewExt.createWebview(viewType, title, showOptions, options, plugin));
|
|
550
570
|
},
|
|
551
571
|
registerWebviewPanelSerializer(viewType: string, serializer: theia.WebviewPanelSerializer): theia.Disposable {
|
|
552
572
|
return webviewExt.registerWebviewPanelSerializer(viewType, serializer, plugin);
|
|
@@ -574,19 +594,19 @@ export function createAPIFactory(
|
|
|
574
594
|
createTerminal(nameOrOptions: theia.TerminalOptions | theia.ExtensionTerminalOptions | theia.ExtensionTerminalOptions | (string | undefined),
|
|
575
595
|
shellPath?: string,
|
|
576
596
|
shellArgs?: string[] | string): theia.Terminal {
|
|
577
|
-
return terminalExt.createTerminal(plugin, nameOrOptions, shellPath, shellArgs);
|
|
597
|
+
return createAPIObject(terminalExt.createTerminal(plugin, nameOrOptions, shellPath, shellArgs));
|
|
578
598
|
},
|
|
579
599
|
onDidChangeTerminalState,
|
|
580
600
|
onDidCloseTerminal,
|
|
581
601
|
onDidOpenTerminal,
|
|
582
602
|
createTextEditorDecorationType(options: theia.DecorationRenderOptions): theia.TextEditorDecorationType {
|
|
583
|
-
return editors.createTextEditorDecorationType(options);
|
|
603
|
+
return createAPIObject(editors.createTextEditorDecorationType(options));
|
|
584
604
|
},
|
|
585
605
|
registerTreeDataProvider<T>(viewId: string, treeDataProvider: theia.TreeDataProvider<T>): Disposable {
|
|
586
606
|
return treeViewsExt.registerTreeDataProvider(plugin, viewId, treeDataProvider);
|
|
587
607
|
},
|
|
588
608
|
createTreeView<T>(viewId: string, options: theia.TreeViewOptions<T>): theia.TreeView<T> {
|
|
589
|
-
return treeViewsExt.createTreeView(plugin, viewId, options);
|
|
609
|
+
return createAPIObject(treeViewsExt.createTreeView(plugin, viewId, options));
|
|
590
610
|
},
|
|
591
611
|
withScmProgress<R>(task: (progress: theia.Progress<number>) => Thenable<R>) {
|
|
592
612
|
const options: ProgressOptions = { location: ProgressLocation.SourceControl };
|
|
@@ -605,7 +625,7 @@ export function createAPIFactory(
|
|
|
605
625
|
return uriExt.registerUriHandler(handler, pluginToPluginInfo(plugin));
|
|
606
626
|
},
|
|
607
627
|
createInputBox(): theia.InputBox {
|
|
608
|
-
return quickOpenExt.createInputBox(plugin);
|
|
628
|
+
return createAPIObject(quickOpenExt.createInputBox(plugin));
|
|
609
629
|
},
|
|
610
630
|
registerTerminalLinkProvider(provider: theia.TerminalLinkProvider): theia.Disposable {
|
|
611
631
|
return terminalExt.registerTerminalLinkProvider(provider);
|
|
@@ -650,10 +670,26 @@ export function createAPIFactory(
|
|
|
650
670
|
onDidStartTerminalShellExecution: Event.None
|
|
651
671
|
};
|
|
652
672
|
|
|
673
|
+
function createFileSystemWatcher(pattern: RelativePattern, options?: theia.FileSystemWatcherOptions): theia.FileSystemWatcher;
|
|
674
|
+
function createFileSystemWatcher(pattern: theia.GlobPattern, ignoreCreateEvents?: boolean, ignoreChangeEvents?:
|
|
675
|
+
boolean, ignoreDeleteEvents?: boolean): theia.FileSystemWatcher;
|
|
676
|
+
function createFileSystemWatcher(pattern: RelativePattern | theia.GlobPattern,
|
|
677
|
+
ignoreCreateOrOptions?: theia.FileSystemWatcherOptions | boolean, ignoreChangeEventsBoolean?: boolean, ignoreDeleteEventsBoolean?: boolean): theia.FileSystemWatcher {
|
|
678
|
+
if (isObject<theia.FileSystemWatcherOptions>(ignoreCreateOrOptions)) {
|
|
679
|
+
const { ignoreCreateEvents, ignoreChangeEvents, ignoreDeleteEvents, excludes } = (ignoreCreateOrOptions as theia.FileSystemWatcherOptions);
|
|
680
|
+
return createAPIObject(
|
|
681
|
+
extHostFileSystemEvent.createFileSystemWatcher(fromGlobPattern(pattern),
|
|
682
|
+
ignoreCreateEvents, ignoreChangeEvents, ignoreDeleteEvents, excludes));
|
|
683
|
+
} else {
|
|
684
|
+
return createAPIObject(
|
|
685
|
+
extHostFileSystemEvent.createFileSystemWatcher(fromGlobPattern(pattern),
|
|
686
|
+
ignoreCreateOrOptions as boolean, ignoreChangeEventsBoolean, ignoreDeleteEventsBoolean));
|
|
687
|
+
}
|
|
688
|
+
}
|
|
653
689
|
const workspace: typeof theia.workspace = {
|
|
654
690
|
|
|
655
691
|
get fs(): theia.FileSystem {
|
|
656
|
-
return fileSystemExt.fileSystem;
|
|
692
|
+
return fileSystemExt.fileSystem.apiObject;
|
|
657
693
|
},
|
|
658
694
|
|
|
659
695
|
get rootPath(): string | undefined {
|
|
@@ -755,8 +791,7 @@ export function createAPIFactory(
|
|
|
755
791
|
// Notebook extension will create a document in openNotebookDocument() or create openNotebookDocument()
|
|
756
792
|
return notebooksExt.getNotebookDocument(uri).apiNotebook;
|
|
757
793
|
},
|
|
758
|
-
createFileSystemWatcher
|
|
759
|
-
extHostFileSystemEvent.createFileSystemWatcher(fromGlobPattern(pattern), ignoreCreate, ignoreChange, ignoreDelete),
|
|
794
|
+
createFileSystemWatcher,
|
|
760
795
|
findFiles(include: theia.GlobPattern, exclude?: theia.GlobPattern | null, maxResults?: number, token?: CancellationToken): PromiseLike<URI[]> {
|
|
761
796
|
return workspaceExt.findFiles(include, exclude, maxResults, token);
|
|
762
797
|
},
|
|
@@ -849,7 +884,7 @@ export function createAPIFactory(
|
|
|
849
884
|
return telemetryExt.onDidChangeTelemetryEnabled;
|
|
850
885
|
},
|
|
851
886
|
createTelemetryLogger(sender: theia.TelemetrySender, options?: theia.TelemetryLoggerOptions): theia.TelemetryLogger {
|
|
852
|
-
return telemetryExt.createTelemetryLogger(sender, options);
|
|
887
|
+
return createAPIObject(telemetryExt.createTelemetryLogger(sender, options));
|
|
853
888
|
},
|
|
854
889
|
get remoteName(): string | undefined { return envExt.remoteName; },
|
|
855
890
|
get machineId(): string { return envExt.machineId; },
|
|
@@ -924,7 +959,7 @@ export function createAPIFactory(
|
|
|
924
959
|
return <any>languagesExt.getDiagnostics(resource);
|
|
925
960
|
},
|
|
926
961
|
createDiagnosticCollection(name?: string): theia.DiagnosticCollection {
|
|
927
|
-
return languagesExt.createDiagnosticCollection(name);
|
|
962
|
+
return createAPIObject(languagesExt.createDiagnosticCollection(name));
|
|
928
963
|
},
|
|
929
964
|
setLanguageConfiguration(language: string, configuration: theia.LanguageConfiguration): theia.Disposable {
|
|
930
965
|
return languagesExt.setLanguageConfiguration(language, configuration);
|
|
@@ -1061,7 +1096,7 @@ export function createAPIFactory(
|
|
|
1061
1096
|
|
|
1062
1097
|
const tests: typeof theia.tests = {
|
|
1063
1098
|
createTestController(id, label: string) {
|
|
1064
|
-
return testingExt.createTestController(id, label);
|
|
1099
|
+
return createAPIObject(testingExt.createTestController(id, label));
|
|
1065
1100
|
}
|
|
1066
1101
|
};
|
|
1067
1102
|
/* End of Tests API */
|
|
@@ -1173,6 +1208,7 @@ export function createAPIFactory(
|
|
|
1173
1208
|
},
|
|
1174
1209
|
|
|
1175
1210
|
get taskExecutions(): ReadonlyArray<theia.TaskExecution> {
|
|
1211
|
+
// TODO: here
|
|
1176
1212
|
return tasksExt.taskExecutions;
|
|
1177
1213
|
},
|
|
1178
1214
|
onDidStartTask(listener, thisArg?, disposables?) {
|
|
@@ -1193,19 +1229,19 @@ export function createAPIFactory(
|
|
|
1193
1229
|
get inputBox(): theia.SourceControlInputBox {
|
|
1194
1230
|
const inputBox = scmExt.getLastInputBox(plugin);
|
|
1195
1231
|
if (inputBox) {
|
|
1196
|
-
return inputBox;
|
|
1232
|
+
return inputBox.apiObject;
|
|
1197
1233
|
} else {
|
|
1198
1234
|
throw new Error('Input box not found!');
|
|
1199
1235
|
}
|
|
1200
1236
|
},
|
|
1201
1237
|
createSourceControl(id: string, label: string, rootUri?: URI): theia.SourceControl {
|
|
1202
|
-
return scmExt.createSourceControl(plugin, id, label, rootUri);
|
|
1238
|
+
return createAPIObject(scmExt.createSourceControl(plugin, id, label, rootUri));
|
|
1203
1239
|
}
|
|
1204
1240
|
};
|
|
1205
1241
|
|
|
1206
1242
|
const comments: typeof theia.comments = {
|
|
1207
1243
|
createCommentController(id: string, label: string): theia.CommentController {
|
|
1208
|
-
return commentsExt.createCommentController(plugin, id, label);
|
|
1244
|
+
return createAPIObject(commentsExt.createCommentController(plugin, id, label));
|
|
1209
1245
|
}
|
|
1210
1246
|
};
|
|
1211
1247
|
|
|
@@ -1268,6 +1304,10 @@ export function createAPIFactory(
|
|
|
1268
1304
|
registerMappedEditsProvider(documentSelector: theia.DocumentSelector, provider: theia.MappedEditsProvider): Disposable {
|
|
1269
1305
|
return Disposable.NULL;
|
|
1270
1306
|
},
|
|
1307
|
+
/** @stubbed MappedEditsProvider */
|
|
1308
|
+
registerMappedEditsProvider2(provider: theia.MappedEditsProvider2) {
|
|
1309
|
+
return Disposable.NULL;
|
|
1310
|
+
},
|
|
1271
1311
|
/** @stubbed ChatRequestHandler */
|
|
1272
1312
|
createChatParticipant(id: string, handler: theia.ChatRequestHandler): theia.ChatParticipant {
|
|
1273
1313
|
return {
|
package/src/plugin/scm.ts
CHANGED
|
@@ -39,6 +39,7 @@ import { URI, ThemeIcon } from './types-impl';
|
|
|
39
39
|
import { ScmCommandArg } from '../common/plugin-api-rpc';
|
|
40
40
|
import { sep } from '@theia/core/lib/common/paths';
|
|
41
41
|
import { PluginIconPath } from './plugin-icon-path';
|
|
42
|
+
import { createAPIObject } from './plugin-context';
|
|
42
43
|
type ProviderHandle = number;
|
|
43
44
|
type GroupHandle = number;
|
|
44
45
|
type ResourceStateHandle = number;
|
|
@@ -290,6 +291,7 @@ interface ValidateInput {
|
|
|
290
291
|
export class ScmInputBoxImpl implements theia.SourceControlInputBox {
|
|
291
292
|
|
|
292
293
|
private _value: string = '';
|
|
294
|
+
apiObject: theia.SourceControlInputBox;
|
|
293
295
|
|
|
294
296
|
get value(): string {
|
|
295
297
|
return this._value;
|
|
@@ -354,7 +356,7 @@ export class ScmInputBoxImpl implements theia.SourceControlInputBox {
|
|
|
354
356
|
}
|
|
355
357
|
|
|
356
358
|
constructor(private plugin: Plugin, private proxy: ScmMain, private sourceControlHandle: number) {
|
|
357
|
-
|
|
359
|
+
this.apiObject = createAPIObject(this);
|
|
358
360
|
}
|
|
359
361
|
|
|
360
362
|
onInputBoxValueChange(value: string): void {
|
|
@@ -543,8 +545,7 @@ class SourceControlImpl implements theia.SourceControl {
|
|
|
543
545
|
return this._rootUri;
|
|
544
546
|
}
|
|
545
547
|
|
|
546
|
-
|
|
547
|
-
get inputBox(): ScmInputBoxImpl { return this._inputBox; }
|
|
548
|
+
readonly inputBox: ScmInputBoxImpl;
|
|
548
549
|
|
|
549
550
|
private _count: number | undefined = undefined;
|
|
550
551
|
|
|
@@ -642,7 +643,7 @@ class SourceControlImpl implements theia.SourceControl {
|
|
|
642
643
|
private _label: string,
|
|
643
644
|
private _rootUri?: theia.Uri
|
|
644
645
|
) {
|
|
645
|
-
this.
|
|
646
|
+
this.inputBox = new ScmInputBoxImpl(plugin, this.proxy, this.handle);
|
|
646
647
|
this.proxy.$registerSourceControl(this.handle, _id, _label, _rootUri);
|
|
647
648
|
}
|
|
648
649
|
|
|
@@ -55,7 +55,13 @@ export class WindowStateExtImpl implements WindowStateExt {
|
|
|
55
55
|
this.windowStateChangedEmitter.fire(this.windowStateCached);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
openUri(
|
|
58
|
+
async openUri(uriOrString: URI | string): Promise<boolean> {
|
|
59
|
+
let uri: URI;
|
|
60
|
+
if (typeof uriOrString === 'string') {
|
|
61
|
+
uri = URI.parse(uriOrString);
|
|
62
|
+
} else {
|
|
63
|
+
uri = uriOrString;
|
|
64
|
+
}
|
|
59
65
|
if (!uri.scheme.trim().length) {
|
|
60
66
|
throw new Error('Invalid scheme - cannot be empty');
|
|
61
67
|
}
|