have one Dto-type, drop functions, move into proxyIdentifier-file

This commit is contained in:
Johannes Rieken
2022-01-18 18:24:05 +01:00
parent 3932b0118c
commit 18ea5bd715
7 changed files with 29 additions and 27 deletions

View File

@@ -13,7 +13,6 @@ import { IDisposable } from 'vs/base/common/lifecycle';
import { MarshalledId, revive } from 'vs/base/common/marshalling';
import * as performance from 'vs/base/common/performance';
import Severity from 'vs/base/common/severity';
import { Dto } from 'vs/base/common/types';
import { URI, UriComponents } from 'vs/base/common/uri';
import { RenderLineNumbersType, TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions';
import { IPosition } from 'vs/editor/common/core/position';
@@ -25,7 +24,6 @@ import { IModelChangedEvent } from 'vs/editor/common/model/mirrorTextModel';
import * as modes from 'vs/editor/common/languages';
import { CharacterPair, CommentRule, EnterAction } from 'vs/editor/common/languages/languageConfiguration';
import { IAccessibilityInformation } from 'vs/platform/accessibility/common/accessibility';
import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands';
import { ConfigurationTarget, IConfigurationChange, IConfigurationData, IConfigurationOverrides } from 'vs/platform/configuration/common/configuration';
import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
@@ -66,7 +64,7 @@ import { InternalTimelineOptions, Timeline, TimelineChangeEvent, TimelineOptions
import { TypeHierarchyItem } from 'vs/workbench/contrib/typeHierarchy/common/typeHierarchy';
import { EditorGroupColumn } from 'vs/workbench/services/editor/common/editorGroupColumn';
import { ActivationKind, ExtensionHostKind, MissingExtensionDependency } from 'vs/workbench/services/extensions/common/extensions';
import { createProxyIdentifier, IRPCProtocol, SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier';
import { createProxyIdentifier, Dto, IRPCProtocol, SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier';
import { ILanguageStatus } from 'vs/workbench/services/languageStatus/common/languageStatusService';
import { CandidatePort } from 'vs/workbench/services/remote/common/remoteExplorerService';
import * as search from 'vs/workbench/services/search/common/search';
@@ -1229,9 +1227,19 @@ export interface MainThreadTimelineShape extends IDisposable {
// -- extension host
export interface ICommandHandlerDescriptionDto {
readonly description: string;
readonly args: ReadonlyArray<{
readonly name: string;
readonly isOptional?: boolean;
readonly description?: string;
}>;
readonly returns?: string;
}
export interface ExtHostCommandsShape {
$executeContributedCommand(id: string, ...args: any[]): Promise<unknown>;
$getContributedCommandHandlerDescriptions(): Promise<{ [id: string]: string | Dto<ICommandHandlerDescription>; }>;
$getContributedCommandHandlerDescriptions(): Promise<{ [id: string]: string | ICommandHandlerDescriptionDto; }>;
}
export interface ExtHostConfigurationShape {

View File

@@ -8,7 +8,7 @@ import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands
import * as extHostTypes from 'vs/workbench/api/common/extHostTypes';
import * as extHostTypeConverter from 'vs/workbench/api/common/extHostTypeConverters';
import { cloneAndChange } from 'vs/base/common/objects';
import { MainContext, MainThreadCommandsShape, ExtHostCommandsShape, ObjectIdentifier, ICommandDto } from './extHost.protocol';
import { MainContext, MainThreadCommandsShape, ExtHostCommandsShape, ObjectIdentifier, ICommandDto, ICommandHandlerDescriptionDto } from './extHost.protocol';
import { isNonEmptyArray } from 'vs/base/common/arrays';
import * as modes from 'vs/editor/common/languages';
import type * as vscode from 'vscode';
@@ -276,7 +276,7 @@ export class ExtHostCommands implements ExtHostCommandsShape {
});
}
$getContributedCommandHandlerDescriptions(): Promise<{ [id: string]: string | ICommandHandlerDescription }> {
$getContributedCommandHandlerDescriptions(): Promise<{ [id: string]: string | ICommandHandlerDescriptionDto }> {
const result: { [id: string]: string | ICommandHandlerDescription } = Object.create(null);
for (let [id, command] of this._commands) {
let { description } = command;

View File

@@ -16,7 +16,7 @@ import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/common/abstract
import { IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace';
import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService';
import { ExtHostDocumentsAndEditors, IExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors';
import { IDebuggerContribution, IConfig, IDebugAdapter, IDebugAdapterServer, IDebugAdapterExecutable, IAdapterDescriptor, IDebugAdapterImpl, IDebugAdapterNamedPipeServer } from 'vs/workbench/contrib/debug/common/debug';
import { IDebuggerContribution, IConfig, IDebugAdapter, IDebugAdapterServer, IDebugAdapterExecutable, IAdapterDescriptor, IDebugAdapterNamedPipeServer } from 'vs/workbench/contrib/debug/common/debug';
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { AbstractVariableResolverService } from 'vs/workbench/services/configurationResolver/common/variableResolver';
import { ExtHostConfigProvider, IExtHostConfiguration } from '../common/extHostConfiguration';
@@ -32,6 +32,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
import { withNullAsUndefined } from 'vs/base/common/types';
import * as process from 'vs/base/common/process';
import { IExtHostEditorTabs } from 'vs/workbench/api/common/extHostEditorTabs';
import { Dto } from 'vs/workbench/services/extensions/common/proxyIdentifier';
export const IExtHostDebugService = createDecorator<IExtHostDebugService>('IExtHostDebugService');
@@ -642,7 +643,7 @@ export abstract class ExtHostDebugServiceBase implements IExtHostDebugService, E
});
}
public async $provideDebugAdapter(adapterFactoryHandle: number, sessionDto: IDebugSessionDto): Promise<IAdapterDescriptor> {
public async $provideDebugAdapter(adapterFactoryHandle: number, sessionDto: IDebugSessionDto): Promise<Dto<IAdapterDescriptor>> {
const adapterDescriptorFactory = this.getAdapterDescriptorFactoryByHandle(adapterFactoryHandle);
if (!adapterDescriptorFactory) {
return Promise.reject(new Error('no adapter descriptor factory found for handle'));
@@ -693,7 +694,7 @@ export abstract class ExtHostDebugServiceBase implements IExtHostDebugService, E
// private & dto helpers
private convertToDto(x: vscode.DebugAdapterDescriptor): IAdapterDescriptor {
private convertToDto(x: vscode.DebugAdapterDescriptor): Dto<IAdapterDescriptor> {
if (x instanceof DebugAdapterExecutable) {
return <IDebugAdapterExecutable>{
@@ -714,7 +715,7 @@ export abstract class ExtHostDebugServiceBase implements IExtHostDebugService, E
path: x.path
};
} else if (x instanceof DebugAdapterInlineImplementation) {
return <IDebugAdapterImpl>{
return <Dto<IAdapterDescriptor>>{
type: 'implementation',
implementation: x.implementation
};

View File

@@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Dto } from 'vs/base/common/types';
import { UriComponents } from 'vs/base/common/uri';
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import type { Dto } from 'vs/workbench/services/extensions/common/proxyIdentifier';
export interface TaskDefinitionDTO {
type: string;