smithy-lang / smithy-vscode

A Visual Studio Code extension to provide syntax highlighting for the Smithy IDL.
https://marketplace.visualstudio.com/items?itemName=smithy.smithy-vscode-extension
Apache License 2.0
37 stars 14 forks source link

Add Selector run and clear commands #33

Closed srchase closed 2 years ago

srchase commented 2 years ago

This PR adds two selector commands which use the selector protocol extension added to the Smithy Language Server in https://github.com/awslabs/smithy-language-server/pull/36.

From the command palette, two commands are now available, Smithy:Selector:Run and Smithy:Selector:Clear:

smithy_commands

When invoked, the Smithy:Selector:Run command opens a dialog box where a selector expression can be entered to query the Smithy model loaded in the workspace:

expresion_input

Pressing enter runs the selector expression against the model, highlighting any shapes that match the query:

highlighted

If the command is invoked a again, the previously evaluated expression is pre-populated in the input box and the prior results are cleared.

The Smithy:Selector:Clear command clears previously highlighted results.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.