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

Execute revealFileInOS on TreeItem will use current focused file's URI #87804

Closed
Vigilans opened this issue Dec 28, 2019 · 3 comments · Fixed by #87805
Closed

Execute revealFileInOS on TreeItem will use current focused file's URI #87804

Vigilans opened this issue Dec 28, 2019 · 3 comments · Fixed by #87805
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@Vigilans
Copy link
Member

Issue Type: Bug

This is a regression bug after 0dbe568 which fixes #86103:

export function getMultiSelectedResources(resource: URI | object | undefined, listService: IListService, editorService: IEditorService, explorerService: IExplorerService): Array<URI> {
    const list = listService.lastFocusedList;
    if (list?.getHTMLElement() === document.activeElement) {
        // Explorer
        if (list instanceof AsyncDataTree) {  // <-- TreeView List will also fall into this block!
            // Explorer
            const context = explorerService.getContext(true);
            if (context.length) {
                return context.map(c => c.resource);
            }
        }

When executing getMultiSelectedResources with listService derived from TreeView, if will fall into the logic which only handles FileExplorer, causing the returned resource to be the currently focused file's uri.

Steps to Reproduce:

  1. Consider a java-dependency-viewer treeview:
    image

  2. Execute Reveal In Explorer on a jar file, which will forward jar file's uri to revealFileInOS command.

  3. On older versions, it will work as expected, but in insider version and the newly released version, it will open the folder containing the currently focused file.

VS Code version: Code 1.41.0 (9579eda, 2019-12-11T18:32:17.711Z)
OS version: Linux x64 4.15.0

isidorn pushed a commit that referenced this issue Dec 30, 2019
@isidorn isidorn added the bug Issue identified by VS Code Team member as probable bug label Dec 30, 2019
@isidorn isidorn added this to the January 2020 milestone Dec 30, 2019
@isidorn
Copy link
Contributor

isidorn commented Dec 30, 2019

@Vigilans vscode insiders from next week will contain your fix. Just let us know if the issue gets resolved for you so we can verify this issue. Thank you

@Vigilans
Copy link
Member Author

Vigilans commented Jan 7, 2020

Hi @isidorn, I confirmed that this issue has been resolved in new insider version, thank you!

@isidorn
Copy link
Contributor

isidorn commented Jan 8, 2020

Thank you, adding verified label.

@isidorn isidorn added the verified Verification succeeded label Jan 8, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants