VSCode merge (#4610)

* Merge from vscode e388c734f30757875976c7e326d6cfeee77710de

* fix yarn lcoks

* remove small issue
This commit is contained in:
Anthony Dresser
2019-03-20 10:39:09 -07:00
committed by GitHub
parent 87765e8673
commit c814b92557
310 changed files with 6606 additions and 2129 deletions
@@ -5,10 +5,10 @@
'use strict';
import { ExtHostModelViewTreeViewsShape, SqlExtHostContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { IModelViewTreeViewDataProvider, ITreeComponentItem } from 'sql/workbench/common/views';
import { INotificationService } from 'vs/platform/notification/common/notification';
import * as vsTreeView from 'vs/workbench/api/electron-browser/mainThreadTreeViews';
import * as vsTreeView from 'vs/workbench/api/browser/mainThreadTreeViews';
export class TreeViewDataProvider extends vsTreeView.TreeViewDataProvider implements IModelViewTreeViewDataProvider {
constructor(handle: number, treeViewId: string,
@@ -4,9 +4,9 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { SqlMainContext, MainThreadDashboardShape, ExtHostDashboardShape, SqlExtHostContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardService';
@extHostNamedCustomer(SqlMainContext.MainThreadDashboard)
@@ -8,8 +8,8 @@ import 'vs/css!sql/media/icons/common-icons';
import { WebViewDialog } from 'sql/workbench/parts/webview/electron-browser/webViewDialog';
import { MainThreadModalDialogShape, SqlMainContext, SqlExtHostContext, ExtHostModalDialogsShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@extHostNamedCustomer(SqlMainContext.MainThreadModalDialog)
@@ -3,10 +3,10 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { TaskRegistry, ITaskHandlerDescription } from 'sql/platform/tasks/common/tasks';
import { IDisposable } from 'vs/base/common/lifecycle';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import {
ExtHostAccountManagementShape,
@@ -13,7 +13,7 @@ import {
SqlMainContext,
} from 'sql/workbench/api/node/sqlExtHost.protocol';
import { AzureResource } from 'sql/workbench/api/common/sqlExtHostTypes';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { Event, Emitter } from 'vs/base/common/event';
export class ExtHostAccountManagement extends ExtHostAccountManagementShape {
@@ -167,5 +167,3 @@ interface AccountProviderWithMetadata {
metadata: azdata.AccountProviderMetadata;
provider: azdata.AccountProvider;
}
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { ExtHostBackgroundTaskManagementShape, SqlMainContext, MainThreadBackgroundTaskManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
@@ -110,4 +110,4 @@ export class ExtHostBackgroundTaskManagement implements ExtHostBackgroundTaskMan
this._handlers.delete(operationId);
}
}
}
}
@@ -5,7 +5,7 @@
'use strict';
import { ExtHostConnectionManagementShape, SqlMainContext, MainThreadConnectionManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { generateUuid } from 'vs/base/common/uuid';
import * as azdata from 'azdata';
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { SqlMainContext, MainThreadCredentialManagementShape, ExtHostCredentialManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import * as vscode from 'vscode';
import * as azdata from 'azdata';
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { Event, Emitter } from 'vs/base/common/event';
import * as azdata from 'azdata';
@@ -6,7 +6,7 @@
import { SqlMainContext, ExtHostDashboardWebviewsShape, MainThreadDashboardWebviewShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { Emitter } from 'vs/base/common/event';
import { deepClone } from 'vs/base/common/objects';
@@ -7,7 +7,7 @@
import * as vscode from 'vscode';
import * as azdata from 'azdata';
import { Event, Emitter } from 'vs/base/common/event';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { Disposable } from 'vs/workbench/api/node/extHostTypes';
import { SqlMainContext, MainThreadDataProtocolShape, ExtHostDataProtocolShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { DataProviderType } from 'sql/workbench/api/common/sqlExtHostTypes';
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { ExtHostExtensionManagementShape, MainThreadExtensionManagementShape, SqlMainContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
@@ -5,7 +5,7 @@
'use strict';
import { SqlMainContext, MainThreadModalDialogShape, ExtHostModalDialogsShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import * as vscode from 'vscode';
import * as azdata from 'azdata';
import { Emitter } from 'vs/base/common/event';
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { Emitter } from 'vs/base/common/event';
import { deepClone } from 'vs/base/common/objects';
import { URI } from 'vs/base/common/uri';
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { Event, Emitter } from 'vs/base/common/event';
import { deepClone } from 'vs/base/common/objects';
import * as nls from 'vs/nls';
@@ -9,7 +9,7 @@ import * as vscode from 'vscode';
import { SqlMainContext, ExtHostModelViewTreeViewsShape, MainThreadModelViewShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { ITreeComponentItem } from 'sql/workbench/common/views';
import { CommandsConverter } from 'vs/workbench/api/node/extHostCommands';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import * as azdata from 'azdata';
import * as vsTreeExt from 'vs/workbench/api/node/extHostTreeViews';
import { Emitter } from 'vs/base/common/event';
@@ -7,7 +7,7 @@
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { Disposable } from 'vs/workbench/api/node/extHostTypes';
import { localize } from 'vs/nls';
import { URI, UriComponents } from 'vs/base/common/uri';
@@ -12,7 +12,7 @@ import { dispose } from 'vs/base/common/lifecycle';
import { URI, UriComponents } from 'vs/base/common/uri';
import { Disposable } from 'vs/workbench/api/node/extHostTypes';
import * as typeConverters from 'vs/workbench/api/node/extHostTypeConverters';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { ok } from 'vs/base/common/assert';
import {
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { ExtHostObjectExplorerShape, SqlMainContext, MainThreadObjectExplorerShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { ExtHostQueryEditorShape, SqlMainContext, MainThreadQueryEditorShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
@@ -6,7 +6,7 @@
'use strict';
import * as azdata from 'azdata';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { Disposable } from 'vs/workbench/api/node/extHostTypes';
import {
ExtHostResourceProviderShape,
@@ -88,5 +88,3 @@ interface ResourceProviderWithMetadata {
metadata: azdata.ResourceProviderMetadata;
provider: azdata.ResourceProvider;
}
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { SqlMainContext, MainThreadSerializationProviderShape, ExtHostSerializationProviderShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import * as vscode from 'vscode';
import * as azdata from 'azdata';
+1 -1
View File
@@ -6,7 +6,7 @@
import { validateConstraint } from 'vs/base/common/types';
import { ILogService } from 'vs/platform/log/common/log';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import * as extHostTypes from 'vs/workbench/api/node/extHostTypes';
import * as azdata from 'azdata';
@@ -13,8 +13,8 @@ import {
SqlExtHostContext,
SqlMainContext
} from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { UpdateAccountListEventParams } from 'sql/platform/accountManagement/common/eventTypes';
@extHostNamedCustomer(SqlMainContext.MainThreadAccountManagement)
@@ -7,8 +7,8 @@
import { ITaskService } from 'sql/platform/taskHistory/common/taskService';
import { MainThreadBackgroundTaskManagementShape, SqlMainContext, ExtHostBackgroundTaskManagementShape, SqlExtHostContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { Disposable } from 'vs/base/common/lifecycle';
@@ -6,8 +6,8 @@
import { SqlExtHostContext, SqlMainContext, ExtHostConnectionManagementShape, MainThreadConnectionManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import * as azdata from 'azdata';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/common/objectExplorerService';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
@@ -11,8 +11,8 @@ import {
} from 'sql/workbench/api/node/sqlExtHost.protocol';
import { ICredentialsService } from 'sql/platform/credentials/common/credentialsService';
import * as azdata from 'azdata';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
@extHostNamedCustomer(SqlMainContext.MainThreadCredentialManagement)
export class MainThreadCredentialManagement implements MainThreadCredentialManagementShape {
@@ -5,8 +5,8 @@
'use strict';
import { MainThreadDashboardWebviewShape, SqlMainContext, ExtHostDashboardWebviewsShape, SqlExtHostContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { IDashboardViewService, IDashboardWebview } from 'sql/platform/dashboard/common/dashboardViewService';
@extHostNamedCustomer(SqlMainContext.MainThreadDashboardWebview)
@@ -24,9 +24,9 @@ import { ITaskService } from 'sql/platform/taskHistory/common/taskService';
import { IProfilerService } from 'sql/workbench/services/profiler/common/interfaces';
import { ISerializationService } from 'sql/platform/serialization/common/serializationService';
import { IFileBrowserService } from 'sql/platform/fileBrowser/common/interfaces';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { IDacFxService } from 'sql/platform/dacfx/common/dacFxService';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
/**
* Main thread class for handling data protocol management registration.
@@ -5,8 +5,8 @@
'use strict';
import { SqlMainContext, MainThreadExtensionManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { IExtensionManagementService, IExtensionIdentifier } from 'vs/platform/extensionManagement/common/extensionManagement';
import { URI } from 'vs/base/common/uri';
@@ -5,8 +5,8 @@
'use strict';
import { MainThreadModelViewShape, SqlMainContext, ExtHostModelViewShape, SqlExtHostContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { Disposable } from 'vs/base/common/lifecycle';
@@ -5,8 +5,8 @@
'use strict';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { MainThreadModelViewDialogShape, SqlMainContext, ExtHostModelViewDialogShape, SqlExtHostContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
@@ -293,4 +293,4 @@ export class MainThreadModelViewDialog implements MainThreadModelViewDialogShape
private validateDialogClose(handle: number): Thenable<boolean> {
return this._proxy.$validateDialogClose(handle);
}
}
}
@@ -6,9 +6,9 @@
import * as azdata from 'azdata';
import { SqlExtHostContext, SqlMainContext, ExtHostNotebookShape, MainThreadNotebookShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { Disposable } from 'vs/base/common/lifecycle';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { Event, Emitter } from 'vs/base/common/event';
import { URI } from 'vs/base/common/uri';
@@ -6,15 +6,14 @@
import * as azdata from 'azdata';
import * as path from 'path';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { URI, UriComponents } from 'vs/base/common/uri';
import { Event, Emitter } from 'vs/base/common/event';
import { IExtHostContext, IUndoStopOptions } from 'vs/workbench/api/node/extHost.protocol';
import { IExtHostContext, IUndoStopOptions } from 'vs/workbench/api/common/extHost.protocol';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ITextEditorOptions } from 'vs/platform/editor/common/editor';
import { viewColumnToEditorGroup } from 'vs/workbench/api/shared/editor';
import { Schemas } from 'vs/base/common/network';
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
@@ -32,6 +31,7 @@ import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilit
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { notebookModeId } from 'sql/common/constants';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { viewColumnToEditorGroup } from 'vs/workbench/api/common/shared/editor';
class MainThreadNotebookEditor extends Disposable {
private _contentChangedEmitter = new Emitter<NotebookContentChange>();
@@ -7,8 +7,8 @@
import { SqlExtHostContext, SqlMainContext, ExtHostObjectExplorerShape, MainThreadObjectExplorerShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
import { IObjectExplorerService, NodeInfoWithConnection } from 'sql/workbench/services/objectExplorer/common/objectExplorerService';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
@@ -5,8 +5,8 @@
'use strict';
import { SqlExtHostContext, SqlMainContext, ExtHostQueryEditorShape, MainThreadQueryEditorShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IConnectionManagementService, IConnectionCompletionOptions, ConnectionType, RunQueryOnConnectionMode } from 'sql/platform/connection/common/connectionManagement';
import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService';
import { QueryEditor } from 'sql/parts/query/editor/queryEditor';
@@ -13,8 +13,8 @@ import {
SqlExtHostContext,
SqlMainContext
} from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
@extHostNamedCustomer(SqlMainContext.MainThreadResourceProvider)
@@ -11,8 +11,8 @@ import {
} from 'sql/workbench/api/node/sqlExtHost.protocol';
import { ISerializationService } from 'sql/platform/serialization/common/serializationService';
import * as azdata from 'azdata';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
@extHostNamedCustomer(SqlMainContext.MainThreadSerializationProvider)
export class MainThreadSerializationProvider implements MainThreadSerializationProviderShape {
@@ -5,7 +5,7 @@
'use strict';
import * as extHostApi from 'vs/workbench/api/node/extHost.api.impl';
import { IInitData, IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IInitData, IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionService';
import * as extHostTypes from 'vs/workbench/api/node/extHostTypes';
import { URI } from 'vs/base/common/uri';
@@ -6,9 +6,8 @@
import {
createMainContextProxyIdentifier as createMainId,
createExtHostContextProxyIdentifier as createExtId,
ProxyIdentifier, IRPCProtocol
} from 'vs/workbench/services/extensions/node/proxyIdentifier';
createExtHostContextProxyIdentifier as createExtId
} from 'vs/workbench/services/extensions/common/proxyIdentifier';
import { UriComponents } from 'vs/base/common/uri';
import { IDisposable } from 'vs/base/common/lifecycle';
@@ -22,8 +21,8 @@ import {
IItemConfig, ModelComponentTypes, IComponentShape, IModelViewDialogDetails, IModelViewTabDetails, IModelViewButtonDetails,
IModelViewWizardDetails, IModelViewWizardPageDetails, INotebookManagerDetails, INotebookSessionDetails, INotebookKernelDetails, INotebookFutureDetails, FutureMessageType, INotebookFutureDone, ISingleNotebookEditOperation
} from 'sql/workbench/api/common/sqlExtHostTypes';
import { EditorViewColumn } from 'vs/workbench/api/shared/editor';
import { IUndoStopOptions } from 'vs/workbench/api/node/extHost.protocol';
import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor';
import { IUndoStopOptions } from 'vs/workbench/api/common/extHost.protocol';
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
export abstract class ExtHostAccountManagementShape {
@@ -12,7 +12,7 @@ import { AccountProviderStub, AccountManagementTestService } from 'sqltest/stubs
import { ExtHostAccountManagement } from 'sql/workbench/api/node/extHostAccountManagement';
import { TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol';
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
import { IRPCProtocol } from 'vs/workbench/services/extensions/node/proxyIdentifier';
import { IRPCProtocol } from 'vs/workbench/services/extensions/common/proxyIdentifier';
import { SqlMainContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { MainThreadAccountManagement } from 'sql/workbench/api/node/mainThreadAccountManagement';
import { IAccountManagementService, AzureResource } from 'sql/platform/accountManagement/common/interfaces';
@@ -453,4 +453,4 @@ function getMockAccountManagementService(accounts: azdata.Account[]): TypeMoq.Mo
.returns(() => () => { return undefined; });
return mockAccountManagementService;
}
}
@@ -10,7 +10,7 @@ import * as assert from 'assert';
import { Mock, It, Times } from 'typemoq';
import { ExtHostBackgroundTaskManagement, TaskStatus } from 'sql/workbench/api/node/extHostBackgroundTaskManagement';
import { MainThreadBackgroundTaskManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
suite('ExtHostBackgroundTaskManagement Tests', () => {
@@ -105,4 +105,4 @@ suite('ExtHostBackgroundTaskManagement Tests', () => {
extHostBackgroundTaskManagement.$removeTask(operationId);
});
});
});
@@ -10,7 +10,7 @@ import { TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCP
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
import { ExtHostCredentialManagement } from 'sql/workbench/api/node/extHostCredentialManagement';
import { SqlMainContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IRPCProtocol } from 'vs/workbench/services/extensions/node/proxyIdentifier';
import { IRPCProtocol } from 'vs/workbench/services/extensions/common/proxyIdentifier';
import { MainThreadCredentialManagement } from 'sql/workbench/api/node/mainThreadCredentialManagement';
import { CredentialsTestProvider, CredentialsTestService } from 'sqltest/stubs/credentialsTestStubs';
import { ICredentialsService } from 'sql/platform/credentials/common/credentialsService';
@@ -10,7 +10,7 @@ import { Mock, It, Times, MockBehavior } from 'typemoq';
import * as azdata from 'azdata';
import { ExtHostModelView } from 'sql/workbench/api/node/extHostModelView';
import { MainThreadModelViewShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { IComponentShape, IItemConfig, ComponentEventType, IComponentEventArgs, ModelComponentTypes } from 'sql/workbench/api/common/sqlExtHostTypes';
import { TitledFormItemLayout } from 'sql/parts/modelComponents/formContainer.component';
@@ -380,4 +380,4 @@ suite('ExtHostModelView Validation Tests', () => {
assert.equal((form as IWithItemConfig).itemConfigs.length, 2);
assert.equal((form as IWithItemConfig).itemConfigs[1].toIItemConfig().componentShape.type, ModelComponentTypes.ListBox);
});
});
});
@@ -10,7 +10,7 @@ import * as assert from 'assert';
import { Mock, It, Times } from 'typemoq';
import { ExtHostModelViewDialog } from 'sql/workbench/api/node/extHostModelViewDialog';
import { MainThreadModelViewDialogShape, ExtHostModelViewShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { MessageLevel } from 'sql/workbench/api/common/sqlExtHostTypes';
@@ -328,4 +328,4 @@ suite('ExtHostModelViewDialog Tests', () => {
extHostModelViewDialog.$validateDialogClose(dialogHandle);
assert.equal(callCount, 1);
});
});
});
@@ -10,7 +10,7 @@ import * as assert from 'assert';
import * as TypeMoq from 'typemoq';
import { URI } from 'vs/base/common/uri';
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { ExtHostNotebook } from 'sql/workbench/api/node/extHostNotebook';
import { MainThreadNotebookShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
@@ -144,4 +144,4 @@ class NotebookManagerStub implements azdata.nb.NotebookManager {
get serverManager(): azdata.nb.ServerManager {
return undefined;
}
}
}
@@ -10,7 +10,7 @@ import { Mock, It, Times } from 'typemoq';
import { MainThreadBackgroundTaskManagement, TaskStatus } from 'sql/workbench/api/node/mainThreadBackgroundTaskManagement';
import { ExtHostBackgroundTaskManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { ITaskService } from 'sql/platform/taskHistory/common/taskService';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { TaskNode } from 'sql/parts/taskHistory/common/taskNode';
import { Emitter } from 'vs/base/common/event';
@@ -94,4 +94,4 @@ suite('MainThreadBackgroundTaskManagement Tests', () => {
mockProxy.verify(x => x.$onTaskCanceled(It.is(t => t === operationId)), Times.once());
});
});
});
@@ -8,7 +8,7 @@
import * as assert from 'assert';
import { Mock, It, Times } from 'typemoq';
import { MainThreadModelViewDialog } from 'sql/workbench/api/node/mainThreadModelViewDialog';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { IModelViewButtonDetails, IModelViewTabDetails, IModelViewDialogDetails, IModelViewWizardPageDetails, IModelViewWizardDetails, DialogMessage, MessageLevel } from 'sql/workbench/api/common/sqlExtHostTypes';
import { CustomDialogService } from 'sql/platform/dialog/customDialogService';
import { Dialog, DialogTab, Wizard } from 'sql/platform/dialog/dialogTypes';
@@ -367,4 +367,4 @@ suite('MainThreadModelViewDialog Tests', () => {
// Then the call gets forwarded to the extension host
mockExtHostModelViewDialog.verify(x => x.$validateDialogClose(It.is(handle => handle === dialogHandle)), Times.once());
});
});
});
@@ -10,7 +10,7 @@ import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { URI, UriComponents } from 'vs/base/common/uri';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { ExtHostNotebookShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { MainThreadNotebook } from 'sql/workbench/api/node/mainThreadNotebook';
+1
View File
@@ -10,6 +10,7 @@
"noImplicitThis": true,
"alwaysStrict": true,
"strictBindCallApply": true,
"strictNullChecks": false,
"baseUrl": ".",
"paths": {
"vs/*": [
-474
View File
@@ -1,474 +0,0 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"noEmit": true,
"strictNullChecks": true
},
"include": [
"./typings",
"./vs/base/**/*.ts",
"./vs/code/**/*.ts",
"./vs/editor/**/*.ts",
"./vs/platform/**/*.ts",
"./vs/workbench/common/**/*",
"./vs/workbench/browser/**/*",
"./vs/workbench/electron-browser/**/*",
"./vs/workbench/contrib/emmet/**/*",
"./vs/workbench/contrib/externalTerminal/**/*",
"./vs/workbench/contrib/scm/**/*.ts",
"./vs/workbench/contrib/snippets/**/*.ts",
"./vs/workbench/contrib/outline/**/*.ts",
"./vs/workbench/contrib/performance/**/*.ts",
"./vs/workbench/contrib/welcome/**/*.ts",
"./vs/workbench/contrib/issue/**/*",
"./vs/workbench/contrib/splash/**/*.ts",
"./vs/workbench/contrib/tasks/**/*.ts",
"./vs/workbench/services/commands/**/*",
"./vs/workbench/services/configuration/common/**/*",
"./vs/workbench/services/files/node/watcher/**/*",
"./vs/workbench/services/themes/**/*.ts",
"./vs/workbench/services/bulkEdit/**/*.ts",
"./vs/workbench/services/output/**/*.ts",
"./vs/workbench/services/preferences/**/*.ts",
"./vs/workbench/services/timer/**/*.ts",
"./vs/workbench/contrib/debug/**/*.ts",
"./vs/workbench/contrib/files/**/*.ts",
"./vs/workbench/contrib/webview/**/*.ts",
"./vs/workbench/contrib/preferences/common/**/*.ts",
"./vs/workbench/contrib/preferences/**/settings*.ts",
"./vs/workbench/contrib/terminal/**/*"
],
"files": [
"./vs/monaco.d.ts",
"./vs/nls.d.ts",
"./vs/nls.mock.ts",
"./vs/vscode.d.ts",
"./vs/vscode.proposed.d.ts",
"./vs/workbench/api/browser/viewsExtensionPoint.ts",
"./vs/workbench/api/common/configurationExtensionPoint.ts",
"./vs/workbench/api/common/jsonValidationExtensionPoint.ts",
"./vs/workbench/api/common/menusExtensionPoint.ts",
"./vs/workbench/api/electron-browser/extHostCustomers.ts",
"./vs/workbench/api/electron-browser/mainThreadClipboard.ts",
"./vs/workbench/api/electron-browser/mainThreadCommands.ts",
"./vs/workbench/api/electron-browser/mainThreadConfiguration.ts",
"./vs/workbench/api/electron-browser/mainThreadConsole.ts",
"./vs/workbench/api/electron-browser/mainThreadDebugService.ts",
"./vs/workbench/api/electron-browser/mainThreadDecorations.ts",
"./vs/workbench/api/electron-browser/mainThreadDiagnostics.ts",
"./vs/workbench/api/electron-browser/mainThreadDialogs.ts",
"./vs/workbench/api/electron-browser/mainThreadDocumentContentProviders.ts",
"./vs/workbench/api/electron-browser/mainThreadDocuments.ts",
"./vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts",
"./vs/workbench/api/electron-browser/mainThreadEditor.ts",
"./vs/workbench/api/electron-browser/mainThreadEditors.ts",
"./vs/workbench/api/electron-browser/mainThreadErrors.ts",
"./vs/workbench/api/electron-browser/mainThreadExtensionService.ts",
"./vs/workbench/api/electron-browser/mainThreadFileSystem.ts",
"./vs/workbench/api/electron-browser/mainThreadFileSystemEventService.ts",
"./vs/workbench/api/electron-browser/mainThreadHeapService.ts",
"./vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts",
"./vs/workbench/api/electron-browser/mainThreadLanguages.ts",
"./vs/workbench/api/electron-browser/mainThreadLogService.ts",
"./vs/workbench/api/electron-browser/mainThreadMessageService.ts",
"./vs/workbench/api/electron-browser/mainThreadOutputService.ts",
"./vs/workbench/api/electron-browser/mainThreadProgress.ts",
"./vs/workbench/api/electron-browser/mainThreadQuickOpen.ts",
"./vs/workbench/api/electron-browser/mainThreadSCM.ts",
"./vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts",
"./vs/workbench/api/electron-browser/mainThreadSearch.ts",
"./vs/workbench/api/electron-browser/mainThreadStatusBar.ts",
"./vs/workbench/api/electron-browser/mainThreadStorage.ts",
"./vs/workbench/api/electron-browser/mainThreadTask.ts",
"./vs/workbench/api/electron-browser/mainThreadTelemetry.ts",
"./vs/workbench/api/electron-browser/mainThreadTerminalService.ts",
"./vs/workbench/api/electron-browser/mainThreadTreeViews.ts",
"./vs/workbench/api/electron-browser/mainThreadUrls.ts",
"./vs/workbench/api/electron-browser/mainThreadWebview.ts",
"./vs/workbench/api/electron-browser/mainThreadWindow.ts",
"./vs/workbench/api/electron-browser/mainThreadWorkspace.ts",
"./vs/workbench/api/node/apiCommands.ts",
"./vs/workbench/api/node/extHost.protocol.ts",
"./vs/workbench/api/node/extHostApiCommands.ts",
"./vs/workbench/api/node/extHostCLIServer.ts",
"./vs/workbench/api/node/extHostClipboard.ts",
"./vs/workbench/api/node/extHostCommands.ts",
"./vs/workbench/api/node/extHostComments.ts",
"./vs/workbench/api/node/extHostConfiguration.ts",
// "./vs/workbench/api/node/extHostDebugService.ts",
"./vs/workbench/api/node/extHostDecorations.ts",
"./vs/workbench/api/node/extHostDiagnostics.ts",
"./vs/workbench/api/node/extHostDialogs.ts",
"./vs/workbench/api/node/extHostDocumentContentProviders.ts",
"./vs/workbench/api/node/extHostDocumentData.ts",
"./vs/workbench/api/node/extHostDocumentSaveParticipant.ts",
"./vs/workbench/api/node/extHostDocuments.ts",
"./vs/workbench/api/node/extHostDocumentsAndEditors.ts",
"./vs/workbench/api/node/extHostExtensionActivator.ts",
"./vs/workbench/api/node/extHostFileSystem.ts",
"./vs/workbench/api/node/extHostFileSystemEventService.ts",
"./vs/workbench/api/node/extHostHeapService.ts",
"./vs/workbench/api/node/extHostLanguageFeatures.ts",
"./vs/workbench/api/node/extHostLanguages.ts",
"./vs/workbench/api/node/extHostLogService.ts",
"./vs/workbench/api/node/extHostMessageService.ts",
"./vs/workbench/api/node/extHostOutputService.ts",
"./vs/workbench/api/node/extHostProgress.ts",
"./vs/workbench/api/node/extHostQuickOpen.ts",
"./vs/workbench/api/node/extHostSCM.ts",
"./vs/workbench/api/node/extHostSearch.ts",
"./vs/workbench/api/node/extHostStatusBar.ts",
"./vs/workbench/api/node/extHostStorage.ts",
// "./vs/workbench/api/node/extHostTask.ts",
"./vs/workbench/api/node/extHostTerminalService.ts",
"./vs/workbench/api/node/extHostTextEditor.ts",
"./vs/workbench/api/node/extHostTextEditors.ts",
"./vs/workbench/api/node/extHostTreeViews.ts",
"./vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts",
"./vs/workbench/api/node/extHostTypeConverters.ts",
"./vs/workbench/api/node/extHostTypes.ts",
"./vs/workbench/api/node/extHostUrls.ts",
"./vs/workbench/api/node/extHostWebview.ts",
"./vs/workbench/api/node/extHostWindow.ts",
"./vs/workbench/api/node/extHostWorkspace.ts",
"./vs/workbench/api/shared/editor.ts",
"./vs/workbench/api/shared/tasks.ts",
"./vs/workbench/contrib/backup/common/backup.contribution.ts",
"./vs/workbench/contrib/backup/common/backupModelTracker.ts",
"./vs/workbench/contrib/backup/common/backupRestorer.ts",
"./vs/workbench/contrib/cli/node/cli.contribution.ts",
"./vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.ts",
"./vs/workbench/contrib/codeEditor/browser/codeEditor.contribution.ts",
"./vs/workbench/contrib/codeEditor/browser/inspectKeybindings.ts",
"./vs/workbench/contrib/codeEditor/browser/inspectTMScopes/inspectTMScopes.ts",
"./vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.ts",
"./vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.ts",
"./vs/workbench/contrib/codeEditor/browser/menuPreventer.ts",
"./vs/workbench/contrib/codeEditor/browser/selectionClipboard.ts",
"./vs/workbench/contrib/codeEditor/browser/simpleEditorOptions.ts",
"./vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts",
"./vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts",
"./vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.ts",
"./vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.ts",
"./vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts",
"./vs/workbench/contrib/codeEditor/browser/toggleWordWrap.ts",
"./vs/workbench/contrib/codeEditor/browser/workbenchReferenceSearch.ts",
"./vs/workbench/contrib/codeEditor/electron-browser/codeEditor.contribution.ts",
"./vs/workbench/contrib/codeEditor/electron-browser/sleepResumeRepaintMinimap.ts",
"./vs/workbench/contrib/codeinset/common/codeInset.ts",
"./vs/workbench/contrib/codeinset/electron-browser/codeInset.contribution.ts",
"./vs/workbench/contrib/codeinset/electron-browser/codeInsetWidget.ts",
"./vs/workbench/contrib/comments/common/commentModel.ts",
"./vs/workbench/contrib/comments/common/commentThreadWidget.ts",
"./vs/workbench/contrib/comments/electron-browser/commentGlyphWidget.ts",
"./vs/workbench/contrib/comments/electron-browser/commentsTreeViewer.ts",
"./vs/workbench/contrib/comments/electron-browser/reactionsAction.ts",
"./vs/workbench/contrib/comments/electron-browser/simpleCommentEditor.ts",
"./vs/workbench/contrib/experiments/electron-browser/experimentalPrompt.ts",
"./vs/workbench/contrib/experiments/electron-browser/experiments.contribution.ts",
"./vs/workbench/contrib/experiments/node/experimentService.ts",
"./vs/workbench/contrib/experiments/test/electron-browser/experimentService.test.ts",
"./vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts",
"./vs/workbench/contrib/extensions/browser/extensionsQuickOpen.ts",
"./vs/workbench/contrib/extensions/browser/extensionsViewer.ts",
"./vs/workbench/contrib/extensions/common/extensionQuery.ts",
"./vs/workbench/contrib/extensions/common/extensions.ts",
"./vs/workbench/contrib/extensions/common/extensionsFileTemplate.ts",
"./vs/workbench/contrib/extensions/common/extensionsInput.ts",
"./vs/workbench/contrib/extensions/common/extensionsUtils.ts",
"./vs/workbench/contrib/extensions/electron-browser/extensionEditor.ts",
"./vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts",
"./vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts",
"./vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts",
"./vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts",
"./vs/workbench/contrib/extensions/electron-browser/extensionsActivationProgress.ts",
"./vs/workbench/contrib/extensions/electron-browser/extensionsAutoProfiler.ts",
"./vs/workbench/contrib/extensions/electron-browser/extensionsList.ts",
"./vs/workbench/contrib/extensions/electron-browser/extensionsViewlet.ts",
"./vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts",
"./vs/workbench/contrib/extensions/electron-browser/extensionsWidgets.ts",
"./vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts",
"./vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsInput.ts",
"./vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts",
"./vs/workbench/contrib/extensions/test/common/extensionQuery.test.ts",
"./vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts",
"./vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts",
"./vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts",
"./vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts",
"./vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts",
"./vs/workbench/contrib/feedback/electron-browser/feedback.ts",
"./vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem.ts",
"./vs/workbench/contrib/format/browser/format.contribution.ts",
"./vs/workbench/contrib/localizations/browser/localizations.contribution.ts",
"./vs/workbench/contrib/localizations/browser/localizationsActions.ts",
"./vs/workbench/contrib/localizations/browser/minimalTranslations.ts",
"./vs/workbench/contrib/logs/common/logConstants.ts",
"./vs/workbench/contrib/logs/common/logs.contribution.ts",
"./vs/workbench/contrib/logs/common/logsActions.ts",
"./vs/workbench/contrib/markers/browser/constants.ts",
"./vs/workbench/contrib/markers/browser/markers.contribution.ts",
"./vs/workbench/contrib/markers/browser/markers.ts",
"./vs/workbench/contrib/markers/browser/markersFileDecorations.ts",
"./vs/workbench/contrib/markers/browser/markersFilterOptions.ts",
"./vs/workbench/contrib/markers/browser/markersModel.ts",
"./vs/workbench/contrib/markers/browser/markersPanel.ts",
"./vs/workbench/contrib/markers/browser/markersPanelActions.ts",
"./vs/workbench/contrib/markers/browser/markersTreeViewer.ts",
"./vs/workbench/contrib/markers/browser/messages.ts",
"./vs/workbench/contrib/markers/test/electron-browser/markersModel.test.ts",
"./vs/workbench/contrib/output/browser/logViewer.ts",
"./vs/workbench/contrib/output/browser/output.contribution.ts",
"./vs/workbench/contrib/output/browser/outputActions.ts",
"./vs/workbench/contrib/output/browser/outputPanel.ts",
"./vs/workbench/contrib/output/browser/outputServices.ts",
"./vs/workbench/contrib/output/common/output.ts",
"./vs/workbench/contrib/output/common/outputLinkComputer.ts",
"./vs/workbench/contrib/output/common/outputLinkProvider.ts",
"./vs/workbench/contrib/output/test/outputLinkProvider.test.ts",
"./vs/workbench/contrib/preferences/browser/preferencesEditor.ts",
"./vs/workbench/contrib/preferences/browser/preferencesRenderers.ts",
"./vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.ts",
"./vs/workbench/contrib/preferences/browser/keybindingWidgets.ts",
"./vs/workbench/contrib/preferences/browser/preferencesActions.ts",
"./vs/workbench/contrib/preferences/browser/preferencesWidgets.ts",
"./vs/workbench/contrib/preferences/browser/settingsLayout.ts",
"./vs/workbench/contrib/preferences/browser/settingsWidgets.ts",
"./vs/workbench/contrib/preferences/browser/tocTree.ts",
"./vs/workbench/contrib/preferences/common/preferences.ts",
"./vs/workbench/contrib/preferences/common/preferencesContribution.ts",
"./vs/workbench/contrib/preferences/common/smartSnippetInserter.ts",
"./vs/workbench/contrib/preferences/electron-browser/preferencesSearch.ts",
"./vs/workbench/contrib/preferences/test/common/smartSnippetInserter.test.ts",
"./vs/workbench/contrib/quickopen/browser/commandsHandler.ts",
"./vs/workbench/contrib/quickopen/browser/gotoLineHandler.ts",
"./vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts",
"./vs/workbench/contrib/quickopen/browser/helpHandler.ts",
"./vs/workbench/contrib/quickopen/browser/quickopen.contribution.ts",
"./vs/workbench/contrib/quickopen/browser/viewPickerHandler.ts",
"./vs/workbench/contrib/relauncher/electron-browser/relauncher.contribution.ts",
"./vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts",
"./vs/workbench/contrib/scm/browser/scmActivity.ts",
"./vs/workbench/contrib/scm/browser/scmMenus.ts",
"./vs/workbench/contrib/scm/browser/scmUtil.ts",
"./vs/workbench/contrib/scm/common/scm.ts",
"./vs/workbench/contrib/scm/common/scmService.ts",
"./vs/workbench/contrib/search/browser/openAnythingHandler.ts",
"./vs/workbench/contrib/search/browser/openFileHandler.ts",
"./vs/workbench/contrib/search/browser/openSymbolHandler.ts",
"./vs/workbench/contrib/search/browser/patternInputWidget.ts",
"./vs/workbench/contrib/search/browser/replaceContributions.ts",
"./vs/workbench/contrib/search/browser/replaceService.ts",
"./vs/workbench/contrib/search/common/constants.ts",
"./vs/workbench/contrib/search/common/queryBuilder.ts",
"./vs/workbench/contrib/search/common/replace.ts",
"./vs/workbench/contrib/search/common/search.ts",
"./vs/workbench/contrib/search/common/searchHistoryService.ts",
"./vs/workbench/contrib/search/common/searchModel.ts",
"./vs/workbench/contrib/search/test/browser/mockSearchTree.ts",
"./vs/workbench/contrib/search/test/browser/openFileHandler.test.ts",
"./vs/workbench/contrib/search/test/browser/searchViewlet.test.ts",
"./vs/workbench/contrib/search/test/common/queryBuilder.test.ts",
"./vs/workbench/contrib/search/test/common/searchModel.test.ts",
"./vs/workbench/contrib/search/test/common/searchResult.test.ts",
"./vs/workbench/contrib/stats/node/workspaceStats.ts",
"./vs/workbench/contrib/stats/test/workspaceStats.test.ts",
"./vs/workbench/contrib/surveys/electron-browser/languageSurveys.contribution.ts",
"./vs/workbench/contrib/surveys/electron-browser/nps.contribution.ts",
"./vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts",
"./vs/workbench/contrib/themes/browser/themes.contribution.ts",
"./vs/workbench/contrib/themes/test/electron-browser/themes.test.contribution.ts",
"./vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts",
"./vs/workbench/contrib/update/electron-browser/update.contribution.ts",
"./vs/workbench/contrib/update/electron-browser/update.ts",
"./vs/workbench/contrib/url/common/url.contribution.ts",
"./vs/workbench/contrib/watermark/browser/watermark.ts",
"./vs/workbench/services/activity/browser/activityService.ts",
"./vs/workbench/services/activity/common/activity.ts",
"./vs/workbench/services/activityBar/browser/activityBarService.ts",
"./vs/workbench/services/backup/common/backup.ts",
"./vs/workbench/services/backup/node/backupFileService.ts",
"./vs/workbench/services/backup/test/electron-browser/backupFileService.test.ts",
"./vs/workbench/services/broadcast/electron-browser/broadcastService.ts",
"./vs/workbench/services/configuration/common/configurationEditingService.ts",
"./vs/workbench/services/configuration/common/jsonEditingService.ts",
"./vs/workbench/services/configuration/node/configuration.ts",
"./vs/workbench/services/configuration/node/configurationService.ts",
"./vs/workbench/services/configuration/test/common/configurationModels.test.ts",
"./vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts",
"./vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts",
"./vs/workbench/services/configurationResolver/common/configurationResolver.ts",
"./vs/workbench/services/configurationResolver/common/configurationResolverSchema.ts",
"./vs/workbench/services/configurationResolver/common/configurationResolverUtils.ts",
"./vs/workbench/services/contextmenu/electron-browser/contextmenuService.ts",
"./vs/workbench/services/decorations/browser/decorations.ts",
"./vs/workbench/services/decorations/browser/decorationsService.ts",
"./vs/workbench/services/decorations/test/browser/decorationsService.test.ts",
"./vs/workbench/services/dialogs/browser/remoteFileDialog.ts",
"./vs/workbench/services/dialogs/browser/fileDialogService.ts",
"./vs/workbench/services/dialogs/electron-browser/dialogService.ts",
"./vs/workbench/services/editor/browser/codeEditorService.ts",
"./vs/workbench/services/editor/browser/editorService.ts",
"./vs/workbench/services/editor/common/editorGroupsService.ts",
"./vs/workbench/services/editor/common/editorService.ts",
"./vs/workbench/services/editor/test/browser/editorGroupsService.test.ts",
"./vs/workbench/services/editor/test/browser/editorService.test.ts",
"./vs/workbench/services/extensionManagement/node/multiExtensionManagement.ts",
"./vs/workbench/services/extensions/common/extensions.ts",
"./vs/workbench/services/extensions/common/extensionsRegistry.ts",
"./vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts",
"./vs/workbench/services/extensions/electron-browser/extensionHost.ts",
"./vs/workbench/services/extensions/electron-browser/extensionHostProcessManager.ts",
"./vs/workbench/services/extensions/electron-browser/extensionHostProfiler.ts",
"./vs/workbench/services/extensions/electron-browser/extensionManagementServerService.ts",
"./vs/workbench/services/extensions/electron-browser/extensionService.ts",
"./vs/workbench/services/extensions/electron-browser/inactiveExtensionUrlHandler.ts",
"./vs/workbench/services/extensions/node/extensionDescriptionRegistry.ts",
"./vs/workbench/services/extensions/node/extensionHostProtocol.ts",
"./vs/workbench/services/extensions/node/extensionPoints.ts",
"./vs/workbench/services/extensions/node/extensionsUtil.ts",
"./vs/workbench/services/extensions/node/lazyPromise.ts",
"./vs/workbench/services/extensions/node/proxyIdentifier.ts",
"./vs/workbench/services/extensions/node/rpcProtocol.ts",
"./vs/workbench/services/extensions/test/node/rpcProtocol.test.ts",
"./vs/workbench/services/files/node/encoding.ts",
"./vs/workbench/services/files/node/fileService.ts",
"./vs/workbench/services/files/node/remoteFileService.ts",
"./vs/workbench/services/files/node/streams.ts",
"./vs/workbench/services/files/test/electron-browser/fileService.test.ts",
"./vs/workbench/services/files/test/electron-browser/resolver.test.ts",
"./vs/workbench/services/files/test/electron-browser/utils.ts",
"./vs/workbench/services/files/test/electron-browser/watcher.test.ts",
"./vs/workbench/services/hash/common/hashService.ts",
"./vs/workbench/services/hash/node/hashService.ts",
"./vs/workbench/services/hash/test/hashService.test.ts",
"./vs/workbench/services/history/browser/history.ts",
"./vs/workbench/services/history/common/history.ts",
"./vs/workbench/services/integrity/common/integrity.ts",
"./vs/workbench/services/integrity/node/integrityService.ts",
"./vs/workbench/services/keybinding/common/keybindingEditing.ts",
"./vs/workbench/services/keybinding/common/keybindingIO.ts",
"./vs/workbench/services/keybinding/common/keyboardMapper.ts",
"./vs/workbench/services/keybinding/common/macLinuxFallbackKeyboardMapper.ts",
"./vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts",
"./vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts",
"./vs/workbench/services/keybinding/electron-browser/keybindingService.ts",
"./vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts",
"./vs/workbench/services/keybinding/test/keybindingIO.test.ts",
"./vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts",
"./vs/workbench/services/keybinding/test/macLinuxFallbackKeyboardMapper.test.ts",
"./vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts",
"./vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts",
"./vs/workbench/services/label/common/labelService.ts",
"./vs/workbench/services/label/test/label.test.ts",
"./vs/workbench/services/layout/browser/layoutService.ts",
"./vs/workbench/services/mode/common/workbenchModeService.ts",
"./vs/workbench/services/notification/common/notificationService.ts",
"./vs/workbench/services/panel/common/panelService.ts",
"./vs/workbench/services/preferences/common/preferencesModels.ts",
"./vs/workbench/services/preferences/common/keybindingsEditorModel.ts",
"./vs/workbench/services/preferences/test/common/keybindingsEditorModel.test.ts",
"./vs/workbench/services/progress/browser/progressService.ts",
"./vs/workbench/services/progress/browser/progressService2.ts",
"./vs/workbench/services/progress/test/progressService.test.ts",
"./vs/workbench/services/remote/common/remoteAgentService.ts",
"./vs/workbench/services/remote/common/remoteEnvironmentService.ts",
"./vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl.ts",
"./vs/workbench/services/remote/node/remoteAgentEnvironmentChannel.ts",
"./vs/workbench/services/search/common/replace.ts",
"./vs/workbench/services/search/common/search.ts",
"./vs/workbench/services/search/common/searchHelpers.ts",
"./vs/workbench/services/search/node/fileSearch.ts",
"./vs/workbench/services/search/node/fileSearchManager.ts",
"./vs/workbench/services/search/node/rawSearchService.ts",
"./vs/workbench/services/search/node/ripgrepFileSearch.ts",
"./vs/workbench/services/search/node/ripgrepSearchProvider.ts",
"./vs/workbench/services/search/node/ripgrepSearchUtils.ts",
"./vs/workbench/services/search/node/ripgrepTextSearchEngine.ts",
"./vs/workbench/services/search/node/searchApp.ts",
"./vs/workbench/services/search/node/searchIpc.ts",
"./vs/workbench/services/search/node/textSearchAdapter.ts",
"./vs/workbench/services/search/node/textSearchManager.ts",
"./vs/workbench/services/search/test/common/replace.test.ts",
"./vs/workbench/services/search/test/common/search.test.ts",
"./vs/workbench/services/search/test/common/searchHelpers.test.ts",
"./vs/workbench/services/search/test/node/ripgrepFileSearch.test.ts",
"./vs/workbench/services/search/test/node/ripgrepTextSearchEngine.test.ts",
"./vs/workbench/services/search/test/node/search.test.ts",
"./vs/workbench/services/search/test/node/textSearch.integrationTest.ts",
"./vs/workbench/services/search/test/node/textSearchManager.test.ts",
"./vs/workbench/services/textMate/common/TMGrammars.ts",
"./vs/workbench/services/textMate/common/TMHelper.ts",
"./vs/workbench/services/textMate/common/textMateService.ts",
"./vs/workbench/services/textMate/electron-browser/textMateService.ts",
"./vs/workbench/services/textfile/common/textFileEditorModel.ts",
"./vs/workbench/services/textfile/common/textFileEditorModelManager.ts",
"./vs/workbench/services/textfile/common/textFileService.ts",
"./vs/workbench/services/textfile/common/textfiles.ts",
"./vs/workbench/services/textfile/node/textResourcePropertiesService.ts",
"./vs/workbench/services/textfile/test/textFileEditorModel.test.ts",
"./vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts",
"./vs/workbench/services/textfile/test/textFileService.test.ts",
"./vs/workbench/services/textmodelResolver/common/textModelResolverService.ts",
"./vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts",
"./vs/workbench/services/timer/electron-browser/timerService.ts",
"./vs/workbench/services/title/common/titleService.ts",
"./vs/workbench/services/untitled/common/untitledEditorService.ts",
"./vs/workbench/services/viewlet/browser/viewlet.ts",
"./vs/workbench/services/workspace/common/workspaceEditing.ts",
"./vs/workbench/services/configurationResolver/common/variableResolver.ts",
"./vs/workbench/services/workspace/node/workspaceEditingService.ts",
"./vs/workbench/test/browser/actionRegistry.test.ts",
"./vs/workbench/test/browser/part.test.ts",
"./vs/workbench/test/browser/parts/editor/baseEditor.test.ts",
"./vs/workbench/test/browser/parts/editor/breadcrumbModel.test.ts",
"./vs/workbench/test/browser/parts/editor/rangeDecorations.test.ts",
"./vs/workbench/test/browser/parts/views/views.test.ts",
"./vs/workbench/test/browser/quickopen.test.ts",
"./vs/workbench/test/browser/viewlet.test.ts",
"./vs/workbench/test/common/editor/dataUriEditorInput.test.ts",
"./vs/workbench/test/common/editor/editor.test.ts",
"./vs/workbench/test/common/editor/editorDiffModel.test.ts",
"./vs/workbench/test/common/editor/editorGroups.test.ts",
"./vs/workbench/test/common/editor/editorInput.test.ts",
"./vs/workbench/test/common/editor/editorModel.test.ts",
"./vs/workbench/test/common/editor/editorOptions.test.ts",
"./vs/workbench/test/common/editor/resourceEditorInput.test.ts",
"./vs/workbench/test/common/editor/untitledEditor.test.ts",
"./vs/workbench/test/common/memento.test.ts",
"./vs/workbench/test/common/notifications.test.ts",
"./vs/workbench/test/electron-browser/api/extHost.api.impl.test.ts",
"./vs/workbench/test/electron-browser/api/extHostCommands.test.ts",
"./vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts",
"./vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts",
"./vs/workbench/test/electron-browser/api/extHostDocumentData.test.ts",
"./vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts",
"./vs/workbench/test/electron-browser/api/extHostDocumentsAndEditors.test.ts",
"./vs/workbench/test/electron-browser/api/extHostFileSystemEventService.test.ts",
"./vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts",
"./vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts",
"./vs/workbench/test/electron-browser/api/extHostSearch.test.ts",
"./vs/workbench/test/electron-browser/api/extHostTextEditor.test.ts",
"./vs/workbench/test/electron-browser/api/extHostTextEditors.test.ts",
"./vs/workbench/test/electron-browser/api/extHostTypeConverter.test.ts",
"./vs/workbench/test/electron-browser/api/extHostTypes.test.ts",
"./vs/workbench/test/electron-browser/api/extHostWebview.test.ts",
"./vs/workbench/test/electron-browser/api/extHostWorkspace.test.ts",
"./vs/workbench/test/electron-browser/api/mainThreadCommands.test.ts",
"./vs/workbench/test/electron-browser/api/mainThreadConfiguration.test.ts",
"./vs/workbench/test/electron-browser/api/mainThreadDiagnostics.test.ts",
"./vs/workbench/test/electron-browser/api/mainThreadDocumentContentProviders.test.ts",
"./vs/workbench/test/electron-browser/api/mainThreadDocuments.test.ts",
"./vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts",
"./vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts",
"./vs/workbench/test/electron-browser/api/mainThreadSaveParticipant.test.ts",
"./vs/workbench/test/electron-browser/api/mainThreadWorkspace.test.ts",
"./vs/workbench/test/electron-browser/api/mock.ts",
"./vs/workbench/test/electron-browser/api/testRPCProtocol.ts",
"./vs/workbench/test/electron-browser/colorRegistry.releaseTest.ts",
"./vs/workbench/test/workbenchTestServices.ts"
],
"exclude": [
"./typings/require-monaco.d.ts",
"./vs/workbench/contrib/comments/electron-browser/commentThreadWidget.ts"
]
}
@@ -16,6 +16,7 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';
import { Event, Emitter } from 'vs/base/common/event';
import { asArray } from 'vs/base/common/arrays';
export interface IActionItem {
actionRunner: IActionRunner;
@@ -593,7 +594,7 @@ export class ActionBar extends Disposable implements IActionRunner {
}
push(arg: IAction | IAction[], options: IActionOptions = {}): void {
const actions: IAction[] = !Array.isArray(arg) ? [arg] : arg;
const actions: IAction[] = asArray(arg);
let index = types.isNumber(options.index) ? options.index : null;
+3 -2
View File
@@ -17,6 +17,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import { KeyCode, ResolvedKeybinding } from 'vs/base/common/keyCodes';
import { Disposable, dispose, IDisposable } from 'vs/base/common/lifecycle';
import { withNullAsUndefined } from 'vs/base/common/types';
import { asArray } from 'vs/base/common/arrays';
const $ = DOM.$;
@@ -184,7 +185,7 @@ export class MenuBar extends Disposable {
}
push(arg: MenuBarMenu | MenuBarMenu[]): void {
const menus: MenuBarMenu[] = !Array.isArray(arg) ? [arg] : arg;
const menus: MenuBarMenu[] = asArray(arg);
menus.forEach((menuBarMenu) => {
const menuIndex = this.menuCache.length;
@@ -993,4 +994,4 @@ class ModifierKeyEmitter extends Emitter<IModifierKeyStatus> {
super.dispose();
this._subscriptions = dispose(this._subscriptions);
}
}
}
+4
View File
@@ -549,3 +549,7 @@ export function mapArrayOrNot<T, U>(items: T | T[], fn: (_: T) => U): U | U[] {
items.map(fn) :
fn(items);
}
export function asArray<T>(x: T | T[]): T[] {
return Array.isArray(x) ? x : [x];
}
+654 -138
View File
@@ -8,6 +8,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import { IMessagePassingProtocol, ClientConnectionEvent, IPCServer, IPCClient } from 'vs/base/parts/ipc/node/ipc';
import { join } from 'vs/base/common/path';
import { tmpdir } from 'os';
import * as fs from 'fs';
import { generateUuid } from 'vs/base/common/uuid';
import { IDisposable } from 'vs/base/common/lifecycle';
@@ -21,6 +22,18 @@ export function generateRandomPipeName(): string {
}
}
function log(fd: number, msg: string, data?: Buffer): void {
const date = new Date();
fs.writeSync(fd, `[${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}.${date.getMilliseconds()}] ${msg}\n`);
if (data) {
fs.writeSync(fd, data);
fs.writeSync(fd, `\n---------------------------------------------------------------------------------------------------------\n`);
}
fs.fdatasyncSync(fd);
}
const EMPTY_BUFFER = Buffer.allocUnsafe(0);
class ChunkStream {
private _chunks: Buffer[];
@@ -40,14 +53,9 @@ class ChunkStream {
this._totalLength += buff.byteLength;
}
public readUInt32BE(): number {
let tmp = this.read(4);
return tmp.readUInt32BE(0);
}
public read(byteCount: number): Buffer {
if (byteCount === 0) {
return Buffer.allocUnsafe(0);
return EMPTY_BUFFER;
}
if (byteCount > this._totalLength) {
@@ -95,23 +103,250 @@ class ChunkStream {
}
}
const enum ProtocolMessageType {
None = 0,
Regular = 1,
Control = 2,
Ack = 3,
KeepAlive = 4
}
function ProtocolMessageTypeToString(type: ProtocolMessageType): string {
switch (type) {
case ProtocolMessageType.None: return 'None';
case ProtocolMessageType.Regular: return 'Regular';
case ProtocolMessageType.Control: return 'Control';
case ProtocolMessageType.Ack: return 'Ack';
case ProtocolMessageType.KeepAlive: return 'KeepAlive';
}
}
export const enum ProtocolConstants {
HeaderLength = 13,
/**
* Send an Acknowledge message at most 2 seconds later...
*/
AcknowledgeTime = 2000, // 2 seconds
/**
* If there is a message that has been unacknowledged for 10 seconds, consider the connection closed...
*/
AcknowledgeTimeoutTime = 10000, // 10 seconds
/**
* Send at least a message every 30s for keep alive reasons.
*/
KeepAliveTime = 30000, // 30 seconds
/**
* If there is no message received for 60 seconds, consider the connection closed...
*/
KeepAliveTimeoutTime = 60000, // 60 seconds
/**
* If there is no reconnection within this time-frame, consider the connection permanently closed...
*/
ReconnectionGraceTime = 60 * 60 * 1000, // 1hr
}
class ProtocolMessage {
public writtenTime: number;
constructor(
public readonly type: ProtocolMessageType,
public readonly id: number,
public readonly ack: number,
public readonly data: Buffer
) {
this.writtenTime = 0;
}
public get size(): number {
return this.data.byteLength;
}
}
class ProtocolReader {
private readonly _socket: Socket;
private _isDisposed: boolean;
private readonly _incomingData: ChunkStream;
private readonly _socketDataListener: (data: Buffer) => void;
public lastReadTime: number;
private readonly _onMessage = new Emitter<ProtocolMessage>();
public readonly onMessage: Event<ProtocolMessage> = this._onMessage.event;
private readonly _state = {
readHead: true,
readLen: ProtocolConstants.HeaderLength,
messageType: ProtocolMessageType.None,
id: 0,
ack: 0
};
constructor(socket: Socket) {
this._socket = socket;
this._isDisposed = false;
this._incomingData = new ChunkStream();
this._socketDataListener = (data: Buffer) => this.acceptChunk(data);
this._socket.on('data', this._socketDataListener);
this.lastReadTime = Date.now();
}
public acceptChunk(data: Buffer | null): void {
if (!data || data.byteLength === 0) {
return;
}
this.lastReadTime = Date.now();
this._incomingData.acceptChunk(data);
while (this._incomingData.byteLength >= this._state.readLen) {
const buff = this._incomingData.read(this._state.readLen);
if (this._state.readHead) {
// buff is the header
// save new state => next time will read the body
this._state.readHead = false;
this._state.readLen = buff.readUInt32BE(9, true);
this._state.messageType = <ProtocolMessageType>buff.readUInt8(0, true);
this._state.id = buff.readUInt32BE(1, true);
this._state.ack = buff.readUInt32BE(5, true);
} else {
// buff is the body
const messageType = this._state.messageType;
const id = this._state.id;
const ack = this._state.ack;
// save new state => next time will read the header
this._state.readHead = true;
this._state.readLen = ProtocolConstants.HeaderLength;
this._state.messageType = ProtocolMessageType.None;
this._state.id = 0;
this._state.ack = 0;
this._onMessage.fire(new ProtocolMessage(messageType, id, ack, buff));
if (this._isDisposed) {
// check if an event listener lead to our disposal
break;
}
}
}
}
public readEntireBuffer(): Buffer {
return this._incomingData.read(this._incomingData.byteLength);
}
public dispose(): void {
this._isDisposed = true;
this._socket.removeListener('data', this._socketDataListener);
}
}
class ProtocolWriter {
private readonly _socket: Socket;
private readonly _logFile: number;
private _data: Buffer[];
private _totalLength;
public lastWriteTime: number;
constructor(socket: Socket, logFile: number) {
this._socket = socket;
this._logFile = logFile;
this._data = [];
this._totalLength = 0;
this.lastWriteTime = 0;
}
public dispose(): void {
this.flush();
}
public flush(): void {
// flush
this._writeNow();
}
public write(msg: ProtocolMessage) {
if (this._logFile) {
log(this._logFile, `send-${ProtocolMessageTypeToString(msg.type)}-${msg.id}-${msg.ack}-`, msg.data);
}
msg.writtenTime = Date.now();
this.lastWriteTime = Date.now();
const header = Buffer.allocUnsafe(ProtocolConstants.HeaderLength);
header.writeUInt8(msg.type, 0, true);
header.writeUInt32BE(msg.id, 1, true);
header.writeUInt32BE(msg.ack, 5, true);
header.writeUInt32BE(msg.data.length, 9, true);
this._writeSoon(header, msg.data);
}
private _bufferAdd(head: Buffer, body: Buffer): boolean {
const wasEmpty = this._totalLength === 0;
this._data.push(head, body);
this._totalLength += head.length + body.length;
return wasEmpty;
}
private _bufferTake(): Buffer {
const ret = Buffer.concat(this._data, this._totalLength);
this._data.length = 0;
this._totalLength = 0;
return ret;
}
private _writeSoon(header: Buffer, data: Buffer): void {
if (this._bufferAdd(header, data)) {
setImmediate(() => {
this._writeNow();
});
}
}
private _writeNow(): void {
if (this._totalLength === 0) {
return;
}
// return early if socket has been destroyed in the meantime
if (this._socket.destroyed) {
return;
}
// we ignore the returned value from `write` because we would have to cached the data
// anyways and nodejs is already doing that for us:
// > https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback
// > However, the false return value is only advisory and the writable stream will unconditionally
// > accept and buffer chunk even if it has not not been allowed to drain.
this._socket.write(this._bufferTake());
}
}
/**
* A message has the following format:
* ```
* /-------------------------------|------\
* | HEADER | |
* |-------------------------------| DATA |
* | TYPE | ID | ACK | DATA_LENGTH | |
* \-------------------------------|------/
* ```
* The header is 9 bytes and consists of:
* - TYPE is 1 byte (ProtocolMessageType) - the message type
* - ID is 4 bytes (u32be) - the message id (can be 0 to indicate to be ignored)
* - ACK is 4 bytes (u32be) - the acknowledged message id (can be 0 to indicate to be ignored)
* - DATA_LENGTH is 4 bytes (u32be) - the length in bytes of DATA
*
* [bodyLen|message]
* [header^|data^^^]
* [u32be^^|buffer^]
* Only Regular messages are counted, other messages are not counted, nor acknowledged.
*/
export class Protocol implements IDisposable, IMessagePassingProtocol {
private static readonly _headerLen = 4;
private _socket: Socket;
private _socketWriter: ProtocolWriter;
private _socketReader: ProtocolReader;
private _isDisposed: boolean;
private _incomingData: ChunkStream;
private _socketDataListener: (data: Buffer) => void;
private _socketEndListener: () => void;
private _socketCloseListener: () => void;
private _onMessage = new Emitter<Buffer>();
@@ -120,72 +355,25 @@ export class Protocol implements IDisposable, IMessagePassingProtocol {
private _onClose = new Emitter<void>();
readonly onClose: Event<void> = this._onClose.event;
constructor(private _socket: Socket) {
this._isDisposed = false;
this._incomingData = new ChunkStream();
constructor(socket: Socket) {
this._socket = socket;
this._socketWriter = new ProtocolWriter(this._socket, 0);
this._socketReader = new ProtocolReader(this._socket);
const state = {
readHead: true,
bodyLen: -1,
};
const acceptChunk = (data: Buffer) => {
this._incomingData.acceptChunk(data);
while (this._incomingData.byteLength > 0) {
if (state.readHead) {
// expecting header -> read header
if (this._incomingData.byteLength >= Protocol._headerLen) {
state.bodyLen = this._incomingData.readUInt32BE();
state.readHead = false;
} else {
break;
}
}
if (!state.readHead) {
// expecting body -> read bodyLen-bytes for
// the actual message or wait for more data
if (this._incomingData.byteLength >= state.bodyLen) {
const buffer = this._incomingData.read(state.bodyLen);
state.bodyLen = -1;
state.readHead = true;
this._onMessage.fire(buffer);
if (this._isDisposed) {
// check if an event listener lead to our disposal
break;
}
} else {
break;
}
}
this._socketReader.onMessage((msg) => {
if (msg.type === ProtocolMessageType.Regular) {
this._onMessage.fire(msg.data);
}
};
this._socketDataListener = (data: Buffer) => {
acceptChunk(data);
};
_socket.on('data', this._socketDataListener);
this._socketEndListener = () => {
};
_socket.on('end', this._socketEndListener);
});
this._socketCloseListener = () => {
this._onClose.fire();
};
_socket.once('close', this._socketCloseListener);
this._socket.once('close', this._socketCloseListener);
}
dispose(): void {
this._isDisposed = true;
this._socket.removeListener('data', this._socketDataListener);
this._socket.removeListener('end', this._socketEndListener);
this._socketReader.dispose();
this._socket.removeListener('close', this._socketCloseListener);
}
@@ -193,51 +381,8 @@ export class Protocol implements IDisposable, IMessagePassingProtocol {
this._socket.end();
}
readEntireBuffer(): Buffer {
return this._incomingData.read(this._incomingData.byteLength);
}
send(buffer: Buffer): void {
const header = Buffer.allocUnsafe(Protocol._headerLen);
header.writeUInt32BE(buffer.length, 0, true);
this._writeSoon(header, buffer);
}
private _writeBuffer = new class {
private _data: Buffer[] = [];
private _totalLength = 0;
add(head: Buffer, body: Buffer): boolean {
const wasEmpty = this._totalLength === 0;
this._data.push(head, body);
this._totalLength += head.length + body.length;
return wasEmpty;
}
take(): Buffer {
const ret = Buffer.concat(this._data, this._totalLength);
this._data.length = 0;
this._totalLength = 0;
return ret;
}
};
private _writeSoon(header: Buffer, data: Buffer): void {
if (this._writeBuffer.add(header, data)) {
setImmediate(() => {
// return early if socket has been destroyed in the meantime
if (this._socket.destroyed) {
return;
}
// we ignore the returned value from `write` because we would have to cached the data
// anyways and nodejs is already doing that for us:
// > https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback
// > However, the false return value is only advisory and the writable stream will unconditionally
// > accept and buffer chunk even if it has not not been allowed to drain.
this._socket.write(this._writeBuffer.take());
});
}
this._socketWriter.write(new ProtocolMessage(ProtocolMessageType.Regular, 0, 0, buffer));
}
}
@@ -276,13 +421,14 @@ export class Client<TContext = string> extends IPCClient<TContext> {
get onClose(): Event<void> { return this.protocol.onClose; }
constructor(private protocol: Protocol | BufferedProtocol, id: TContext) {
constructor(private protocol: Protocol | PersistentProtocol, id: TContext) {
super(protocol, id);
}
dispose(): void {
super.dispose();
this.protocol.end();
this.protocol.dispose();
}
}
@@ -355,26 +501,396 @@ function createBufferedEvent<T>(source: Event<T>): Event<T> {
return emitter.event;
}
/**
* Will ensure no messages are lost if there are no event listeners.
*/
export class BufferedProtocol implements IMessagePassingProtocol {
class QueueElement<T> {
public readonly data: T;
public next: QueueElement<T> | null;
private readonly _actual: Protocol;
public readonly onMessage: Event<Buffer>;
public readonly onClose: Event<void>;
constructor(actual: Protocol) {
this._actual = actual;
this.onMessage = createBufferedEvent(this._actual.onMessage);
this.onClose = createBufferedEvent(this._actual.onClose);
}
public send(buffer: Buffer): void {
this._actual.send(buffer);
}
public end(): void {
this._actual.end();
constructor(data: T) {
this.data = data;
this.next = null;
}
}
class Queue<T> {
private _first: QueueElement<T> | null;
private _last: QueueElement<T> | null;
constructor() {
this._first = null;
this._last = null;
}
public peek(): T | null {
if (!this._first) {
return null;
}
return this._first.data;
}
public toArray(): T[] {
let result: T[] = [], resultLen = 0;
let it = this._first;
while (it) {
result[resultLen++] = it.data;
it = it.next;
}
return result;
}
public pop(): void {
if (!this._first) {
return;
}
if (this._first === this._last) {
this._first = null;
this._last = null;
return;
}
this._first = this._first.next;
}
public push(item: T): void {
const element = new QueueElement(item);
if (!this._first) {
this._first = element;
this._last = element;
return;
}
this._last!.next = element;
this._last = element;
}
}
/**
* Same as Protocol, but will actually track messages and acks.
* Moreover, it will ensure no messages are lost if there are no event listeners.
*/
export class PersistentProtocol {
private _logFile: number;
private _isReconnecting: boolean;
private _outgoingUnackMsg: Queue<ProtocolMessage>;
private _outgoingMsgId: number;
private _outgoingAckId: number;
private _outgoingAckTimeout: NodeJS.Timeout | null;
private _incomingMsgId: number;
private _incomingAckId: number;
private _incomingMsgLastTime: number;
private _incomingAckTimeout: NodeJS.Timeout | null;
private _outgoingKeepAliveTimeout: NodeJS.Timeout | null;
private _incomingKeepAliveTimeout: NodeJS.Timeout | null;
private _socket: Socket;
private _socketWriter: ProtocolWriter;
private _socketReader: ProtocolReader;
private _socketReaderListener: IDisposable;
private readonly _socketCloseListener: () => void;
private readonly _socketEndListener: () => void;
private readonly _socketErrorListener: (err: any) => void;
private _onControlMessage = new Emitter<Buffer>();
readonly onControlMessage: Event<Buffer> = createBufferedEvent(this._onControlMessage.event);
private _onMessage = new Emitter<Buffer>();
readonly onMessage: Event<Buffer> = createBufferedEvent(this._onMessage.event);
private _onClose = new Emitter<void>();
readonly onClose: Event<void> = createBufferedEvent(this._onClose.event);
private _onSocketClose = new Emitter<void>();
readonly onSocketClose: Event<void> = createBufferedEvent(this._onSocketClose.event);
private _onSocketTimeout = new Emitter<void>();
readonly onSocketTimeout: Event<void> = createBufferedEvent(this._onSocketTimeout.event);
public get unacknowledgedCount(): number {
return this._outgoingMsgId - this._outgoingAckId;
}
constructor(socket: Socket, initialChunk: Buffer | null = null, logFileName: string | null = null) {
this._logFile = 0;
this._isReconnecting = false;
if (logFileName) {
console.log(`PersistentProtocol log file: ${logFileName}`);
this._logFile = fs.openSync(logFileName, 'a');
}
this._outgoingUnackMsg = new Queue<ProtocolMessage>();
this._outgoingMsgId = 0;
this._outgoingAckId = 0;
this._outgoingAckTimeout = null;
this._incomingMsgId = 0;
this._incomingAckId = 0;
this._incomingMsgLastTime = 0;
this._incomingAckTimeout = null;
this._outgoingKeepAliveTimeout = null;
this._incomingKeepAliveTimeout = null;
this._socketCloseListener = () => {
console.log(`socket triggered close event!`);
this._onSocketClose.fire();
};
this._socketEndListener = () => {
// received FIN
this._onClose.fire();
};
this._socketErrorListener = (err) => {
console.log(`socket had an error: `, err);
};
this._socket = socket;
this._socketWriter = new ProtocolWriter(this._socket, this._logFile);
this._socketReader = new ProtocolReader(this._socket);
this._socketReaderListener = this._socketReader.onMessage(msg => this._receiveMessage(msg));
this._socket.on('close', this._socketCloseListener);
this._socket.on('end', this._socketEndListener);
this._socket.on('error', this._socketErrorListener);
if (initialChunk) {
this._socketReader.acceptChunk(initialChunk);
}
this._sendKeepAliveCheck();
this._recvKeepAliveCheck();
}
dispose(): void {
if (this._outgoingAckTimeout) {
clearTimeout(this._outgoingAckTimeout);
this._outgoingAckTimeout = null;
}
if (this._incomingAckTimeout) {
clearTimeout(this._incomingAckTimeout);
this._incomingAckTimeout = null;
}
if (this._outgoingKeepAliveTimeout) {
clearTimeout(this._outgoingKeepAliveTimeout);
this._outgoingKeepAliveTimeout = null;
}
if (this._incomingKeepAliveTimeout) {
clearTimeout(this._incomingKeepAliveTimeout);
this._incomingKeepAliveTimeout = null;
}
if (this._logFile) {
fs.closeSync(this._logFile);
}
this._socketWriter.dispose();
this._socketReader.dispose();
this._socketReaderListener.dispose();
this._socket.removeListener('close', this._socketCloseListener);
this._socket.removeListener('end', this._socketEndListener);
this._socket.removeListener('error', this._socketErrorListener);
}
private _sendKeepAliveCheck(): void {
if (this._outgoingKeepAliveTimeout) {
// there will be a check in the near future
return;
}
const timeSinceLastOutgoingMsg = Date.now() - this._socketWriter.lastWriteTime;
if (timeSinceLastOutgoingMsg >= ProtocolConstants.KeepAliveTime) {
// sufficient time has passed since last message was written,
// and no message from our side needed to be sent in the meantime,
// so we will send a message containing only a keep alive.
const msg = new ProtocolMessage(ProtocolMessageType.KeepAlive, 0, 0, EMPTY_BUFFER);
this._socketWriter.write(msg);
this._sendKeepAliveCheck();
return;
}
this._outgoingKeepAliveTimeout = setTimeout(() => {
this._outgoingKeepAliveTimeout = null;
this._sendKeepAliveCheck();
}, ProtocolConstants.KeepAliveTime - timeSinceLastOutgoingMsg + 5);
}
private _recvKeepAliveCheck(): void {
if (this._incomingKeepAliveTimeout) {
// there will be a check in the near future
return;
}
const timeSinceLastIncomingMsg = Date.now() - this._socketReader.lastReadTime;
if (timeSinceLastIncomingMsg >= ProtocolConstants.KeepAliveTimeoutTime) {
// Trash the socket
this._onSocketTimeout.fire(undefined);
return;
}
this._incomingKeepAliveTimeout = setTimeout(() => {
this._incomingKeepAliveTimeout = null;
this._recvKeepAliveCheck();
}, ProtocolConstants.KeepAliveTimeoutTime - timeSinceLastIncomingMsg + 5);
}
public getSocket(): Socket {
return this._socket;
}
public beginAcceptReconnection(socket: Socket, initialDataChunk: Buffer | null): void {
this._isReconnecting = true;
this._socketWriter.dispose();
this._socketReader.dispose();
this._socketReaderListener.dispose();
this._socket.removeListener('close', this._socketCloseListener);
this._socket.removeListener('end', this._socketEndListener);
this._socket.removeListener('error', this._socketErrorListener);
this._socket = socket;
this._socketWriter = new ProtocolWriter(this._socket, this._logFile);
this._socketReader = new ProtocolReader(this._socket);
this._socketReaderListener = this._socketReader.onMessage(msg => this._receiveMessage(msg));
this._socketReader.acceptChunk(initialDataChunk);
this._socket.on('close', this._socketCloseListener);
this._socket.on('end', this._socketEndListener);
this._socket.on('error', this._socketErrorListener);
}
public endAcceptReconnection(): void {
this._isReconnecting = false;
// Send again all unacknowledged messages
const toSend = this._outgoingUnackMsg.toArray();
for (let i = 0, len = toSend.length; i < len; i++) {
this._socketWriter.write(toSend[i]);
}
this._recvAckCheck();
this._sendKeepAliveCheck();
this._recvKeepAliveCheck();
}
private _receiveMessage(msg: ProtocolMessage): void {
if (this._logFile) {
log(this._logFile, `recv-${ProtocolMessageTypeToString(msg.type)}-${msg.id}-${msg.ack}-`, msg.data);
}
if (msg.ack > this._outgoingAckId) {
this._outgoingAckId = msg.ack;
do {
const first = this._outgoingUnackMsg.peek();
if (first && first.id <= msg.ack) {
// this message has been confirmed, remove it
this._outgoingUnackMsg.pop();
} else {
break;
}
} while (true);
}
if (msg.type === ProtocolMessageType.Regular) {
if (msg.id > this._incomingMsgId) {
if (msg.id !== this._incomingMsgId + 1) {
console.error(`PROTOCOL CORRUPTION, LAST SAW MSG ${this._incomingMsgId} AND HAVE NOW RECEIVED MSG ${msg.id}`);
}
this._incomingMsgId = msg.id;
this._incomingMsgLastTime = Date.now();
this._sendAckCheck();
this._onMessage.fire(msg.data);
}
} else if (msg.type === ProtocolMessageType.Control) {
this._onControlMessage.fire(msg.data);
}
}
end(): void {
this._socket.end();
}
readEntireBuffer(): Buffer {
return this._socketReader.readEntireBuffer();
}
flush(): void {
this._socketWriter.flush();
}
send(buffer: Buffer): void {
const myId = ++this._outgoingMsgId;
this._incomingAckId = this._incomingMsgId;
const msg = new ProtocolMessage(ProtocolMessageType.Regular, myId, this._incomingAckId, buffer);
this._outgoingUnackMsg.push(msg);
if (!this._isReconnecting) {
this._socketWriter.write(msg);
this._recvAckCheck();
}
}
/**
* Send a message which will not be part of the regular acknowledge flow.
* Use this for early control messages which are repeated in case of reconnection.
*/
sendControl(buffer: Buffer): void {
const msg = new ProtocolMessage(ProtocolMessageType.Control, 0, 0, buffer);
this._socketWriter.write(msg);
}
private _sendAckCheck(): void {
if (this._incomingMsgId <= this._incomingAckId) {
// nothink to acknowledge
return;
}
if (this._incomingAckTimeout) {
// there will be a check in the near future
return;
}
const timeSinceLastIncomingMsg = Date.now() - this._incomingMsgLastTime;
if (timeSinceLastIncomingMsg >= ProtocolConstants.AcknowledgeTime) {
// sufficient time has passed since this message has been received,
// and no message from our side needed to be sent in the meantime,
// so we will send a message containing only an ack.
this._sendAck();
return;
}
this._incomingAckTimeout = setTimeout(() => {
this._incomingAckTimeout = null;
this._sendAckCheck();
}, ProtocolConstants.AcknowledgeTime - timeSinceLastIncomingMsg + 5);
}
private _recvAckCheck(): void {
if (this._outgoingMsgId <= this._outgoingAckId) {
// everything has been acknowledged
return;
}
if (this._outgoingAckTimeout) {
// there will be a check in the near future
return;
}
const oldestUnacknowledgedMsg = this._outgoingUnackMsg.peek()!;
const timeSinceOldestUnacknowledgedMsg = Date.now() - oldestUnacknowledgedMsg.writtenTime;
if (timeSinceOldestUnacknowledgedMsg >= ProtocolConstants.AcknowledgeTimeoutTime) {
// Trash the socket
this._onSocketTimeout.fire(undefined);
return;
}
this._outgoingAckTimeout = setTimeout(() => {
this._outgoingAckTimeout = null;
this._recvAckCheck();
}, ProtocolConstants.AcknowledgeTimeoutTime - timeSinceOldestUnacknowledgedMsg + 5);
}
private _sendAck(): void {
if (this._incomingMsgId <= this._incomingAckId) {
// nothink to acknowledge
return;
}
this._incomingAckId = this._incomingMsgId;
const msg = new ProtocolMessage(ProtocolMessageType.Ack, 0, this._incomingAckId, EMPTY_BUFFER);
this._socketWriter.write(msg);
}
}
+173 -42
View File
@@ -6,68 +6,143 @@
import * as assert from 'assert';
import { Socket } from 'net';
import { EventEmitter } from 'events';
import { Protocol } from 'vs/base/parts/ipc/node/ipc.net';
import { Protocol, PersistentProtocol } from 'vs/base/parts/ipc/node/ipc.net';
class MockDuplex extends EventEmitter {
class MessageStream {
private _cache: Buffer[] = [];
private _currentComplete: ((data: Buffer) => void) | null;
private _messages: Buffer[];
readonly destroyed = false;
constructor(x: Protocol | PersistentProtocol) {
this._currentComplete = null;
this._messages = [];
x.onMessage(data => {
this._messages.push(data);
this._trigger();
});
}
private _deliver(): void {
if (this._cache.length) {
const data = Buffer.concat(this._cache);
this._cache.length = 0;
this.emit('data', data);
private _trigger(): void {
if (!this._currentComplete) {
return;
}
if (this._messages.length === 0) {
return;
}
const complete = this._currentComplete;
const msg = this._messages.shift()!;
this._currentComplete = null;
complete(msg);
}
public waitForOne(): Promise<Buffer> {
return new Promise<Buffer>((complete) => {
this._currentComplete = complete;
this._trigger();
});
}
}
class EtherStream extends EventEmitter {
constructor(
private readonly _ether: Ether,
private readonly _name: 'a' | 'b'
) {
super();
}
write(data: Buffer, cb?: Function): boolean {
this._cache.push(data);
setImmediate(() => this._deliver());
this._ether.write(this._name, data);
return true;
}
}
class Ether {
private readonly _a: EtherStream;
private readonly _b: EtherStream;
private _ab: Buffer[];
private _ba: Buffer[];
public get a(): Socket {
return <any>this._a;
}
public get b(): Socket {
return <any>this._b;
}
constructor() {
this._a = new EtherStream(this, 'a');
this._b = new EtherStream(this, 'b');
this._ab = [];
this._ba = [];
}
public write(from: 'a' | 'b', data: Buffer): void {
if (from === 'a') {
this._ab.push(data);
} else {
this._ba.push(data);
}
setImmediate(() => this._deliver());
}
private _deliver(): void {
if (this._ab.length > 0) {
const data = Buffer.concat(this._ab);
this._ab.length = 0;
this._b.emit('data', data);
setImmediate(() => this._deliver());
return;
}
if (this._ba.length > 0) {
const data = Buffer.concat(this._ba);
this._ba.length = 0;
this._a.emit('data', data);
setImmediate(() => this._deliver());
return;
}
}
}
suite('IPC, Socket Protocol', () => {
let stream: Socket;
let ether: Ether;
setup(() => {
stream = <any>new MockDuplex();
ether = new Ether();
});
test('read/write', async () => {
const a = new Protocol(stream);
const b = new Protocol(stream);
const a = new Protocol(ether.a);
const b = new Protocol(ether.b);
const bMessages = new MessageStream(b);
await new Promise(resolve => {
const sub = b.onMessage(data => {
sub.dispose();
assert.equal(data.toString(), 'foobarfarboo');
resolve(undefined);
});
a.send(Buffer.from('foobarfarboo'));
});
return new Promise(resolve => {
const sub_1 = b.onMessage(data => {
sub_1.dispose();
assert.equal(data.readInt8(0), 123);
resolve(undefined);
});
const buffer = Buffer.allocUnsafe(1);
buffer.writeInt8(123, 0);
a.send(buffer);
});
a.send(Buffer.from('foobarfarboo'));
const msg1 = await bMessages.waitForOne();
assert.equal(msg1.toString(), 'foobarfarboo');
const buffer = Buffer.allocUnsafe(1);
buffer.writeInt8(123, 0);
a.send(buffer);
const msg2 = await bMessages.waitForOne();
assert.equal(msg2.readInt8(0), 123);
});
test('read/write, object data', () => {
test('read/write, object data', async () => {
const a = new Protocol(stream);
const b = new Protocol(stream);
const a = new Protocol(ether.a);
const b = new Protocol(ether.b);
const bMessages = new MessageStream(b);
const data = {
pi: Math.PI,
@@ -77,12 +152,68 @@ suite('IPC, Socket Protocol', () => {
};
a.send(Buffer.from(JSON.stringify(data)));
const msg = await bMessages.waitForOne();
assert.deepEqual(JSON.parse(msg.toString()), data);
});
return new Promise(resolve => {
b.onMessage(msg => {
assert.deepEqual(JSON.parse(msg.toString()), data);
resolve(undefined);
});
});
});
suite('PersistentProtocol reconnection', () => {
let ether: Ether;
setup(() => {
ether = new Ether();
});
test('acks get piggybacked with messages', async () => {
const a = new PersistentProtocol(ether.a);
const aMessages = new MessageStream(a);
const b = new PersistentProtocol(ether.b);
const bMessages = new MessageStream(b);
a.send(Buffer.from('a1'));
assert.equal(a.unacknowledgedCount, 1);
assert.equal(b.unacknowledgedCount, 0);
a.send(Buffer.from('a2'));
assert.equal(a.unacknowledgedCount, 2);
assert.equal(b.unacknowledgedCount, 0);
a.send(Buffer.from('a3'));
assert.equal(a.unacknowledgedCount, 3);
assert.equal(b.unacknowledgedCount, 0);
const a1 = await bMessages.waitForOne();
assert.equal(a1.toString(), 'a1');
assert.equal(a.unacknowledgedCount, 3);
assert.equal(b.unacknowledgedCount, 0);
const a2 = await bMessages.waitForOne();
assert.equal(a2.toString(), 'a2');
assert.equal(a.unacknowledgedCount, 3);
assert.equal(b.unacknowledgedCount, 0);
const a3 = await bMessages.waitForOne();
assert.equal(a3.toString(), 'a3');
assert.equal(a.unacknowledgedCount, 3);
assert.equal(b.unacknowledgedCount, 0);
b.send(Buffer.from('b1'));
assert.equal(a.unacknowledgedCount, 3);
assert.equal(b.unacknowledgedCount, 1);
const b1 = await aMessages.waitForOne();
assert.equal(b1.toString(), 'b1');
assert.equal(a.unacknowledgedCount, 0);
assert.equal(b.unacknowledgedCount, 1);
a.send(Buffer.from('a4'));
assert.equal(a.unacknowledgedCount, 1);
assert.equal(b.unacknowledgedCount, 1);
const b2 = await bMessages.waitForOne();
assert.equal(b2.toString(), 'a4');
assert.equal(a.unacknowledgedCount, 1);
assert.equal(b.unacknowledgedCount, 0);
});
});
+7 -7
View File
@@ -55,7 +55,7 @@ import { LogLevelSetterChannel } from 'vs/platform/log/node/logIpc';
import * as errors from 'vs/base/common/errors';
import { ElectronURLListener } from 'vs/platform/url/electron-main/electronUrlListener';
import { serve as serveDriver } from 'vs/platform/driver/electron-main/driver';
import { connectRemoteAgentManagement } from 'vs/platform/remote/node/remoteAgentConnection';
import { connectRemoteAgentManagement, ManagementPersistentConnection } from 'vs/platform/remote/node/remoteAgentConnection';
import { IMenubarService } from 'vs/platform/menubar/common/menubar';
import { MenubarService } from 'vs/platform/menubar/electron-main/menubarService';
import { MenubarChannel } from 'vs/platform/menubar/node/menubarIpc';
@@ -650,26 +650,27 @@ export class CodeApplication extends Disposable {
class ActiveConnection {
private readonly _authority: string;
private readonly _client: Promise<Client<RemoteAgentConnectionContext>>;
private readonly _connection: Promise<ManagementPersistentConnection>;
private readonly _disposeRunner: RunOnceScheduler;
constructor(authority: string, host: string, port: number) {
this._authority = authority;
this._client = connectRemoteAgentManagement(authority, host, port, `main`, isBuilt);
this._connection = connectRemoteAgentManagement(authority, host, port, `main`, isBuilt);
this._disposeRunner = new RunOnceScheduler(() => this.dispose(), 5000);
}
dispose(): void {
this._disposeRunner.dispose();
connectionPool.delete(this._authority);
this._client.then((connection) => {
this._connection.then((connection) => {
connection.dispose();
});
}
getClient(): Promise<Client<RemoteAgentConnectionContext>> {
async getClient(): Promise<Client<RemoteAgentConnectionContext>> {
this._disposeRunner.schedule();
return this._client;
const connection = await this._connection;
return connection.client;
}
}
@@ -734,4 +735,3 @@ export class CodeApplication extends Disposable {
});
}
}
+1 -1
View File
@@ -422,7 +422,7 @@ export class WindowsManager implements IWindowsMainService {
// When run with --wait, make sure we keep the paths to wait for
if (fileInputs && openConfig.cli.wait && openConfig.cli.waitMarkerFilePath) {
fileInputs.filesToWait = { paths: [...fileInputs.filesToDiff, ...fileInputs.filesToOpen, ...fileInputs.filesToCreate], waitMarkerFilePath: openConfig.cli.waitMarkerFilePath };
fileInputs.filesToWait = { paths: [...fileInputs.filesToDiff, ...fileInputs.filesToOpen, ...fileInputs.filesToCreate], waitMarkerFileUri: URI.file(openConfig.cli.waitMarkerFilePath) };
}
//
+2 -1
View File
@@ -1270,6 +1270,7 @@ export interface CommentThread2 {
onDidChangeInput: Event<CommentInput | undefined>;
acceptInputCommand?: Command;
additionalCommands: Command[];
deleteCommand?: Command;
onDidChangeAcceptInputCommand: Event<Command>;
onDidChangeAdditionalCommands: Event<Command[]>;
onDidChangeRange: Event<IRange>;
@@ -1285,7 +1286,7 @@ export interface CommentingRanges {
readonly resource: URI;
ranges: IRange[];
newCommentThreadCommand?: Command;
newCommentThreadCallback?: (uri: UriComponents, range: IRange) => void;
newCommentThreadCallback?: (uri: UriComponents, range: IRange) => Promise<void>;
}
/**
@@ -23,7 +23,7 @@ import { HoverOperation, HoverStartMode, IHoverComputer } from 'vs/editor/contri
import { ContentHoverWidget } from 'vs/editor/contrib/hover/hoverWidgets';
import { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { coalesce, isNonEmptyArray } from 'vs/base/common/arrays';
import { coalesce, isNonEmptyArray, asArray } from 'vs/base/common/arrays';
import { IMarker, IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers';
import { basename } from 'vs/base/common/resources';
import { IMarkerDecorationsService } from 'vs/editor/common/services/markersDecorationService';
@@ -148,16 +148,7 @@ class ModesContentComputer implements IHoverComputer<HoverPart[]> {
return null;
}
let contents: IMarkdownString[] = [];
if (d.options.hoverMessage) {
if (Array.isArray(d.options.hoverMessage)) {
contents = [...d.options.hoverMessage];
} else {
contents = [d.options.hoverMessage];
}
}
const contents: IMarkdownString[] = d.options.hoverMessage ? asArray(d.options.hoverMessage) : [];
return { contents, range };
}
});
@@ -12,6 +12,7 @@ import { GlyphHoverWidget } from 'vs/editor/contrib/hover/hoverWidgets';
import { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer';
import { IModeService } from 'vs/editor/common/services/modeService';
import { IOpenerService, NullOpenerService } from 'vs/platform/opener/common/opener';
import { asArray } from 'vs/base/common/arrays';
export interface IHoverMessage {
value: IMarkdownString;
@@ -62,11 +63,7 @@ class MarginComputer implements IHoverComputer<IHoverMessage[]> {
continue;
}
if (Array.isArray(hoverMessage)) {
result.push(...hoverMessage.map(toHoverMessage));
} else {
result.push(toHoverMessage(hoverMessage));
}
result.push(...asArray(hoverMessage).map(toHoverMessage));
}
return result;
+16 -3
View File
@@ -11,6 +11,7 @@ import { registerLanguageCommand } from 'vs/editor/browser/editorExtensions';
import { DocumentSymbol, DocumentSymbolProviderRegistry } from 'vs/editor/common/modes';
import { IModelService } from 'vs/editor/common/services/modelService';
import { CancellationToken } from 'vs/base/common/cancellation';
import { ITextModelService } from 'vs/editor/common/services/resolverService';
export function getDocumentSymbols(model: ITextModel, flat: boolean, token: CancellationToken): Promise<DocumentSymbol[]> {
@@ -70,8 +71,20 @@ registerLanguageCommand('_executeDocumentSymbolProvider', function (accessor, ar
throw illegalArgument('resource');
}
const model = accessor.get(IModelService).getModel(resource);
if (!model) {
throw illegalArgument('resource');
if (model) {
return getDocumentSymbols(model, false, CancellationToken.None);
}
return getDocumentSymbols(model, false, CancellationToken.None);
return accessor.get(ITextModelService).createModelReference(resource).then(reference => {
return new Promise((resolve, reject) => {
try {
const result = getDocumentSymbols(reference.object.textEditorModel, false, CancellationToken.None);
resolve(result);
} catch (err) {
reject(err);
}
}).finally(() => {
reference.dispose();
});
});
});
+139 -23
View File
@@ -28,26 +28,18 @@ export interface IResourceEncoding {
export interface IFileService {
_serviceBrand: any;
/**
* Helper to determine read/write encoding for resources.
*/
encoding: IResourceEncodings;
/**
* Allows to listen for file changes. The event will fire for every file within the opened workspace
* (if any) as well as all files that have been watched explicitly using the #watchFileChanges() API.
*/
onFileChanges: Event<FileChangesEvent>;
/**
* An event that is fired upon successful completion of a certain file operation.
*/
onAfterOperation: Event<FileOperationEvent>;
//#region File System Provider
/**
* An event that is fired when a file system provider is added or removed
*/
onDidChangeFileSystemProviderRegistrations: Event<IFileSystemProviderRegistrationEvent>;
readonly onDidChangeFileSystemProviderRegistrations: Event<IFileSystemProviderRegistrationEvent>;
/**
* An event that is fired when a file system provider is about to be activated. Listeners
* can join this event with a long running promise to help in the activation process.
*/
readonly onWillActivateFileSystemProvider: Event<IFileSystemProviderActivationEvent>;
/**
* Registers a file system provider for a certain scheme.
@@ -64,6 +56,24 @@ export interface IFileService {
*/
canHandleResource(resource: URI): boolean;
//#endregion
/**
* Helper to determine read/write encoding for resources.
*/
encoding: IResourceEncodings;
/**
* Allows to listen for file changes. The event will fire for every file within the opened workspace
* (if any) as well as all files that have been watched explicitly using the #watchFileChanges() API.
*/
readonly onFileChanges: Event<FileChangesEvent>;
/**
* An event that is fired upon successful completion of a certain file operation.
*/
readonly onAfterOperation: Event<FileOperationEvent>;
/**
* Resolve the properties of a file identified by the resource.
*
@@ -129,12 +139,6 @@ export interface IFileService {
*/
createFile(resource: URI, content?: string, options?: ICreateFileOptions): Promise<IFileStat>;
/**
* Reads a folder's content with the given path. The returned promise
* will have the list of children as a result.
*/
readFolder(resource: URI): Promise<string[]>;
/**
* Creates a new folder with the given path. The returned promise
* will have the stat model object as a result.
@@ -234,12 +238,88 @@ export interface IFileSystemProvider {
write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>;
}
export enum FileSystemProviderErrorCode {
FileExists = 'EntryExists',
FileNotFound = 'EntryNotFound',
FileNotADirectory = 'EntryNotADirectory',
FileIsADirectory = 'EntryIsADirectory',
NoPermissions = 'NoPermissions',
Unavailable = 'Unavailable'
}
export class FileSystemProviderError extends Error {
constructor(message: string, public readonly code?: FileSystemProviderErrorCode) {
super(message);
}
}
export function createFileSystemProviderError(error: Error, code?: FileSystemProviderErrorCode): FileSystemProviderError {
const providerError = new FileSystemProviderError(error.toString(), code);
markAsFileSystemProviderError(providerError);
return providerError;
}
export function markAsFileSystemProviderError(error: Error, code?: FileSystemProviderErrorCode): Error {
error.name = code ? `${code} (FileSystemError)` : `FileSystemError`;
return error;
}
export function toFileSystemProviderErrorCode(error: Error): FileSystemProviderErrorCode | undefined {
// FileSystemProviderError comes with the code
if (error instanceof FileSystemProviderError) {
return error.code;
}
// Any other error, check for name match by assuming that the error
// went through the markAsFileSystemProviderError() method
const match = /^(.+) \(FileSystemError\)$/.exec(error.name);
if (!match) {
return undefined;
}
switch (match[1]) {
case FileSystemProviderErrorCode.FileExists: return FileSystemProviderErrorCode.FileExists;
case FileSystemProviderErrorCode.FileIsADirectory: return FileSystemProviderErrorCode.FileIsADirectory;
case FileSystemProviderErrorCode.FileNotADirectory: return FileSystemProviderErrorCode.FileNotADirectory;
case FileSystemProviderErrorCode.FileNotFound: return FileSystemProviderErrorCode.FileNotFound;
case FileSystemProviderErrorCode.NoPermissions: return FileSystemProviderErrorCode.NoPermissions;
case FileSystemProviderErrorCode.Unavailable: return FileSystemProviderErrorCode.Unavailable;
}
return undefined;
}
export function toFileOperationResult(error: Error): FileOperationResult {
switch (toFileSystemProviderErrorCode(error)) {
case FileSystemProviderErrorCode.FileNotFound:
return FileOperationResult.FILE_NOT_FOUND;
case FileSystemProviderErrorCode.FileIsADirectory:
return FileOperationResult.FILE_IS_DIRECTORY;
case FileSystemProviderErrorCode.NoPermissions:
return FileOperationResult.FILE_PERMISSION_DENIED;
case FileSystemProviderErrorCode.FileExists:
return FileOperationResult.FILE_MOVE_CONFLICT;
case FileSystemProviderErrorCode.FileNotADirectory:
default:
return FileOperationResult.FILE_OTHER_ERROR;
}
}
export interface IFileSystemProviderRegistrationEvent {
added: boolean;
scheme: string;
provider?: IFileSystemProvider;
}
export interface IFileSystemProviderActivationEvent {
scheme: string;
join(promise: Promise<void>): void;
}
export const enum FileOperation {
CREATE,
DELETE,
@@ -655,7 +735,8 @@ export const enum FileOperationResult {
FILE_PERMISSION_DENIED,
FILE_TOO_LARGE,
FILE_INVALID_PATH,
FILE_EXCEED_MEMORY_LIMIT
FILE_EXCEED_MEMORY_LIMIT,
FILE_OTHER_ERROR
}
export const AutoSaveConfiguration = {
@@ -942,3 +1023,38 @@ export enum FileKind {
export const MIN_MAX_MEMORY_SIZE_MB = 2048;
export const FALLBACK_MAX_MEMORY_SIZE_MB = 4096;
// TODO@ben remove traces of legacy file service
export const ILegacyFileService = createDecorator<ILegacyFileService>('legacyFileService');
export interface ILegacyFileService {
_serviceBrand: any;
encoding: IResourceEncodings;
onFileChanges: Event<FileChangesEvent>;
onAfterOperation: Event<FileOperationEvent>;
resolveFile(resource: URI, options?: IResolveFileOptions): Promise<IFileStat>;
resolveFiles(toResolve: { resource: URI, options?: IResolveFileOptions }[]): Promise<IResolveFileResult[]>;
existsFile(resource: URI): Promise<boolean>;
resolveContent(resource: URI, options?: IResolveContentOptions): Promise<IContent>;
resolveStreamContent(resource: URI, options?: IResolveContentOptions): Promise<IStreamContent>;
updateContent(resource: URI, value: string | ITextSnapshot, options?: IUpdateContentOptions): Promise<IFileStat>;
moveFile(source: URI, target: URI, overwrite?: boolean): Promise<IFileStat>;
copyFile(source: URI, target: URI, overwrite?: boolean): Promise<IFileStat>;
createFile(resource: URI, content?: string, options?: ICreateFileOptions): Promise<IFileStat>;
del(resource: URI, options?: { useTrash?: boolean, recursive?: boolean }): Promise<void>;
watchFileChanges(resource: URI): void;
unwatchFileChanges(resource: URI): void;
}
@@ -3,26 +3,58 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Client, BufferedProtocol } from 'vs/base/parts/ipc/node/ipc.net';
import { Client, PersistentProtocol } from 'vs/base/parts/ipc/node/ipc.net';
import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment';
export function connectRemoteAgentManagement(remoteAuthority: string, host: string, port: number, clientId: string, isBuilt: boolean): Promise<Client<RemoteAgentConnectionContext>> {
throw new Error(`Not implemented`);
}
export interface IExtensionHostConnectionResult {
protocol: BufferedProtocol;
debugPort?: number;
}
import { Disposable } from 'vs/base/common/lifecycle';
export interface IRemoteExtensionHostStartParams {
language: string;
debugId?: string;
break: boolean;
port: number | null;
break?: boolean;
port?: number | null;
updatePort?: boolean;
}
export function connectRemoteAgentExtensionHost(host: string, port: number, startArguments: IRemoteExtensionHostStartParams, isBuilt: boolean): Promise<IExtensionHostConnectionResult> {
export async function connectRemoteAgentManagement(remoteAuthority: string, host: string, port: number, clientId: string, isBuilt: boolean): Promise<ManagementPersistentConnection> {
throw new Error(`Not implemented`);
}
export async function connectRemoteAgentExtensionHost(host: string, port: number, startArguments: IRemoteExtensionHostStartParams, isBuilt: boolean): Promise<ExtensionHostPersistentConnection> {
throw new Error(`Not implemented`);
}
abstract class PersistentConnection extends Disposable {
public readonly reconnectionToken: string;
public readonly protocol: PersistentProtocol;
constructor(reconnectionToken: string, protocol: PersistentProtocol) {
super();
this.reconnectionToken = reconnectionToken;
this.protocol = protocol;
}
}
export class ManagementPersistentConnection extends PersistentConnection {
public readonly client: Client<RemoteAgentConnectionContext>;
constructor(remoteAuthority: string, host: string, port: number, clientId: string, isBuilt: boolean, reconnectionToken: string, protocol: PersistentProtocol) {
super(reconnectionToken, protocol);
this.client = this._register(new Client<RemoteAgentConnectionContext>(protocol, {
remoteAuthority: remoteAuthority,
clientId: clientId
}));
}
}
export class ExtensionHostPersistentConnection extends PersistentConnection {
public readonly debugPort: number | undefined;
constructor(host: string, port: number, startArguments: IRemoteExtensionHostStartParams, isBuilt: boolean, reconnectionToken: string, protocol: PersistentProtocol, debugPort: number | undefined) {
super(reconnectionToken, protocol);
this.debugPort = debugPort;
}
}
+2 -1
View File
@@ -340,11 +340,12 @@ export interface IPath extends IPathData {
export interface IPathsToWaitFor extends IPathsToWaitForData {
paths: IPath[];
waitMarkerFileUri: URI;
}
export interface IPathsToWaitForData {
paths: IPathData[];
waitMarkerFilePath: string;
waitMarkerFileUri: UriComponents;
}
export interface IPathData {
+58 -2
View File
@@ -3784,6 +3784,48 @@ declare module 'vscode' {
provideFoldingRanges(document: TextDocument, context: FoldingContext, token: CancellationToken): ProviderResult<FoldingRange[]>;
}
/**
* A selection range represents a part of a selection hierarchy. A selection range
* may have a parent selection range that contains it.
*/
export class SelectionRange {
/**
* The [range](#Range) of this selection range.
*/
range: Range;
/**
* The parent selection range containing this range.
*/
parent?: SelectionRange;
/**
* Creates a new selection range.
*
* @param range The range of the selection range.
* @param parent The parent of the selection range.
*/
constructor(range: Range, parent?: SelectionRange);
}
export interface SelectionRangeProvider {
/**
* Provide selection ranges for the given positions.
*
* Selection ranges should be computed individually and independend for each postion. The editor will merge
* and deduplicate ranges but providers must return hierarchies of selection ranges so that a range
* is [contained](#Range.contains) by its parent.
*
* @param document The document in which the command was invoked.
* @param positions The positions at which the command was invoked.
* @param token A cancellation token.
* @return Selection ranges or a thenable that resolves to such. The lack of a result can be
* signaled by returning `undefined` or `null`.
*/
provideSelectionRanges(document: TextDocument, positions: Position[], token: CancellationToken): ProviderResult<SelectionRange[]>;
}
/**
* A tuple of two characters, like a pair of
* opening and closing brackets.
@@ -6883,9 +6925,10 @@ declare module 'vscode' {
shellPath?: string;
/**
* Args for the custom shell executable, this does not work on Windows (see #8429)
* Args for the custom shell executable. A string can be used on Windows only which allows
* specifying shell args in [command-line format](https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6).
*/
shellArgs?: string[];
shellArgs?: string[] | string;
/**
* A path or Uri for the current working directory to be used for the terminal.
@@ -8094,6 +8137,19 @@ declare module 'vscode' {
*/
export function registerFoldingRangeProvider(selector: DocumentSelector, provider: FoldingRangeProvider): Disposable;
/**
* Register a selection range provider.
*
* Multiple providers can be registered for a language. In that case providers are asked in
* parallel and the results are merged. A failing provider (rejected promise or exception) will
* not cause a failure of the whole operation.
*
* @param selector A selector that defines the documents this provider is applicable to.
* @param provider A selection range provider.
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
*/
export function registerSelectionRangeProvider(selector: DocumentSelector, provider: SelectionRangeProvider): Disposable;
/**
* Set a [language configuration](#LanguageConfiguration) for a language.
*
+46 -62
View File
@@ -16,6 +16,46 @@
declare module 'vscode' {
//#region Joh - call hierarchy
export enum CallHierarchyDirection {
CallsFrom = 1,
CallsTo = 2,
}
export class CallHierarchyItem {
kind: SymbolKind;
name: string;
detail?: string;
uri: Uri;
range: Range;
selectionRange: Range;
constructor(kind: SymbolKind, name: string, detail: string, uri: Uri, range: Range, selectionRange: Range);
}
export interface CallHierarchyItemProvider {
provideCallHierarchyItem(
document: TextDocument,
postion: Position,
token: CancellationToken
): ProviderResult<CallHierarchyItem>;
resolveCallHierarchyItem(
item: CallHierarchyItem,
direction: CallHierarchyDirection,
token: CancellationToken
): ProviderResult<[CallHierarchyItem, Location[]][]>;
}
export namespace languages {
export function registerCallHierarchyProvider(selector: DocumentSelector, provider: CallHierarchyItemProvider): Disposable;
}
//#endregion
//#region Alex - resolvers
export class ResolvedAuthority {
@@ -82,68 +122,6 @@ declare module 'vscode' {
//#endregion
//#region Joh - selection range provider
/**
* A selection range represents a part of a selection hierarchy. A selection range
* may have a parent selection range that contains it.
*/
export class SelectionRange {
/**
* The [range](#Range) of this selection range.
*/
range: Range;
/**
* The parent selection range containing this range.
*/
parent?: SelectionRange;
/**
* Creates a new selection range.
*
* @param range The range of the selection range.
* @param parent The parent of the selection range.
*/
constructor(range: Range, parent?: SelectionRange);
}
export interface SelectionRangeProvider {
/**
* Provide selection ranges for the given positions.
*
* Selection ranges should be computed individually and independend for each postion. The editor will merge
* and deduplicate ranges but providers must return hierarchies of selection ranges so that a range
* is [contained](#Range.contains) by its parent.
*
* @param document The document in which the command was invoked.
* @param positions The positions at which the command was invoked.
* @param token A cancellation token.
* @return Selection ranges or a thenable that resolves to such. The lack of a result can be
* signaled by returning `undefined` or `null`.
*/
provideSelectionRanges(document: TextDocument, positions: Position[], token: CancellationToken): ProviderResult<SelectionRange[]>;
}
export namespace languages {
/**
* Register a selection range provider.
*
* Multiple providers can be registered for a language. In that case providers are asked in
* parallel and the results are merged. A failing provider (rejected promise or exception) will
* not cause a failure of the whole operation.
*
* @param selector A selector that defines the documents this provider is applicable to.
* @param provider A selection range provider.
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
*/
export function registerSelectionRangeProvider(selector: DocumentSelector, provider: SelectionRangeProvider): Disposable;
}
//#endregion
//#region Joh - read/write in chunks
export interface FileSystemProvider {
@@ -820,6 +798,12 @@ declare module 'vscode' {
*/
collapsibleState?: CommentThreadCollapsibleState;
/**
* The command to be executed when users try to delete the comment thread. Currently, this is only called
* when the user collapses a comment thread that has no comments in it.
*/
deleteCommand?: Command;
/**
* Dispose this comment thread.
* Once disposed, the comment thread will be removed from visible text editors and Comments Panel.
@@ -3,23 +3,28 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { clipboard } from 'electron';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { MainContext, MainThreadClipboardShape } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { MainContext, MainThreadClipboardShape } from '../common/extHost.protocol';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
@extHostNamedCustomer(MainContext.MainThreadClipboard)
export class MainThreadCommands implements MainThreadClipboardShape {
constructor(
_context: any,
@IClipboardService private readonly _clipboardService: IClipboardService,
) { }
dispose(): void {
// nothing
}
$readText(): Promise<string> {
return Promise.resolve(clipboard.readText());
return Promise.resolve(this._clipboardService.readText());
}
$writeText(value: string): Promise<void> {
clipboard.writeText(value);
this._clipboardService.writeText(value);
return Promise.resolve();
}
}
@@ -5,8 +5,8 @@
import { ICommandService, CommandsRegistry, ICommandHandlerDescription } from 'vs/platform/commands/common/commands';
import { IDisposable } from 'vs/base/common/lifecycle';
import { ExtHostContext, MainThreadCommandsShape, ExtHostCommandsShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { ExtHostContext, MainThreadCommandsShape, ExtHostCommandsShape, MainContext, IExtHostContext } from '../common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { revive } from 'vs/base/common/marshalling';
@extHostNamedCustomer(MainContext.MainThreadCommands)
@@ -8,8 +8,8 @@ import { IDisposable } from 'vs/base/common/lifecycle';
import { Registry } from 'vs/platform/registry/common/platform';
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope, getScopes } from 'vs/platform/configuration/common/configurationRegistry';
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
import { MainThreadConfigurationShape, MainContext, ExtHostContext, IExtHostContext, IWorkspaceConfigurationChangeEventData, IConfigurationInitData } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { MainThreadConfigurationShape, MainContext, ExtHostContext, IExtHostContext, IWorkspaceConfigurationChangeEventData, IConfigurationInitData } from '../common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { ConfigurationTarget, IConfigurationChangeEvent, IConfigurationModel, IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
@@ -12,10 +12,10 @@ import { IDebugService, IConfig, IDebugConfigurationProvider, IBreakpoint, IFunc
import {
ExtHostContext, ExtHostDebugServiceShape, MainThreadDebugServiceShape, DebugSessionUUID, MainContext,
IExtHostContext, IBreakpointsDeltaDto, ISourceMultiBreakpointDto, ISourceBreakpointDto, IFunctionBreakpointDto, IDebugSessionDto
} from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
} from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import severity from 'vs/base/common/severity';
import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/node/debugAdapter';
import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/common/abstractDebugAdapter';
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { convertToVSCPaths, convertToDAPaths } from 'vs/workbench/contrib/debug/common/debugUtils';
@@ -153,7 +153,6 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
return Promise.resolve();
}
public $registerDebugConfigurationProvider(debugType: string, hasProvide: boolean, hasResolve: boolean, hasProvideDebugAdapter: boolean, handle: number): Promise<void> {
const provider = <IDebugConfigurationProvider>{
@@ -384,4 +383,3 @@ class ExtensionHostDebugAdapter extends AbstractDebugAdapter {
}
// {{SQL CARBON EDIT}}
*/
@@ -6,8 +6,8 @@
import { URI, UriComponents } from 'vs/base/common/uri';
import { Emitter } from 'vs/base/common/event';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { ExtHostContext, MainContext, IExtHostContext, MainThreadDecorationsShape, ExtHostDecorationsShape, DecorationData, DecorationRequest } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { ExtHostContext, MainContext, IExtHostContext, MainThreadDecorationsShape, ExtHostDecorationsShape, DecorationData, DecorationRequest } from '../common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IDecorationsService, IDecorationData } from 'vs/workbench/services/decorations/browser/decorations';
import { values } from 'vs/base/common/collections';
import { CancellationToken } from 'vs/base/common/cancellation';
@@ -5,8 +5,8 @@
import { IMarkerService, IMarkerData } from 'vs/platform/markers/common/markers';
import { URI, UriComponents } from 'vs/base/common/uri';
import { MainThreadDiagnosticsShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { MainThreadDiagnosticsShape, MainContext, IExtHostContext } from '../common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
@extHostNamedCustomer(MainContext.MainThreadDiagnostics)
export class MainThreadDiagnostics implements MainThreadDiagnosticsShape {
@@ -4,8 +4,8 @@
*--------------------------------------------------------------------------------------------*/
import { URI } from 'vs/base/common/uri';
import { MainThreadDiaglogsShape, MainContext, IExtHostContext, MainThreadDialogOpenOptions, MainThreadDialogSaveOptions } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { MainThreadDiaglogsShape, MainContext, IExtHostContext, MainThreadDialogOpenOptions, MainThreadDialogSaveOptions } from '../common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { forEach } from 'vs/base/common/collections';
import { IFileDialogService, IOpenDialogOptions, ISaveDialogOptions } from 'vs/platform/dialogs/common/dialogs';
@@ -13,8 +13,8 @@ import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerServ
import { IModelService } from 'vs/editor/common/services/modelService';
import { IModeService } from 'vs/editor/common/services/modeService';
import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { ExtHostContext, ExtHostDocumentContentProvidersShape, IExtHostContext, MainContext, MainThreadDocumentContentProvidersShape } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { ExtHostContext, ExtHostDocumentContentProvidersShape, IExtHostContext, MainContext, MainThreadDocumentContentProvidersShape } from '../common/extHost.protocol';
import { CancellationTokenSource } from 'vs/base/common/cancellation';
@extHostNamedCustomer(MainContext.MainThreadDocumentContentProviders)
@@ -4,8 +4,8 @@
*--------------------------------------------------------------------------------------------*/
import { SerializedError, onUnexpectedError } from 'vs/base/common/errors';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { MainContext, MainThreadErrorsShape } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { MainContext, MainThreadErrorsShape } from 'vs/workbench/api/common/extHost.protocol';
@extHostNamedCustomer(MainContext.MainThreadErrors)
export class MainThreadErrors implements MainThreadErrorsShape {
@@ -7,8 +7,8 @@ import { Emitter, Event } from 'vs/base/common/event';
import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle';
import { URI } from 'vs/base/common/uri';
import { FileWriteOptions, FileSystemProviderCapabilities, IFileChange, IFileService, IFileSystemProvider, IStat, IWatchOptions, FileType, FileOverwriteOptions, FileDeleteOptions, FileOpenOptions } from 'vs/platform/files/common/files';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { ExtHostContext, ExtHostFileSystemShape, IExtHostContext, IFileChangeDto, MainContext, MainThreadFileSystemShape } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { ExtHostContext, ExtHostFileSystemShape, IExtHostContext, IFileChangeDto, MainContext, MainThreadFileSystemShape } from '../common/extHost.protocol';
import { ResourceLabelFormatter, ILabelService } from 'vs/platform/label/common/label';
@extHostNamedCustomer(MainContext.MainThreadFileSystem)
@@ -5,8 +5,8 @@
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { FileChangeType, IFileService, FileOperation } from 'vs/platform/files/common/files';
import { extHostCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { ExtHostContext, FileSystemEvents, IExtHostContext } from '../node/extHost.protocol';
import { extHostCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { ExtHostContext, FileSystemEvents, IExtHostContext } from '../common/extHost.protocol';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
@extHostCustomer
@@ -6,8 +6,8 @@
import { URI, UriComponents } from 'vs/base/common/uri';
import { IModeService } from 'vs/editor/common/services/modeService';
import { IModelService } from 'vs/editor/common/services/modelService';
import { MainThreadLanguagesShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { MainThreadLanguagesShape, MainContext, IExtHostContext } from '../common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
@extHostNamedCustomer(MainContext.MainThreadLanguages)
export class MainThreadLanguages implements MainThreadLanguagesShape {
@@ -3,10 +3,10 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { extHostCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { extHostCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { ILogService } from 'vs/platform/log/common/log';
import { Disposable } from 'vs/base/common/lifecycle';
import { IExtHostContext, ExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { IExtHostContext, ExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
@extHostCustomer
export class MainThreadLogService extends Disposable {
@@ -6,8 +6,8 @@
import * as nls from 'vs/nls';
import Severity from 'vs/base/common/severity';
import { Action, IAction } from 'vs/base/common/actions';
import { MainThreadMessageServiceShape, MainContext, IExtHostContext, MainThreadMessageOptions } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { MainThreadMessageServiceShape, MainContext, IExtHostContext, MainThreadMessageOptions } from '../common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { Event } from 'vs/base/common/event';
@@ -7,8 +7,8 @@ import { Registry } from 'vs/platform/registry/common/platform';
import { IOutputService, IOutputChannel, OUTPUT_PANEL_ID, Extensions, IOutputChannelRegistry } from 'vs/workbench/contrib/output/common/output';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { MainThreadOutputServiceShape, MainContext, IExtHostContext, ExtHostOutputServiceShape, ExtHostContext } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { MainThreadOutputServiceShape, MainContext, IExtHostContext, ExtHostOutputServiceShape, ExtHostContext } from '../common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { UriComponents, URI } from 'vs/base/common/uri';
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
import { Event } from 'vs/base/common/event';
@@ -4,8 +4,8 @@
*--------------------------------------------------------------------------------------------*/
import { IProgress, IProgressService2, IProgressStep, IProgressOptions } from 'vs/platform/progress/common/progress';
import { MainThreadProgressShape, MainContext, IExtHostContext, ExtHostProgressShape, ExtHostContext } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { MainThreadProgressShape, MainContext, IExtHostContext, ExtHostProgressShape, ExtHostContext } from '../common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
@extHostNamedCustomer(MainContext.MainThreadProgress)
export class MainThreadProgress implements MainThreadProgressShape {
@@ -4,9 +4,8 @@
*--------------------------------------------------------------------------------------------*/
import { IPickOptions, IInputOptions, IQuickInputService, IQuickInput } from 'vs/platform/quickinput/common/quickInput';
import { InputBoxOptions } from 'vscode';
import { ExtHostContext, MainThreadQuickOpenShape, ExtHostQuickOpenShape, TransferQuickPickItems, MainContext, IExtHostContext, TransferQuickInput, TransferQuickInputButton } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { ExtHostContext, MainThreadQuickOpenShape, ExtHostQuickOpenShape, TransferQuickPickItems, MainContext, IExtHostContext, TransferQuickInput, TransferQuickInputButton, IInputBoxOptions } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { URI } from 'vs/base/common/uri';
import { CancellationToken } from 'vs/base/common/cancellation';
@@ -85,7 +84,7 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape {
// ---- input
$input(options: InputBoxOptions | undefined, validateInput: boolean, token: CancellationToken): Promise<string> {
$input(options: IInputBoxOptions | undefined, validateInput: boolean, token: CancellationToken): Promise<string> {
const inputOptions: IInputOptions = Object.create(null);
if (options) {
@@ -8,9 +8,9 @@ import { Event, Emitter } from 'vs/base/common/event';
import { assign } from 'vs/base/common/objects';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { ISCMService, ISCMRepository, ISCMProvider, ISCMResource, ISCMResourceGroup, ISCMResourceDecorations, IInputValidation } from 'vs/workbench/contrib/scm/common/scm';
import { ExtHostContext, MainThreadSCMShape, ExtHostSCMShape, SCMProviderFeatures, SCMRawResourceSplices, SCMGroupFeatures, MainContext, IExtHostContext } from '../node/extHost.protocol';
import { ExtHostContext, MainThreadSCMShape, ExtHostSCMShape, SCMProviderFeatures, SCMRawResourceSplices, SCMGroupFeatures, MainContext, IExtHostContext } from '../common/extHost.protocol';
import { Command } from 'vs/editor/common/modes';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { ISplice, Sequence } from 'vs/base/common/sequence';
import { CancellationToken } from 'vs/base/common/cancellation';
@@ -32,11 +32,11 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ILogService } from 'vs/platform/log/common/log';
import { IProgressService2, ProgressLocation } from 'vs/platform/progress/common/progress';
import { extHostCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { extHostCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel';
// {{SQL CARBON EDIT}}
import { ISaveParticipant, SaveReason, IResolvedTextFileEditorModel, ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles';
import { ExtHostContext, ExtHostDocumentSaveParticipantShape, IExtHostContext } from '../node/extHost.protocol';
import { ExtHostContext, ExtHostDocumentSaveParticipantShape, IExtHostContext } from '../common/extHost.protocol';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
// {{SQL CARBON EDIT}}
@@ -3,15 +3,14 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { isFalsyOrEmpty } from 'vs/base/common/arrays';
import { CancellationToken } from 'vs/base/common/cancellation';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { values } from 'vs/base/common/map';
import { URI, UriComponents } from 'vs/base/common/uri';
import { IFileMatch, IRawFileMatch2, ISearchComplete, ISearchCompleteStats, ISearchProgressItem, ISearchResultProvider, ISearchService, QueryType, SearchProviderType, ITextQuery, IFileQuery } from 'vs/workbench/services/search/common/search';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { ExtHostContext, ExtHostSearchShape, IExtHostContext, MainContext, MainThreadSearchShape } from '../node/extHost.protocol';
import { CancellationToken } from 'vs/base/common/cancellation';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IFileMatch, IFileQuery, IRawFileMatch2, ISearchComplete, ISearchCompleteStats, ISearchProgressItem, ISearchResultProvider, ISearchService, ITextQuery, QueryType, SearchProviderType } from 'vs/workbench/services/search/common/search';
import { ExtHostContext, ExtHostSearchShape, IExtHostContext, MainContext, MainThreadSearchShape } from '../common/extHost.protocol';
@extHostNamedCustomer(MainContext.MainThreadSearch)
export class MainThreadSearch implements MainThreadSearchShape {
@@ -114,7 +113,7 @@ class RemoteSearchProvider implements ISearchResultProvider, IDisposable {
dispose(this._registrations);
}
fileSearch(query: IFileQuery, token: CancellationToken = CancellationToken.None): Promise<ISearchComplete | undefined> {
fileSearch(query: IFileQuery, token: CancellationToken = CancellationToken.None): Promise<ISearchComplete> {
return this.doSearch(query, undefined, token);
}
@@ -122,9 +121,9 @@ class RemoteSearchProvider implements ISearchResultProvider, IDisposable {
return this.doSearch(query, onProgress, token);
}
doSearch(query: ITextQuery | IFileQuery, onProgress?: (p: ISearchProgressItem) => void, token: CancellationToken = CancellationToken.None): Promise<ISearchComplete | undefined> {
if (isFalsyOrEmpty(query.folderQueries)) {
return Promise.resolve(undefined);
doSearch(query: ITextQuery | IFileQuery, onProgress?: (p: ISearchProgressItem) => void, token: CancellationToken = CancellationToken.None): Promise<ISearchComplete> {
if (!query.folderQueries.length) {
throw new Error('Empty folderQueries');
}
const search = new SearchOperation(onProgress);
@@ -5,9 +5,9 @@
import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment } from 'vs/platform/statusbar/common/statusbar';
import { IDisposable } from 'vs/base/common/lifecycle';
import { MainThreadStatusBarShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
import { MainThreadStatusBarShape, MainContext, IExtHostContext } from '../common/extHost.protocol';
import { ThemeColor } from 'vs/platform/theme/common/themeService';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
@extHostNamedCustomer(MainContext.MainThreadStatusBar)
@@ -4,8 +4,8 @@
*--------------------------------------------------------------------------------------------*/
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { MainThreadStorageShape, MainContext, IExtHostContext, ExtHostStorageShape, ExtHostContext } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { MainThreadStorageShape, MainContext, IExtHostContext, ExtHostStorageShape, ExtHostContext } from '../common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IDisposable } from 'vs/base/common/lifecycle';
@extHostNamedCustomer(MainContext.MainThreadStorage)
@@ -4,8 +4,8 @@
*--------------------------------------------------------------------------------------------*/
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { MainThreadTelemetryShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { MainThreadTelemetryShape, MainContext, IExtHostContext } from '../common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
@extHostNamedCustomer(MainContext.MainThreadTelemetry)
export class MainThreadTelemetry implements MainThreadTelemetryShape {
@@ -5,9 +5,10 @@
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { ITerminalService, ITerminalInstance, IShellLaunchConfig, ITerminalProcessExtHostProxy, ITerminalProcessExtHostRequest, ITerminalDimensions, EXT_HOST_CREATION_DELAY } from 'vs/workbench/contrib/terminal/common/terminal';
import { ExtHostContext, ExtHostTerminalServiceShape, MainThreadTerminalServiceShape, MainContext, IExtHostContext, ShellLaunchConfigDto } from 'vs/workbench/api/node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { ExtHostContext, ExtHostTerminalServiceShape, MainThreadTerminalServiceShape, MainContext, IExtHostContext, ShellLaunchConfigDto } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { UriComponents, URI } from 'vs/base/common/uri';
import { StopWatch } from 'vs/base/common/stopwatch';
@extHostNamedCustomer(MainContext.MainThreadTerminalService)
export class MainThreadTerminalService implements MainThreadTerminalServiceShape {
@@ -59,7 +60,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
// when the extension host process goes down ?
}
public $createTerminal(name?: string, shellPath?: string, shellArgs?: string[], cwd?: string | UriComponents, env?: { [key: string]: string }, waitOnExit?: boolean, strictEnv?: boolean): Promise<{ id: number, name: string }> {
public $createTerminal(name?: string, shellPath?: string, shellArgs?: string[] | string, cwd?: string | UriComponents, env?: { [key: string]: string }, waitOnExit?: boolean, strictEnv?: boolean): Promise<{ id: number, name: string }> {
const shellLaunchConfig: IShellLaunchConfig = {
name,
executable: shellPath,
@@ -227,6 +228,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
request.proxy.onShutdown(immediate => this._proxy.$acceptProcessShutdown(request.proxy.terminalId, immediate));
request.proxy.onRequestCwd(() => this._proxy.$acceptProcessRequestCwd(request.proxy.terminalId));
request.proxy.onRequestInitialCwd(() => this._proxy.$acceptProcessRequestInitialCwd(request.proxy.terminalId));
request.proxy.onRequestLatency(() => this._onRequestLatency(request.proxy.terminalId));
}
public $sendProcessTitle(terminalId: number, title: string): void {
@@ -253,4 +255,16 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
public $sendProcessCwd(terminalId: number, cwd: string): void {
this._terminalProcesses[terminalId].emitCwd(cwd);
}
private async _onRequestLatency(terminalId: number): Promise<void> {
const COUNT = 2;
let sum = 0;
for (let i = 0; i < COUNT; i++) {
const sw = StopWatch.create(true);
await this._proxy.$acceptProcessRequestLatency(terminalId);
sw.stop();
sum += sw.elapsed();
}
this._terminalProcesses[terminalId].emitLatency(sum / COUNT);
}
}
@@ -4,9 +4,9 @@
*--------------------------------------------------------------------------------------------*/
import { Disposable } from 'vs/base/common/lifecycle';
import { ExtHostContext, MainThreadTreeViewsShape, ExtHostTreeViewsShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
import { ExtHostContext, MainThreadTreeViewsShape, ExtHostTreeViewsShape, MainContext, IExtHostContext } from '../common/extHost.protocol';
import { ITreeViewDataProvider, ITreeItem, IViewsService, ITreeView, IViewsRegistry, ITreeViewDescriptor, IRevealOptions, Extensions } from 'vs/workbench/common/views';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { distinct } from 'vs/base/common/arrays';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { isUndefinedOrNull, isNumber } from 'vs/base/common/types';
@@ -7,8 +7,8 @@ import { Event } from 'vs/base/common/event';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { URI, UriComponents } from 'vs/base/common/uri';
import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { ExtHostContext, ExtHostWindowShape, IExtHostContext, MainContext, MainThreadWindowShape } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { ExtHostContext, ExtHostWindowShape, IExtHostContext, MainContext, MainThreadWindowShape } from '../common/extHost.protocol';
@extHostNamedCustomer(MainContext.MainThreadWindow)
export class MainThreadWindow implements MainThreadWindowShape {
@@ -16,13 +16,12 @@ import { IFileMatch, IPatternInfo, ISearchProgressItem, ISearchService } from 'v
import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar';
import { IWindowService } from 'vs/platform/windows/common/windows';
import { IWorkspaceContextService, WorkbenchState, IWorkspace } from 'vs/platform/workspace/common/workspace';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { ITextQueryBuilderOptions, QueryBuilder } from 'vs/workbench/contrib/search/common/queryBuilder';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing';
import { ExtHostContext, ExtHostWorkspaceShape, IExtHostContext, MainContext, MainThreadWorkspaceShape, IWorkspaceData } from '../node/extHost.protocol';
import { TextSearchComplete } from 'vscode';
import { ExtHostContext, ExtHostWorkspaceShape, IExtHostContext, MainContext, MainThreadWorkspaceShape, IWorkspaceData, ITextSearchComplete } from '../common/extHost.protocol';
@extHostNamedCustomer(MainContext.MainThreadWorkspace)
export class MainThreadWorkspace implements MainThreadWorkspaceShape {
@@ -148,7 +147,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape {
});
}
$startTextSearch(pattern: IPatternInfo, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise<TextSearchComplete> {
$startTextSearch(pattern: IPatternInfo, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise<ITextSearchComplete> {
const workspace = this._contextService.getWorkspace();
const folders = workspace.folders.map(folder => folder.uri);
@@ -8,44 +8,42 @@ import { SerializedError } from 'vs/base/common/errors';
import { IDisposable } from 'vs/base/common/lifecycle';
import Severity from 'vs/base/common/severity';
import { URI, UriComponents } from 'vs/base/common/uri';
import { TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions';
import { TextEditorCursorStyle, RenderLineNumbersType } from 'vs/editor/common/config/editorOptions';
import { IPosition } from 'vs/editor/common/core/position';
import { IRange } from 'vs/editor/common/core/range';
import { ISelection, Selection } from 'vs/editor/common/core/selection';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { ISingleEditOperation } from 'vs/editor/common/model';
import { ISingleEditOperation, EndOfLineSequence } from 'vs/editor/common/model';
import { IModelChangedEvent } from 'vs/editor/common/model/mirrorTextModel';
import * as modes from 'vs/editor/common/modes';
import { CharacterPair, CommentRule, EnterAction } from 'vs/editor/common/modes/languageConfiguration';
import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands';
import { ConfigurationTarget, IConfigurationData, IConfigurationModel } from 'vs/platform/configuration/common/configuration';
import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
import { FileChangeType, FileDeleteOptions, FileOverwriteOptions, FileSystemProviderCapabilities, FileType, FileWriteOptions, IStat, IWatchOptions, FileOpenOptions } from 'vs/platform/files/common/files';
import * as files from 'vs/platform/files/common/files';
import { ResourceLabelFormatter } from 'vs/platform/label/common/label';
import { LogLevel } from 'vs/platform/log/common/log';
import { IMarkerData } from 'vs/platform/markers/common/markers';
import { IPickOptions, IQuickInputButton, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
import { IPatternInfo, IRawFileMatch2, IRawQuery, IRawTextQuery, ISearchCompleteStats } from 'vs/workbench/services/search/common/search';
import { StatusbarAlignment as MainThreadStatusBarAlignment } from 'vs/platform/statusbar/common/statusbar';
import * as quickInput from 'vs/platform/quickinput/common/quickInput';
import * as search from 'vs/workbench/services/search/common/search';
import * as statusbar from 'vs/platform/statusbar/common/statusbar';
import { ITelemetryInfo } from 'vs/platform/telemetry/common/telemetry';
import { ThemeColor } from 'vs/platform/theme/common/themeService';
import { EndOfLine, IFileOperationOptions, TextEditorLineNumbersStyle } from 'vs/workbench/api/node/extHostTypes';
import { EditorViewColumn } from 'vs/workbench/api/shared/editor';
import { TaskDTO, TaskExecutionDTO, TaskFilterDTO, TaskHandleDTO, TaskProcessEndedDTO, TaskProcessStartedDTO, TaskSystemInfoDTO, TaskSetDTO } from 'vs/workbench/api/shared/tasks';
import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor';
import * as tasks from 'vs/workbench/api/common/shared/tasks';
import { ITreeItem, IRevealOptions } from 'vs/workbench/common/views';
import { IAdapterDescriptor, IConfig, ITerminalSettings } from 'vs/workbench/contrib/debug/common/debug';
import { ITextQueryBuilderOptions } from 'vs/workbench/contrib/search/common/queryBuilder';
import { ITerminalDimensions } from 'vs/workbench/contrib/terminal/common/terminal';
import { ExtensionActivationError } from 'vs/workbench/services/extensions/common/extensions';
import { IRPCProtocol, createExtHostContextProxyIdentifier as createExtId, createMainContextProxyIdentifier as createMainId } from 'vs/workbench/services/extensions/node/proxyIdentifier';
import { IRPCProtocol, createExtHostContextProxyIdentifier as createExtId, createMainContextProxyIdentifier as createMainId } from 'vs/workbench/services/extensions/common/proxyIdentifier';
import { IProgressOptions, IProgressStep } from 'vs/platform/progress/common/progress';
import { SaveReason } from 'vs/workbench/services/textfile/common/textfiles';
import * as vscode from 'vscode';
import { IMarkdownString } from 'vs/base/common/htmlContent';
import { ResolvedAuthority } from 'vs/platform/remote/common/remoteAuthorityResolver';
import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import { IRemoteConsoleLog } from 'vs/base/node/console';
import * as codeInset from 'vs/workbench/contrib/codeinset/common/codeInset';
import * as callHierarchy from 'vs/workbench/contrib/callHierarchy/common/callHierarchy';
// {{SQL CARBON EDIT}}
import { ITreeItem as sqlITreeItem } from 'sql/workbench/common/views';
@@ -126,12 +124,13 @@ export interface MainThreadCommentsShape extends IDisposable {
$registerCommentController(handle: number, id: string, label: string): void;
$unregisterCommentController(handle: number): void;
$updateCommentControllerFeatures(handle: number, features: CommentProviderFeatures): void;
$createCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, comments: modes.Comment[], acceptInputCommand: modes.Command | undefined, additionalCommands: modes.Command[], collapseState: modes.CommentThreadCollapsibleState): modes.CommentThread2 | undefined;
$createCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, comments: modes.Comment[], acceptInputCommand: modes.Command | undefined, additionalCommands: modes.Command[], deleteCommand: modes.Command | undefined, collapseState: modes.CommentThreadCollapsibleState): modes.CommentThread2 | undefined;
$deleteCommentThread(handle: number, commentThreadHandle: number): void;
$updateComments(handle: number, commentThreadHandle: number, comments: modes.Comment[]): void;
$setInputValue(handle: number, input: string): void;
$updateCommentThreadAcceptInputCommand(handle: number, commentThreadHandle: number, acceptInputCommand: modes.Command): void;
$updateCommentThreadAdditionalCommands(handle: number, commentThreadHandle: number, additionalCommands: modes.Command[]): void;
$updateCommentThreadDeleteCommand(handle: number, commentThreadHandle: number, deleteCommand: modes.Command): void;
$updateCommentThreadCollapsibleState(handle: number, commentThreadHandle: number, collapseState: modes.CommentThreadCollapsibleState): void;
$updateCommentThreadRange(handle: number, commentThreadHandle: number, range: IRange): void;
$updateCommentThreadLabel(handle: number, commentThreadHandle: number, label: string): void;
@@ -195,7 +194,7 @@ export interface ITextEditorConfigurationUpdate {
indentSize?: number | 'tabSize';
insertSpaces?: boolean | 'auto';
cursorStyle?: TextEditorCursorStyle;
lineNumbers?: TextEditorLineNumbersStyle;
lineNumbers?: RenderLineNumbersType;
}
export interface IResolvedTextEditorConfiguration {
@@ -203,7 +202,7 @@ export interface IResolvedTextEditorConfiguration {
indentSize: number;
insertSpaces: boolean;
cursorStyle: TextEditorCursorStyle;
lineNumbers: TextEditorLineNumbersStyle;
lineNumbers: RenderLineNumbersType;
}
export enum TextEditorRevealType {
@@ -219,7 +218,7 @@ export interface IUndoStopOptions {
}
export interface IApplyEditsOptions extends IUndoStopOptions {
setEndOfLine: EndOfLine;
setEndOfLine?: EndOfLineSequence;
}
export interface ITextDocumentShowOptions {
@@ -258,7 +257,11 @@ export interface MainThreadErrorsShape extends IDisposable {
}
export interface MainThreadConsoleShape extends IDisposable {
$logExtensionHostMessage(msg: IRemoteConsoleLog): void;
$logExtensionHostMessage(msg: {
type: string;
severity: string;
arguments: string;
}): void;
}
export interface ISerializedRegExp {
@@ -301,11 +304,13 @@ export interface ISerializedLanguageConfiguration {
};
}
export type GlobPattern = string | { base: string; pattern: string };
export interface ISerializedDocumentFilter {
$serialized: true;
language?: string;
scheme?: string;
pattern?: vscode.GlobPattern;
pattern?: GlobPattern;
exclusive?: boolean;
}
@@ -339,6 +344,7 @@ export interface MainThreadLanguageFeaturesShape extends IDisposable {
$registerDocumentColorProvider(handle: number, selector: ISerializedDocumentFilter[]): void;
$registerFoldingRangeProvider(handle: number, selector: ISerializedDocumentFilter[]): void;
$registerSelectionRangeProvider(handle: number, selector: ISerializedDocumentFilter[]): void;
$registerCallHierarchyProvider(handle: number, selector: ISerializedDocumentFilter[]): void;
$setLanguageConfiguration(handle: number, languageId: string, configuration: ISerializedLanguageConfiguration): void;
}
@@ -374,7 +380,7 @@ export interface MainThreadProgressShape extends IDisposable {
}
export interface MainThreadTerminalServiceShape extends IDisposable {
$createTerminal(name?: string, shellPath?: string, shellArgs?: string[], cwd?: string | UriComponents, env?: { [key: string]: string | null }, waitOnExit?: boolean, strictEnv?: boolean): Promise<{ id: number, name: string }>;
$createTerminal(name?: string, shellPath?: string, shellArgs?: string[] | string, cwd?: string | UriComponents, env?: { [key: string]: string | null }, waitOnExit?: boolean, strictEnv?: boolean): Promise<{ id: number, name: string }>;
$createTerminalRenderer(name: string): Promise<number>;
$dispose(terminalId: number): void;
$hide(terminalId: number): void;
@@ -397,11 +403,11 @@ export interface MainThreadTerminalServiceShape extends IDisposable {
$terminalRendererRegisterOnInputListener(terminalId: number): void;
}
export interface TransferQuickPickItems extends IQuickPickItem {
export interface TransferQuickPickItems extends quickInput.IQuickPickItem {
handle: number;
}
export interface TransferQuickInputButton extends IQuickInputButton {
export interface TransferQuickInputButton extends quickInput.IQuickInputButton {
handle: number;
}
@@ -462,17 +468,26 @@ export interface TransferInputBox extends BaseTransferQuickInput {
validationMessage?: string;
}
export interface IInputBoxOptions {
value?: string;
valueSelection?: [number, number];
prompt?: string;
placeHolder?: string;
password?: boolean;
ignoreFocusOut?: boolean;
}
export interface MainThreadQuickOpenShape extends IDisposable {
$show(instance: number, options: IPickOptions<TransferQuickPickItems>, token: CancellationToken): Promise<number | number[] | undefined>;
$show(instance: number, options: quickInput.IPickOptions<TransferQuickPickItems>, token: CancellationToken): Promise<number | number[] | undefined>;
$setItems(instance: number, items: TransferQuickPickItems[]): Promise<void>;
$setError(instance: number, error: Error): Promise<void>;
$input(options: vscode.InputBoxOptions | undefined, validateInput: boolean, token: CancellationToken): Promise<string>;
$input(options: IInputBoxOptions | undefined, validateInput: boolean, token: CancellationToken): Promise<string>;
$createOrUpdate(params: TransferQuickInput): Promise<void>;
$dispose(id: number): Promise<void>;
}
export interface MainThreadStatusBarShape extends IDisposable {
$setEntry(id: number, extensionId: ExtensionIdentifier | undefined, text: string, tooltip: string, command: string, color: string | ThemeColor, alignment: MainThreadStatusBarAlignment, priority: number | undefined): void;
$setEntry(id: number, extensionId: ExtensionIdentifier | undefined, text: string, tooltip: string, command: string, color: string | ThemeColor, alignment: statusbar.StatusbarAlignment, priority: number | undefined): void;
$dispose(id: number): void;
}
@@ -494,16 +509,27 @@ export interface WebviewPanelShowOptions {
readonly preserveFocus?: boolean;
}
export interface IWebviewPanelOptions {
readonly enableFindWidget?: boolean;
readonly retainContextWhenHidden?: boolean;
}
export interface IWebviewOptions {
readonly enableScripts?: boolean;
readonly enableCommandUris?: boolean;
readonly localResourceRoots?: ReadonlyArray<UriComponents>;
}
export interface MainThreadWebviewsShape extends IDisposable {
$createWebviewPanel(handle: WebviewPanelHandle, viewType: string, title: string, showOptions: WebviewPanelShowOptions, options: vscode.WebviewPanelOptions & vscode.WebviewOptions, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): void;
$createWebviewCodeInset(handle: WebviewInsetHandle, symbolId: string, options: vscode.WebviewOptions, extensionLocation: UriComponents | undefined): void;
$createWebviewPanel(handle: WebviewPanelHandle, viewType: string, title: string, showOptions: WebviewPanelShowOptions, options: IWebviewPanelOptions & IWebviewOptions, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): void;
$createWebviewCodeInset(handle: WebviewInsetHandle, symbolId: string, options: IWebviewOptions, extensionLocation: UriComponents | undefined): void;
$disposeWebview(handle: WebviewPanelHandle): void;
$reveal(handle: WebviewPanelHandle, showOptions: WebviewPanelShowOptions): void;
$setTitle(handle: WebviewPanelHandle, value: string): void;
$setIconPath(handle: WebviewPanelHandle, value: { light: UriComponents, dark: UriComponents } | undefined): void;
$setHtml(handle: WebviewPanelHandle | WebviewInsetHandle, value: string): void;
$setOptions(handle: WebviewPanelHandle | WebviewInsetHandle, options: vscode.WebviewOptions): void;
$setOptions(handle: WebviewPanelHandle | WebviewInsetHandle, options: IWebviewOptions): void;
$postMessage(handle: WebviewPanelHandle | WebviewInsetHandle, value: any): Promise<boolean>;
$registerSerializer(viewType: string): void;
@@ -520,7 +546,7 @@ export interface ExtHostWebviewsShape {
$onMessage(handle: WebviewPanelHandle, message: any): void;
$onDidChangeWebviewPanelViewState(handle: WebviewPanelHandle, newState: WebviewPanelViewState): void;
$onDidDisposeWebviewPanel(handle: WebviewPanelHandle): Promise<void>;
$deserializeWebviewPanel(newWebviewHandle: WebviewPanelHandle, viewType: string, title: string, state: any, position: EditorViewColumn, options: vscode.WebviewOptions): Promise<void>;
$deserializeWebviewPanel(newWebviewHandle: WebviewPanelHandle, viewType: string, title: string, state: any, position: EditorViewColumn, options: IWebviewOptions): Promise<void>;
}
export interface MainThreadUrlsShape extends IDisposable {
@@ -532,9 +558,13 @@ export interface ExtHostUrlsShape {
$handleExternalUri(handle: number, uri: UriComponents): Promise<void>;
}
export interface ITextSearchComplete {
limitHit?: boolean;
}
export interface MainThreadWorkspaceShape extends IDisposable {
$startFileSearch(includePattern: string | undefined, includeFolder: UriComponents | undefined, excludePatternOrDisregardExcludes: string | false | undefined, maxResults: number | undefined, token: CancellationToken): Promise<UriComponents[] | undefined>;
$startTextSearch(query: IPatternInfo, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise<vscode.TextSearchComplete>;
$startTextSearch(query: search.IPatternInfo, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise<ITextSearchComplete>;
$checkExists(includes: string[], token: CancellationToken): Promise<boolean>;
$saveAll(includeUntitled?: boolean): Promise<boolean>;
$updateWorkspaceFolders(extensionName: string, index: number, deleteCount: number, workspaceFoldersToAdd: { uri: UriComponents, name?: string }[]): Promise<void>;
@@ -543,11 +573,11 @@ export interface MainThreadWorkspaceShape extends IDisposable {
export interface IFileChangeDto {
resource: UriComponents;
type: FileChangeType;
type: files.FileChangeType;
}
export interface MainThreadFileSystemShape extends IDisposable {
$registerFileSystemProvider(handle: number, scheme: string, capabilities: FileSystemProviderCapabilities): void;
$registerFileSystemProvider(handle: number, scheme: string, capabilities: files.FileSystemProviderCapabilities): void;
$unregisterProvider(handle: number): void;
$registerResourceLabelFormatter(handle: number, formatter: ResourceLabelFormatter): void;
$unregisterResourceLabelFormatter(handle: number): void;
@@ -559,18 +589,18 @@ export interface MainThreadSearchShape extends IDisposable {
$registerTextSearchProvider(handle: number, scheme: string): void;
$unregisterProvider(handle: number): void;
$handleFileMatch(handle: number, session: number, data: UriComponents[]): void;
$handleTextMatch(handle: number, session: number, data: IRawFileMatch2[]): void;
$handleTextMatch(handle: number, session: number, data: search.IRawFileMatch2[]): void;
$handleTelemetry(eventName: string, data: any): void;
}
export interface MainThreadTaskShape extends IDisposable {
$createTaskId(task: TaskDTO): Promise<string>;
$createTaskId(task: tasks.TaskDTO): Promise<string>;
$registerTaskProvider(handle: number): Promise<void>;
$unregisterTaskProvider(handle: number): Promise<void>;
$fetchTasks(filter?: TaskFilterDTO): Promise<TaskDTO[]>;
$executeTask(task: TaskHandleDTO | TaskDTO): Promise<TaskExecutionDTO>;
$fetchTasks(filter?: tasks.TaskFilterDTO): Promise<tasks.TaskDTO[]>;
$executeTask(task: tasks.TaskHandleDTO | tasks.TaskDTO): Promise<tasks.TaskExecutionDTO>;
$terminateTask(id: string): Promise<void>;
$registerTaskSystem(scheme: string, info: TaskSystemInfoDTO): void;
$registerTaskSystem(scheme: string, info: tasks.TaskSystemInfoDTO): void;
$customExecutionComplete(id: string, result?: number): Promise<void>;
}
@@ -638,6 +668,13 @@ export interface MainThreadSCMShape extends IDisposable {
export type DebugSessionUUID = string;
export interface IDebugConfiguration {
type: string;
name: string;
request: string;
[key: string]: any;
}
export interface MainThreadDebugServiceShape extends IDisposable {
$registerDebugTypes(debugTypes: string[]): void;
$sessionCached(sessionID: string): void;
@@ -650,7 +687,7 @@ export interface MainThreadDebugServiceShape extends IDisposable {
$unregisterDebugConfigurationProvider(handle: number): void;
$unregisterDebugAdapterDescriptorFactory(handle: number): void;
$unregisterDebugAdapterTrackerFactory(handle: number): void;
$startDebugging(folder: UriComponents | undefined, nameOrConfig: string | vscode.DebugConfiguration, parentSessionID: string | undefined): Promise<boolean>;
$startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, parentSessionID: string | undefined): Promise<boolean>;
$customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): Promise<any>;
$appendDebugConsole(value: string): void;
$startBreakpointEvents(): void;
@@ -751,29 +788,29 @@ export interface ExtHostTreeViewsShape {
export interface ExtHostWorkspaceShape {
$initializeWorkspace(workspace: IWorkspaceData | null): void;
$acceptWorkspaceData(workspace: IWorkspaceData | null): void;
$handleTextSearchResult(result: IRawFileMatch2, requestId: number): void;
$handleTextSearchResult(result: search.IRawFileMatch2, requestId: number): void;
}
export interface ExtHostFileSystemShape {
$stat(handle: number, resource: UriComponents): Promise<IStat>;
$readdir(handle: number, resource: UriComponents): Promise<[string, FileType][]>;
$stat(handle: number, resource: UriComponents): Promise<files.IStat>;
$readdir(handle: number, resource: UriComponents): Promise<[string, files.FileType][]>;
$readFile(handle: number, resource: UriComponents): Promise<Buffer>;
$writeFile(handle: number, resource: UriComponents, content: Buffer, opts: FileWriteOptions): Promise<void>;
$rename(handle: number, resource: UriComponents, target: UriComponents, opts: FileOverwriteOptions): Promise<void>;
$copy(handle: number, resource: UriComponents, target: UriComponents, opts: FileOverwriteOptions): Promise<void>;
$writeFile(handle: number, resource: UriComponents, content: Buffer, opts: files.FileWriteOptions): Promise<void>;
$rename(handle: number, resource: UriComponents, target: UriComponents, opts: files.FileOverwriteOptions): Promise<void>;
$copy(handle: number, resource: UriComponents, target: UriComponents, opts: files.FileOverwriteOptions): Promise<void>;
$mkdir(handle: number, resource: UriComponents): Promise<void>;
$delete(handle: number, resource: UriComponents, opts: FileDeleteOptions): Promise<void>;
$watch(handle: number, session: number, resource: UriComponents, opts: IWatchOptions): void;
$delete(handle: number, resource: UriComponents, opts: files.FileDeleteOptions): Promise<void>;
$watch(handle: number, session: number, resource: UriComponents, opts: files.IWatchOptions): void;
$unwatch(handle: number, session: number): void;
$open(handle: number, resource: UriComponents, opts: FileOpenOptions): Promise<number>;
$open(handle: number, resource: UriComponents, opts: files.FileOpenOptions): Promise<number>;
$close(handle: number, fd: number): Promise<void>;
$read(handle: number, fd: number, pos: number, length: number): Promise<Buffer>;
$write(handle: number, fd: number, pos: number, data: Buffer): Promise<number>;
}
export interface ExtHostSearchShape {
$provideFileSearchResults(handle: number, session: number, query: IRawQuery, token: CancellationToken): Promise<ISearchCompleteStats>;
$provideTextSearchResults(handle: number, session: number, query: IRawTextQuery, token: CancellationToken): Promise<ISearchCompleteStats>;
$provideFileSearchResults(handle: number, session: number, query: search.IRawQuery, token: CancellationToken): Promise<search.ISearchCompleteStats>;
$provideTextSearchResults(handle: number, session: number, query: search.IRawTextQuery, token: CancellationToken): Promise<search.ISearchCompleteStats>;
$clearCache(cacheKey: string): Promise<void>;
}
@@ -869,7 +906,12 @@ export interface WorkspaceSymbolsDto extends IdObject {
export interface ResourceFileEditDto {
oldUri?: UriComponents;
newUri?: UriComponents;
options?: IFileOperationOptions;
options?: {
overwrite?: boolean;
ignoreIfExists?: boolean;
ignoreIfNotExists?: boolean;
recursive?: boolean;
};
}
export interface ResourceTextEditDto {
@@ -923,6 +965,16 @@ export interface CodeLensDto extends ObjectIdentifier {
export type CodeInsetDto = ObjectIdentifier & codeInset.ICodeInsetSymbol;
export interface CallHierarchyDto {
_id: number;
kind: modes.SymbolKind;
name: string;
detail?: string;
uri: UriComponents;
range: IRange;
selectionRange: IRange;
}
export interface ExtHostLanguageFeaturesShape {
$provideDocumentSymbols(handle: number, resource: UriComponents, token: CancellationToken): Promise<modes.DocumentSymbol[] | undefined>;
$provideCodeLenses(handle: number, resource: UriComponents, token: CancellationToken): Promise<CodeLensDto[]>;
@@ -955,6 +1007,8 @@ export interface ExtHostLanguageFeaturesShape {
$provideColorPresentations(handle: number, resource: UriComponents, colorInfo: IRawColorInfo, token: CancellationToken): Promise<modes.IColorPresentation[] | undefined>;
$provideFoldingRanges(handle: number, resource: UriComponents, context: modes.FoldingContext, token: CancellationToken): Promise<modes.FoldingRange[] | undefined>;
$provideSelectionRanges(handle: number, resource: UriComponents, positions: IPosition[], token: CancellationToken): Promise<modes.SelectionRange[][]>;
$provideCallHierarchyItem(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<CallHierarchyDto | undefined>;
$resolveCallHierarchyItem(handle: number, item: callHierarchy.CallHierarchyItem, direction: callHierarchy.CallHierarchyDirection, token: CancellationToken): Promise<[CallHierarchyDto, modes.Location[]][]>;
}
export interface ExtHostQuickOpenShape {
@@ -991,6 +1045,7 @@ export interface ExtHostTerminalServiceShape {
$acceptProcessShutdown(id: number, immediate: boolean): void;
$acceptProcessRequestInitialCwd(id: number): void;
$acceptProcessRequestCwd(id: number): void;
$acceptProcessRequestLatency(id: number): number;
}
export interface ExtHostSCMShape {
@@ -1002,11 +1057,11 @@ export interface ExtHostSCMShape {
}
export interface ExtHostTaskShape {
$provideTasks(handle: number, validTypes: { [key: string]: boolean; }): Thenable<TaskSetDTO>;
$onDidStartTask(execution: TaskExecutionDTO, terminalId: number): void;
$onDidStartTaskProcess(value: TaskProcessStartedDTO): void;
$onDidEndTaskProcess(value: TaskProcessEndedDTO): void;
$OnDidEndTask(execution: TaskExecutionDTO): void;
$provideTasks(handle: number, validTypes: { [key: string]: boolean; }): Thenable<tasks.TaskSetDTO>;
$onDidStartTask(execution: tasks.TaskExecutionDTO, terminalId: number): void;
$onDidStartTaskProcess(value: tasks.TaskProcessStartedDTO): void;
$onDidEndTaskProcess(value: tasks.TaskProcessEndedDTO): void;
$OnDidEndTask(execution: tasks.TaskExecutionDTO): void;
$resolveVariables(workspaceFolder: UriComponents, toResolve: { process?: { name: string; cwd?: string }, variables: string[] }): Promise<{ process?: string; variables: { [key: string]: string } }>;
}
@@ -1118,7 +1173,7 @@ export interface ExtHostCommentsShape {
$provideCommentingRanges(commentControllerHandle: number, uriComponents: UriComponents, token: CancellationToken): Promise<IRange[] | undefined>;
$provideReactionGroup(commentControllerHandle: number): Promise<modes.CommentReaction[] | undefined>;
$toggleReaction(commentControllerHandle: number, threadHandle: number, uri: UriComponents, comment: modes.Comment, reaction: modes.CommentReaction): Promise<void>;
$createNewCommentWidgetCallback(commentControllerHandle: number, uriComponents: UriComponents, range: IRange, token: CancellationToken): void;
$createNewCommentWidgetCallback(commentControllerHandle: number, uriComponents: UriComponents, range: IRange, token: CancellationToken): Promise<void>;
$replyToCommentThread(handle: number, document: UriComponents, range: IRange, commentThread: modes.CommentThread, text: string): Promise<modes.CommentThread | null>;
$editComment(handle: number, document: UriComponents, comment: modes.Comment, text: string): Promise<void>;
$deleteComment(handle: number, document: UriComponents, comment: modes.Comment): Promise<void>;
@@ -5,8 +5,8 @@
import { IDisposable } from 'vs/base/common/lifecycle';
import { IConstructorSignature1 } from 'vs/platform/instantiation/common/instantiation';
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
import { ProxyIdentifier } from 'vs/workbench/services/extensions/node/proxyIdentifier';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { ProxyIdentifier } from 'vs/workbench/services/extensions/common/proxyIdentifier';
export type IExtHostNamedCustomer<T extends IDisposable> = [ProxyIdentifier<T>, IExtHostCustomerCtor<T>];
@@ -15,47 +15,46 @@ import { LanguageConfigurationFileHandler } from 'vs/workbench/contrib/codeEdito
// --- mainThread participants
import 'vs/workbench/api/node/apiCommands';
import './mainThreadClipboard';
import './mainThreadCommands';
import './mainThreadConfiguration';
import './mainThreadConsole';
import '../browser/mainThreadClipboard';
import '../browser/mainThreadCommands';
import '../browser/mainThreadConfiguration';
// {{SQL CARBON EDIT}}
// disable the debug service
// import './mainThreadDebugService';
import './mainThreadDecorations';
import './mainThreadDiagnostics';
import './mainThreadDialogs';
import './mainThreadDocumentContentProviders';
// import '../browser/mainThreadDebugService';
import '../browser/mainThreadDecorations';
import '../browser/mainThreadDiagnostics';
import '../browser/mainThreadDialogs';
import '../browser/mainThreadDocumentContentProviders';
import '../browser/mainThreadErrors';
import '../browser/mainThreadFileSystem';
import '../browser/mainThreadFileSystemEventService';
import '../browser/mainThreadMessageService';
import '../browser/mainThreadOutputService';
import '../browser/mainThreadProgress';
import '../browser/mainThreadQuickOpen';
import '../browser/mainThreadSaveParticipant';
import '../browser/mainThreadSCM';
import '../browser/mainThreadSearch';
import '../browser/mainThreadStatusBar';
import '../browser/mainThreadStorage';
import './mainThreadComments';
import './mainThreadConsole';
import './mainThreadDocuments';
import './mainThreadDocumentsAndEditors';
import './mainThreadEditor';
import './mainThreadEditors';
import './mainThreadErrors';
import './mainThreadExtensionService';
import './mainThreadFileSystem';
import './mainThreadFileSystemEventService';
import './mainThreadHeapService';
import './mainThreadLanguageFeatures';
import './mainThreadLanguages';
import './mainThreadMessageService';
import './mainThreadOutputService';
import './mainThreadProgress';
import './mainThreadQuickOpen';
import './mainThreadSCM';
import './mainThreadSearch';
import './mainThreadSaveParticipant';
import './mainThreadStatusBar';
import './mainThreadStorage';
import '../browser/mainThreadLanguages';
import '../browser/mainThreadLogService';
import './mainThreadTask';
import './mainThreadTelemetry';
import './mainThreadTerminalService';
import './mainThreadTreeViews';
import './mainThreadLogService';
import './mainThreadWebview';
import './mainThreadComments';
import '../browser/mainThreadTelemetry';
import '../browser/mainThreadTerminalService';
import '../browser/mainThreadTreeViews';
import './mainThreadUrls';
import './mainThreadWindow';
import './mainThreadWorkspace';
import './mainThreadWebview';
import '../browser/mainThreadWindow';
import '../browser/mainThreadWorkspace';
export class ExtensionPoints implements IWorkbenchContribution {
@@ -6,10 +6,10 @@
import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle';
import { ICodeEditor, isCodeEditor, isDiffEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';
import * as modes from 'vs/editor/common/modes';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { keys } from 'vs/base/common/map';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ExtHostCommentsShape, ExtHostContext, IExtHostContext, MainContext, MainThreadCommentsShape, CommentProviderFeatures } from '../node/extHost.protocol';
import { ExtHostCommentsShape, ExtHostContext, IExtHostContext, MainContext, MainThreadCommentsShape, CommentProviderFeatures } from '../common/extHost.protocol';
import { ICommentService, ICommentInfo } from 'vs/workbench/contrib/comments/electron-browser/commentService';
import { COMMENTS_PANEL_ID, CommentsPanel, COMMENTS_PANEL_TITLE } from 'vs/workbench/contrib/comments/electron-browser/commentsPanel';
@@ -142,6 +142,14 @@ export class MainThreadCommentThread implements modes.CommentThread2 {
return this._additionalCommands;
}
set deleteCommand(newCommand: modes.Command | undefined) {
this._deleteCommand = newCommand;
}
get deleteCommand(): modes.Command | undefined {
return this._deleteCommand;
}
private _onDidChangeAdditionalCommands = new Emitter<modes.Command[]>();
get onDidChangeAdditionalCommands(): Event<modes.Command[]> { return this._onDidChangeAdditionalCommands.event; }
@@ -179,6 +187,7 @@ export class MainThreadCommentThread implements modes.CommentThread2 {
private _comments: modes.Comment[],
private _acceptInputCommand: modes.Command | undefined,
private _additionalCommands: modes.Command[],
private _deleteCommand: modes.Command | undefined,
private _collapsibleState: modes.CommentThreadCollapsibleState
) {
@@ -240,7 +249,15 @@ export class MainThreadCommentController {
this._features = features;
}
createCommentThread(commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, comments: modes.Comment[], acceptInputCommand: modes.Command | undefined, additionalCommands: modes.Command[], collapseState: modes.CommentThreadCollapsibleState): modes.CommentThread2 {
createCommentThread(commentThreadHandle: number,
threadId: string,
resource: UriComponents,
range: IRange,
comments: modes.Comment[],
acceptInputCommand: modes.Command | undefined,
additionalCommands: modes.Command[],
deleteCommand: modes.Command | undefined,
collapseState: modes.CommentThreadCollapsibleState): modes.CommentThread2 {
let thread = new MainThreadCommentThread(
commentThreadHandle,
this,
@@ -251,6 +268,7 @@ export class MainThreadCommentController {
comments,
acceptInputCommand,
additionalCommands,
deleteCommand,
collapseState
);
@@ -301,6 +319,11 @@ export class MainThreadCommentController {
thread.additionalCommands = additionalCommands;
}
updateDeleteCommand(commentThreadHandle: number, deleteCommand: modes.Command) {
const thread = this.getKnownThread(commentThreadHandle);
thread.deleteCommand = deleteCommand;
}
updateCollapsibleState(commentThreadHandle: number, collapseState: modes.CommentThreadCollapsibleState) {
let thread = this.getKnownThread(commentThreadHandle);
thread.collapsibleState = collapseState;
@@ -326,7 +349,7 @@ export class MainThreadCommentController {
}
}
private getKnownThread(commentThreadHandle: number) {
private getKnownThread(commentThreadHandle: number): MainThreadCommentThread {
const thread = this._threads.get(commentThreadHandle);
if (!thread) {
throw new Error('unknown thread');
@@ -351,8 +374,8 @@ export class MainThreadCommentController {
threads: ret,
commentingRanges: commentingRanges ?
{
resource: resource, ranges: commentingRanges, newCommentThreadCallback: (uri: UriComponents, range: IRange) => {
this._proxy.$createNewCommentWidgetCallback(this.handle, uri, range, token);
resource: resource, ranges: commentingRanges, newCommentThreadCallback: async (uri: UriComponents, range: IRange) => {
await this._proxy.$createNewCommentWidgetCallback(this.handle, uri, range, token);
}
} : [],
draftMode: modes.DraftMode.NotSupported
@@ -453,6 +476,9 @@ export class MainThreadComments extends Disposable implements MainThreadComments
$unregisterCommentController(handle: number): void {
const providerId = this._handlers.get(handle);
if (typeof providerId !== 'string') {
throw new Error('unknown handler');
}
this._commentService.unregisterCommentController(providerId);
this._handlers.delete(handle);
this._commentControllers.delete(handle);
@@ -468,14 +494,23 @@ export class MainThreadComments extends Disposable implements MainThreadComments
provider.updateFeatures(features);
}
$createCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, comments: modes.Comment[], acceptInputCommand: modes.Command | undefined, additionalCommands: modes.Command[], collapseState: modes.CommentThreadCollapsibleState): modes.CommentThread2 | undefined {
$createCommentThread(handle: number,
commentThreadHandle: number,
threadId: string,
resource: UriComponents,
range: IRange,
comments: modes.Comment[],
acceptInputCommand: modes.Command | undefined,
additionalCommands: modes.Command[],
deleteCommand: modes.Command,
collapseState: modes.CommentThreadCollapsibleState): modes.CommentThread2 | undefined {
let provider = this._commentControllers.get(handle);
if (!provider) {
return undefined;
}
return provider.createCommentThread(commentThreadHandle, threadId, resource, range, comments, acceptInputCommand, additionalCommands, collapseState);
return provider.createCommentThread(commentThreadHandle, threadId, resource, range, comments, acceptInputCommand, additionalCommands, deleteCommand, collapseState);
}
$deleteCommentThread(handle: number, commentThreadHandle: number) {
@@ -528,6 +563,16 @@ export class MainThreadComments extends Disposable implements MainThreadComments
provider.updateAdditionalCommands(commentThreadHandle, additionalCommands);
}
$updateCommentThreadDeleteCommand(handle: number, commentThreadHandle: number, acceptInputCommand: modes.Command) {
let provider = this._commentControllers.get(handle);
if (!provider) {
return;
}
provider.updateDeleteCommand(commentThreadHandle, acceptInputCommand);
}
$updateCommentThreadCollapsibleState(handle: number, commentThreadHandle: number, collapseState: modes.CommentThreadCollapsibleState): void {
let provider = this._commentControllers.get(handle);

Some files were not shown because too many files have changed in this diff Show More