[ENHANCEMENT] VSCode Command to create new Empty RobotFramework files
Describe the bug I get an error when trying to run "RobotCode: Create New File" in VSCode command palette
Not sure what this command is supposed to do, but it currently results in an error.
To Reproduce Steps to reproduce the behavior:
- Go to command palette 'Ctrl+Shift+P'
- Enter "RobotCode: Create New File"
- Click Enter
- An error pops-up.
Expected behavior I would have expected a new file with a generic .robot/.resource template to open.
Screenshots/ Videos
Logs I don't see any log about this in the RobotCode "output".
Desktop (please complete the following information):
- VS Code Version 1.89
- RobotCode Version 0.83.0
- OS: Windows
- Python Version 3.11.9
- RobotFramework Version 7.0
- robocop 5.0.4
Stop playing around so much!!! ;-)
You've found a feature that I carelessly tried out once, but it seems I haven't fully implemented it yet.
So I will leave it open, but change it to an enhancement.
@d-biehl - unless you're already far down the path of implementing this, I might encourage users to leverage the snippets feature in VS Code. Although it doesn't create a file, it does allow you to populate a structure within a file.
We use it on our team and it provides an easy to create new:
- Test cases
- Keywords
- Suites
In the case of each of the above, in an active editor, we need merely type (respectively):
-
tc -
kw -
suite
Hitting tab auto-populates the values from the template and you can even have placeholders that allow you to replicate values so you don't have to do a bunch of typing. I can demo this for you on the 🤖 Slack server if it allows Huddles.
@GLMeece Yes, I’m familiar with snippets, and there are already some snippets in RobotCode, e.g., for FOR, IF, or TRY. I’m not sure if RobotCode should implement more snippets, as each user might have their own view on how their snippets should look.
But maybe you have some ready-made snippets that are interesting and that we could integrate into RobotCode. Could you possibly post a few here?
There is a contribution point for snippets for extensions, see here: https://code.visualstudio.com/api/references/contribution-points#contributes.snippets. You could create that and submit a PR?