Skip to content

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

Closed

Description

@Vigilans

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

Activity

  1. added a commit that references this issue on Dec 30, 2019
    f3df207
  2. added
    bug
    on Dec 30, 2019
  3. isidorn commented on Dec 30, 2019

    @isidorn

    Vigilans (@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

  4. Vigilans commented on Jan 7, 2020

    @Vigilans
    MemberAuthor

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

  5. isidorn commented on Jan 8, 2020

    @isidorn

    Thank you, adding verified label.

  6. locked and limited conversation to collaborators on Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions