Skip to content

CmdPal: Add support for commands with parameters#46860

Open
ChaseKnowlden wants to merge 45 commits intomicrosoft:mainfrom
ChaseKnowlden:cmdpal-parameters
Open

CmdPal: Add support for commands with parameters#46860
ChaseKnowlden wants to merge 45 commits intomicrosoft:mainfrom
ChaseKnowlden:cmdpal-parameters

Conversation

@ChaseKnowlden
Copy link
Copy Markdown
Contributor

Summary of the Pull Request

PR Checklist

  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

I've added support for parameters for commands requiring them.

Validation Steps Performed

Copy link
Copy Markdown
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the correct approach here. There's no viewmodels to capture the state from the extension. It what, uses a ContentDialog to accept parameters?

I have a much more complete version of this spec'd and prototyped in #43784, it just needs merging with main. I'd start with that if you're interested in finishing this task.

@ChaseKnowlden
Copy link
Copy Markdown
Contributor Author

I've merged their old branch.

These are used when the `SelectValueCommand` is an `IInvokableCommand`.

These are rendered as a button within the search box. The button text is
`DisplayText` if it is set, otherwise it is `PlaceholderText`. If the user
public void UpdateText(ISearchUpdateArgs newText) {
Text = newText.Text;
// newText may have other properties too, like a correlation vector,
// but that's not demo'd here.
@github-actions

This comment has been minimized.

@michaeljolley michaeljolley added the Product-Command Palette Refers to the Command Palette utility label Apr 12, 2026
Copy link
Copy Markdown

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check-spelling found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@github-actions
Copy link
Copy Markdown

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

Unrecognized words (22)
agagin
agressively
autonumber
carcinisation
ced
contoso
delimeted
demo'd
demoed
designe
fwe
haz
kinda
MBV
mismash
Postitions
ppvm
recieves
Revetahw
trezt
WCT
zwsp
These words are not needed and should be removed diu IPREVIEW ITHUMBNAIL LPCFHOOKPROC LUMA MAXDWORD MRT suntimes timespan VSync

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:ChaseKnowlden/PowerToys.git repository
on the cmdpal-parameters branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/24314709777/attempts/1' &&
git commit -m 'Update check-spelling metadata'

Forbidden patterns 🙅 (2)

In order to address this, you could change the content to not match the forbidden patterns (comments before forbidden patterns may help explain why they're forbidden), add patterns for acceptable instances, or adjust the forbidden patterns themselves.

These forbidden patterns matched content:

Should be ; otherwise or . Otherwise

https://study.com/learn/lesson/otherwise-in-a-sentence.html

, [Oo]therwise\b
Should be for its (possessive) or because it is
\bfor it(?:'s| is)\b

Pattern suggestions ✂️ (1)

You could add these patterns to .github/actions/spell-check/patterns.txt:

# Automatically suggested patterns

# hit-count: 3 file-count: 3
# latex (check-spelling >= 0.0.22)
\\\w{2,}\{

Alternatively, if a pattern suggestion doesn't make sense for this project, add a # to the beginning of the line in the candidates file with the pattern to stop suggesting it.

Errors and Notices ❌ (2)

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

❌ Errors and Notices Count
ℹ️ candidate-pattern 3
❌ forbidden-pattern 3

See ❌ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

@michaeljolley
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Command Palette Refers to the Command Palette utility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CmdPal: Add support for commands with parameters

5 participants