mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
add type hierarchy provider
Signed-off-by: Yan Zhang <yanzh@microsoft.com>
This commit is contained in:
@@ -7,7 +7,7 @@ import { URI } from 'vs/base/common/uri';
|
||||
import type * as vscode from 'vscode';
|
||||
import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters';
|
||||
import * as types from 'vs/workbench/api/common/extHostTypes';
|
||||
import { IRawColorInfo, IWorkspaceEditDto, ICallHierarchyItemDto, IIncomingCallDto, IOutgoingCallDto } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { IRawColorInfo, IWorkspaceEditDto, ICallHierarchyItemDto, IIncomingCallDto, IOutgoingCallDto, ITypeHierarchyItemDto } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import * as modes from 'vs/editor/common/modes';
|
||||
import * as search from 'vs/workbench/contrib/search/common/search';
|
||||
import { ApiCommand, ApiCommandArgument, ApiCommandResult, ExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
|
||||
@@ -406,6 +406,22 @@ const newCommands: ApiCommand[] = [
|
||||
],
|
||||
ApiCommandResult.Void
|
||||
),
|
||||
// --- type hierarchy
|
||||
new ApiCommand(
|
||||
'vscode.prepareTypeHierarchy', '_executePrepareTypeHierarchy', 'Prepare type hierarchy at a position inside a document',
|
||||
[ApiCommandArgument.Uri, ApiCommandArgument.Position],
|
||||
new ApiCommandResult<ITypeHierarchyItemDto[], types.TypeHierarchyItem[]>('A TypeHierarchyItem or undefined', v => v.map(typeConverters.TypeHierarchyItem.to))
|
||||
),
|
||||
new ApiCommand(
|
||||
'vscode.provideSupertypes', '_executeProvideSupertypes', 'Compute supertypes for an item',
|
||||
[ApiCommandArgument.TypeHierarchyItem],
|
||||
new ApiCommandResult<ITypeHierarchyItemDto[], types.TypeHierarchyItem[]>('A TypeHierarchyItem or undefined', v => v.map(typeConverters.TypeHierarchyItem.to))
|
||||
),
|
||||
new ApiCommand(
|
||||
'vscode.provideSubtypes', '_executeProvideSubtypes', 'Compute subtypes for an item',
|
||||
[ApiCommandArgument.TypeHierarchyItem],
|
||||
new ApiCommandResult<ITypeHierarchyItemDto[], types.TypeHierarchyItem[]>('A TypeHierarchyItem or undefined', v => v.map(typeConverters.TypeHierarchyItem.to))
|
||||
),
|
||||
];
|
||||
|
||||
//#endregion
|
||||
|
||||
Reference in New Issue
Block a user