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
Command Pallette Button #37
Comments
That's a duplicate of #7. However I'm interested as well, because the answer in that other issue seems incomplete: Here's a basic example that would open settings on click. "actionButtons": {
"defaultColor": "#172c3d", // Can also use string color names.
"reloadButton": null, // Custom reload button text or icon (default ↻). null value enables automatic reload on configuration change
"commands": [
{
"name": "Settings",
"color": "#ffffff",
"command": "workbench.action.openSettings",
}
]
} What am I missing? |
In order to achieve this, we would have to use the as stated here: https://code.visualstudio.com/api/extension-guides/command, happy to provide mentoring if anyone is interested in picking this up. |
So that means it's not possible yet without modifying the extension itself? Just to make it clear, because the answer on the previous issue made it sound like it was already possible. |
At the time, this API didn't exist. |
I get that, but that means before the API the extension natively executed commands? The other posted asked if it was possible to call a palette command and you said it was possible as long as we knew the actual command. Is it not possible anymore? |
@seunlanlege I think I might me willing to tackle this. I am good with js, have not done much with ts. I did go through the vscode extension tutorial for a js extension. Pretty straight forward. I read the command api page.
Thinking out loud here, the process would be:
Can you think of anything I'm missing? |
Nope, looks good to me 👌🏾 |
Maybe merge this extension https://marketplace.visualstudio.com/items?itemName=geddski.macros into Action Buttons. It seems to complement Action Buttons nicely because it has exactly the features missing:
|
I have the save action button with: "actionButtons": {
"defaultColor": "none",
"commands": [
{
"name": "$(save)",
"useVsCodeApi": true,
"command": "workbench.action.files.save"
},
]
}, @momiccioli, does it solve your problem? |
Yes ! that works perfectly!
From: Mohammad Nabavi ***@***.***>
Reply-To: seunlanlege/vscode-action-buttons ***@***.***>
Date: Wednesday, June 21, 2023 at 11:15 AM
To: seunlanlege/vscode-action-buttons ***@***.***>
Cc: momiccioli ***@***.***>, Mention ***@***.***>
Subject: Re: [seunlanlege/vscode-action-buttons] Command Pallette Button (#37)
I have the save action button with:
"actionButtons": {
"defaultColor": "none",
"commands": [
{
"name": "$(save)",
"useVsCodeApi": true,
"command": "workbench.action.files.save"
},
]
},
@momiccioli, does it solve your problem?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Seun,
I use your buttons to run many scripts. For a few I of my scripts would like to run the save command automatically prior to the script running. is there a way to trigger this save when I run a script from another ActionButton?
I know about running items when I save a file but my needs are not that straight forward unfortunately.
Thought I would ask.
From: Michael Omiccioli ***@***.***>
Date: Wednesday, June 21, 2023 at 11:43 AM
To: seunlanlege/vscode-action-buttons ***@***.***>, seunlanlege/vscode-action-buttons ***@***.***>
Cc: Mention ***@***.***>
Subject: Re: [seunlanlege/vscode-action-buttons] Command Pallette Button (#37)
Yes ! that works perfectly!
From: Mohammad Nabavi ***@***.***>
Reply-To: seunlanlege/vscode-action-buttons ***@***.***>
Date: Wednesday, June 21, 2023 at 11:15 AM
To: seunlanlege/vscode-action-buttons ***@***.***>
Cc: momiccioli ***@***.***>, Mention ***@***.***>
Subject: Re: [seunlanlege/vscode-action-buttons] Command Pallette Button (#37)
I have the save action button with:
"actionButtons": {
"defaultColor": "none",
"commands": [
{
"name": "$(save)",
"useVsCodeApi": true,
"command": "workbench.action.files.save"
},
]
},
@momiccioli, does it solve your problem?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Whats the syntax to configure a button to run a command palette action? For example save current file.
The text was updated successfully, but these errors were encountered: