Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix type hierarchy regression since VS Code 1.75.1 #2930

Merged

Conversation

CsCherrYY
Copy link
Contributor

@CsCherrYY CsCherrYY commented Feb 10, 2023

Open a Type Hierarchy in a given type will shows an error editor. But it works in VS Code 1.75.0 and before.

image

Root cause:

  • There was a bug in TypeHierarchyModel.location(), we should use Uri.parse() instead of Uri.file() since we're using jdt scheme to express class types. Before VS Code 1.75.1, this method will not be called since we bind correct Uri in the tree item command:
    treeItem.command = (element.uri) ? {
    command: 'vscode.open',
    title: 'Open Type Definition Location',
    arguments: [
    vscode.Uri.parse(element.uri), <vscode.TextDocumentShowOptions>{ selection: element.selectionRange }
    ]
    } : undefined;
  • VS Code 1.75.1 introduces a change to auto reveal the item when it's selected, see: microsoft/vscode@a89b0e9, in this process, TypeHierarchyModel.location() will be called, causing this bug.

Signed-off-by: Shi Chen <chenshi@microsoft.com>
@Eskibear
Copy link
Contributor

LGTM

@fbricon fbricon merged commit 31b0a60 into redhat-developer:master Feb 10, 2023
@fbricon
Copy link
Collaborator

fbricon commented Feb 10, 2023

Thanks @CsCherrYY

@fbricon fbricon added the bug label Feb 10, 2023
@fbricon fbricon added this to the Mid February 2023 milestone Feb 10, 2023
@CsCherrYY CsCherrYY deleted the cs-typehierarchy-regression branch February 13, 2023 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants