Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

show type hierarchy#71

Merged
jrieken merged 2 commits into
microsoft:mainfrom
Eskibear:type-h
Sep 3, 2021
Merged

show type hierarchy#71
jrieken merged 2 commits into
microsoft:mainfrom
Eskibear:type-h

Conversation

@Eskibear

Copy link
Copy Markdown
Member

part of microsoft/vscode#15533

The implementation is mostly copied from call hierarchy.

Signed-off-by: Yan Zhang <yanzh@microsoft.com>
Comment thread src/types/model.ts


export const enum TypeHierarchyDirection {
Subtypes = 'subtypes',

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

different from call-hierarchy, I use string enum here.

Comment thread src/utils.ts
'symbol-event', 'symbol-operator', 'symbol-type-parameter'
];

export function getThemeIcon(kind: vscode.SymbolKind): vscode.ThemeIcon | undefined {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I extract it here, as it's shared between call-h and type-h.

Comment thread src/types/index.ts

private static _key = 'references-view.typeHierarchyMode';

private _ctxMode = new ContextKey<TypeHierarchyDirection>('references-view.typeHierarchyMode');

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

different from call-h, I directly save value of corresponding enum string into memento object for simplicity.

@Eskibear

Copy link
Copy Markdown
Member Author

Here is a test with the same mock extension mentioned in microsoft/vscode#130922 (comment)

show-type-hierarchy.mp4

@heartacker

This comment has been minimized.

@jrieken jrieken self-assigned this Sep 1, 2021
@jrieken jrieken added this to the September 2021 milestone Sep 1, 2021
@jrieken jrieken self-requested a review September 3, 2021 08:39

@jrieken jrieken left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, pushed a commit to change the spelling to 'supertypes'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants