-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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 quick fix API #162950
Comments
@meganrogge responding to #145234 (comment)
Should be: Also the pattern in the API is to just accept a single object (see
We'll need to be more restrictive here, beyond just recommending a low number
Should we always execute unless alt is held?
We will want to register a provider interface, not just options, see vscode/src/vscode-dts/vscode.d.ts Lines 6757 to 6776 in ae49262
Also consider activation events and whether we should be declaring the matchers in the package.json to trigger activation? |
Reopening as it's just a proposal atm |
We talked about this in the API sync and think the provider approach would be better because we can:
|
@zardoy what is your use case where you can only generate them dynamically? |
I think git similar should work fine. |
@Tyriar thank you so much for the question! > vsce publish --no-depednencies
error: unknown option '--no-depednencies' Here we could provide a quickfix to use replace this option with Also, as I understand even with current static contribution model its not possible to implement Git Two Slash fix (as it programmatically replaces content in command to preserve other options) Please, ping me if some parts were unclear to you! |
@zardoy thanks for the context, neat idea 🙂
You're right, that one won't be possible. |
Feedback from API sync:
|
Incorporating changes above, that would make it: export interface TerminalQuickFixProvider {
/**
* Provides terminal quick fixes
* @param commandMatchResult The command match result for which to provide quick fixes
* @param token A cancellation token indicating the result is no longer needed
* @return Terminal quick fix(es) if any
*/
provideTerminalQuickFixes(commandMatchResult: TerminalCommandMatchResult, token: CancellationToken):
ProviderResult<
(TerminalQuickFixTerminalCommand | TerminalQuickFixOpener | Command)[]
|
TerminalQuickFixTerminalCommand | TerminalQuickFixOpener | Command
>;
} Where |
Topics for API sync:
|
This hasn't gone through the API process yet. We need some way of indicating the quick fix kind such that they can be presented in a different way. The main use case here is a sparkle icon for AI suggests but it could be expanded in the future Part of #162950
Feedback:
|
Hello, Looking to use this API in an internal-use extension (not published to market). Needing to have all interested parties daily drive vscode insiders is a blocker for us in deploying this extension. What is the current plan for finalizing this proposed API? Thanks @Tyriar & all involved. |
@BrunoRDS surprisingly to me, we haven't had any feedback yet so there's been no pressure to stabilize. Additionally, there were some recently tweaks to the API for the copilot extension. |
@Tyriar this is great, I only found out about this today. For the PowerShell extension, there is a new Feedback Provider mechanism in PowerShell 7.4 for suggestions to be surfaced for errors, command not found, or other scenarios. I would love to be able to do the following (a combination of the other API and this one):
Thanks for the work! |
By status page you mean the blue dot? I want to add a timestamp/duration at some point as it's trivial for us to get, created #199170 to track that. I'm not sure if it's worth it to expose an API to allow extensions to add info there given that?
To clarify, there are two things here; the "shell integration decoration" (blue or red circle) and the quick fix lightbulb/sparkle: So you want to react to a command finishing and show a warning icon where the blue dot is to mean successful with warnings? I don't think we've considered a way to do something like this yet where an extension can change something about the command result (quick fixes provide actions to act upon a result, not change it).
We have a couple of built-in quick fix providers that deal with the feedback providers: vscode/src/vs/workbench/contrib/terminalContrib/quickFix/browser/terminalQuickFixBuiltinActions.ts Lines 233 to 348 in 0e16324
Unfortunately there is not a standard format, at least when I was working on it, so we can't have a general catch all atm. For this do you mean running the command through PSScriptAnalyzer for the project and presenting a quick fix if it differs? Is this just a lint rule that isn't that important, or do you think it justifies a "high confidence" quick fix? |
I think it'd be useful to provide the |
@connor4312 sounds a lot more useful now that |
Forking this off from #145234 as that one is more focused on listening for and reacting to commands generally, not quick fixes.
The text was updated successfully, but these errors were encountered: