mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
use Dto<T> util in more places, some clean-up/alignment of caching logic
This commit is contained in:
@@ -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, ICommandHandlerDescriptionDto } from './extHost.protocol';
|
||||
import { MainContext, MainThreadCommandsShape, ExtHostCommandsShape, 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';
|
||||
@@ -355,11 +355,10 @@ export class CommandsConverter {
|
||||
return result;
|
||||
}
|
||||
|
||||
fromInternal(command: modes.Command): vscode.Command | undefined {
|
||||
fromInternal(command: ICommandDto): vscode.Command | undefined {
|
||||
|
||||
const id = ObjectIdentifier.of(command);
|
||||
if (typeof id === 'number') {
|
||||
return this._cache.get(id);
|
||||
if (typeof command.$ident === 'number') {
|
||||
return this._cache.get(command.$ident);
|
||||
|
||||
} else {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user