VS Code extension API - using complex command “workbench.action.quickOpen” that waits for user action before resolving the promise


VS Code extension API - using complex command “workbench.action.quickOpen” that waits for user action before resolving the promise



I have a VS Code extension, and I'm trying to execute a VS Code command. The command I want to use is "workbench.action.quickOpen"; I want to use this command to navigate to a method IF it exists.



I have the following code:


await vscode.commands.executeCommand('workbench.action.quickOpen', '#MethodToNavigateTo');



The problem here is, the quick open tool will open, populate with the method name, but the promise will only resolve once an item has been selected manually by the user.



Ideally what I want is to search for methods, if it exists, navigate to it, else, simply resolve the promise and do nothing. Is it possible to do this in a VS Code extension, or is there a workaround for me?



For context, I want to use this for a cucumber-js extension, so you can navigate to step files from feature files.









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Opening a url is failing in Swift

Export result set on Dbeaver to CSV