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

Generate command section #77

Merged
merged 23 commits into from
Dec 27, 2020
Merged

Generate command section #77

merged 23 commits into from
Dec 27, 2020

Conversation

davelopez
Copy link
Collaborator

@davelopez davelopez commented Dec 23, 2020

This adds a new custom command for the language server that tries to generate some boilerplate/scaffold Cheetah code for the command section of the current tool. The information is based on the current inputs and outputs defined when the command is executed.

The command can be executed in the VSCode client using the shortcut Ctrl+Alt+c (Cmd+Alt+c in Mac).

generate-command

For testing the generated Cheetah snippets a new test case has been added with the corresponding expected XML files.

The process for inserting snippets in the client has been improved to support insertion with replacing range, this allows replacing a possible auto-closed <command/> tag with the generated snippet instead of inserting the snippet alongside the existing <command/>. This enhancement has been also added for #73.

During the addition of tests for this enhancement, a miscalculation in the offsets of the tokens in XML parsing has been discovered and hopefully fixed :)

This PR closes #76

@davelopez davelopez added feature New feature proposal language server Related to the language server vscode extension Related to the VS Code extension labels Dec 23, 2020
@davelopez davelopez added this to In progress in Galaxy Language Server Dec 23, 2020
${8:TODO_argument} '\$c1.c2.c2_a2_p1'
#for \$${9:i}, \$${10:var} in enumerate(\$c1.c2.rep):
${11:TODO_argument} '\$${10:var}.rep_p1'
#for \$${12:i}, \$${13:var} in enumerate(\$${10:var}.sub_rep):
Copy link
Member

Choose a reason for hiding this comment

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

i probaby does not need to be marker and if we name the other variable item we can just hardocde it and also remove the marker. What do you think?

Copy link
Collaborator Author

@davelopez davelopez Dec 23, 2020

Choose a reason for hiding this comment

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

Sure! I will remove the placeholder in the $i. On the other hand, I think it is a better idea to keep the placeholder in the $var since it can collide with nested repeats and allows to rename all the related $var variables at the same time. Like this:
nested-repeat

@davelopez davelopez marked this pull request as ready for review December 27, 2020 18:15
Copy link
Member

@bgruening bgruening left a comment

Choose a reason for hiding this comment

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

Ship it! With this you have a great infrastructure in place to improve not iteratively. I guess those features are enough for a start to really advertise it and get some users :)

@davelopez davelopez merged commit 6d9642c into master Dec 27, 2020
Galaxy Language Server automation moved this from In progress to Done Dec 27, 2020
@davelopez davelopez deleted the gerate-command-section branch December 27, 2020 23:10
@davelopez davelopez added this to the v0.3.0 milestone Jan 1, 2021
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 vscode extension Related to the VS Code extension
Projects
Development

Successfully merging this pull request may close these issues.

Generate command section
2 participants