-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
add cursorless.private.logQuickActions
internal command
#2136
Conversation
I don't quite follow the purpose of this. Why not just called the quick fix command and get the ui with available actions instead of printing them in the log? First I was thinking that it was just a simpler way to get the command, but you don't actually print that. |
I print the ids and titles in the log. I can then use the id when automatically triggering a quick action. The things in the quick fix popup don't have ids. Unless I'm missing something? |
Is it the kind you are after? Because I got confused that you can actually pass the kind as an argument in. |
If we print the command instead we could just call that directly and possibly don't have to bother with the quick fix menu? |
I don't actually pass that in. It's optional. You can pass that if you want to pass a general kind and see all the specific sub-kinds. But I could prob just drop that arg if it's confusing |
Is there a command? Didn't realise that was returned. I could just print exactly what comes back; I believe the filtering was from when I was trying to show it in a notification in an earlier draft and then just switched to debug console |
Got it. Not that obvious that you can pass in a general/prefix. I can a thought that why would you pass the exact kind to then have just that printed back. Maybe the comment can be updated to better reflect this?
Yes The code action class has an optional command field. Probably best to just print the entire return value. I do wonder if we should name this command something else; |
Done
I just tried that, and the command field is always either not present, or points to an internal command. For example: {
"title": "Extract to inner function in function 'logQuickActions'",
"kind": {
"value": "refactor.extract.function"
},
"command": {
"title": "Extract to inner function in function 'logQuickActions'",
"command": "_typescript.didApplyRefactoring",
"arguments": [
{
"action": "function_scope_0"
}
]
},
"isPreferred": false
} I would be inclined to keep it the way it is, where I retain only the useful information (
Done |
cursorless.private.logQuickActions
internal command
Useful for development as we add new Cursorless actions based on VSCode quick actions. We should prob put this in #1775 once that exists, but until then, seems harmless here
Checklist