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

Terminal links should open word links if there is exactly 1 matching file inside the workspaces #95119

Closed
Tyriar opened this issue Apr 13, 2020 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug terminal Integrated terminal issues terminal-links verified Verification succeeded
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Apr 13, 2020

With #21125 (comment) I'm triggering quick access via IQuickInputService.quickAccess.show(string). Ideally it would automatically activate the first item before showing the quick access if it's the only item available. Is there a way to way to do this already and if not could this be a new option here?

export interface IQuickAccessOptions {
/**
* Allows to enable quick navigate support in quick input.
*/
quickNavigateConfiguration?: IQuickNavigateConfiguration;
/**
* Allows to configure a different item activation strategy.
* By default the first item in the list will get activated.
*/
itemActivation?: ItemActivation;
/**
* Wether to take the input value as is and not restore it
* from any existing value if quick access is visible.
*/
preserveValue?: boolean;
}

@bpasero
Copy link
Member

bpasero commented Apr 13, 2020

No, quick input (and quick access) do not have such an option. Can you not simply check how many picks you return and if there is just one, take it?

@bpasero bpasero added the info-needed Issue requires more information from poster label Apr 13, 2020
@Tyriar
Copy link
Member Author

Tyriar commented Apr 13, 2020

@bpasero how would I go about doing that? Would that use all the quick access providers?

What I'm after is for a user to ctrl/cmd+click say "package.json", and if there is only 1 package.json in the workspace then it should open it directly (ideally without a flash of the quick input opening), otherwise do the equivalent of ctrl/cmd+p package.json.

@Tyriar
Copy link
Member Author

Tyriar commented Apr 13, 2020

I haven't touched any of these APIs before and only found this quickaccess.show by searching around which mostly does what I'm after.

@jmbockhorst
Copy link
Contributor

Instead of using quick access to search for the files, you would probably have to search for them yourself, if there is only 1 result, use it, and if there are more, show a quick pick for all those files using IQuickInputService.pick().

@Tyriar Tyriar changed the title Automatically trigger the first quick access result if there is only one Terminal links should open word links if there is exactly 1 matching file inside the workspaces Apr 14, 2020
@Tyriar Tyriar assigned Tyriar and unassigned bpasero Apr 14, 2020
@Tyriar
Copy link
Member Author

Tyriar commented Apr 14, 2020

Thanks for the help all, I got this working and will make this issue a bug to verify.

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug terminal Integrated terminal issues terminal-links and removed info-needed Issue requires more information from poster labels Apr 14, 2020
@Tyriar Tyriar added this to the April 2020 milestone Apr 14, 2020
@Tyriar Tyriar closed this as completed in f76f79e Apr 14, 2020
@roblourens roblourens added the verified Verification succeeded label Apr 30, 2020
@github-actions github-actions bot locked and limited conversation to collaborators May 29, 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 terminal Integrated terminal issues terminal-links verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants