Skip to content
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

Feature request: extract command reference and output filter reference from input parameter #262

Closed
astrovsky01 opened this issue Sep 27, 2024 · 2 comments · Fixed by #264
Labels
feature New feature proposal language server Related to the language server

Comments

@astrovsky01
Copy link

With longer and more complicated tools, nested conditionals and sub-parameters can be annoying to properly reference, necessitating tracing down a nested tag properly, and often times cause errors as one can be easily missed. This is the same with filter steps in outputs, where tracing the lineage of a tag and specific value can cause annoyance. I would like a way to easily extract the method of referencing a tag for both the command and output filers. In an example below, I would like to be able easily reference the param target within the command ($example_conditional.example_conditional_2.example_param_2), as well as generate a filter for when target's value is set for to generate an output (example_conditional_1['example_conditional_2']['example_param_2']) that can be modified easily (adding an in, ==, etc.)

        <conditional name="example__conditional_1" label="example_conditional_1">
            <param name="example_param_1" type="select" label="sub_param_1">
                <option value="yes">Yes</option>
                <option value="no">No</option>
            </param>
            <when value="yes">
                <conditional name="example_conditional_2" label="example_conditional_2">
                    <param name="example_param_2" type="select" label="sub_param_2">
                        <option value="yes">Yes</option>
                        <option value="no">No</option>
                    </param>
                    <when value="yes">
                        <param name="target" label="target" type="select" display="checkboxes" multiple="true">
                            <option value="option1">option 1</option>
                            <option value="option2">option 2</option>
                        </param>
                    </when>
                    <when value="no"/>
                </condiitonal>
            </when>
            <when value="no"/>
        </conditional>
@davelopez davelopez added feature New feature proposal language server Related to the language server labels Sep 28, 2024
@davelopez
Copy link
Collaborator

@astrovsky01 would something like this work for you?

ToolInsertParamRef

This is a custom command that you can invoke from the VSCode Command Palette (or directly using the default shortcut ctrl+alt+i+p or cmd+alt+i+p on Mac) and will let you select the desired input to insert at your current cursor position.

Let me know if this would work for you, then I'll do a similar thing for getting the filter like example_conditional_1['example_conditional_2']['example_param_2']

@astrovsky01
Copy link
Author

@davelopez that looks fantastic! Thank you so much for working on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature proposal language server Related to the language server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants