Shared templates - #3424
Conversation
|
👋 A new build is available for this PR based on 84ac733. |
|
After further thought about this, I am wondering if this should be a feature that is implemented slightly differently and is actually in the Db2 extension and integrated with the As requested in codefori/vscode-db2i#526, users wanted to have reusable SQL examples stored in the IFS and easily accessible in the In my opinion, I also prefer to have these reusable SQL example queries browsable in the view rather than in the content assist as I don't always start with an editor. It is nice to just find the example I need and it brings up an untitled editor with the query just ready to run. @buzzia2001 @sebjulliand What are your thoughts? |
Hi |
|
If we want to add custom examples in db2 extension, we can open another pr |
Good point. I guess there can be different ways this same type of feature is used. If we do plan to keep this shared templates feature, what do you think about better aligning the name of this feature with what VS Code calls it: https://code.visualstudio.com/docs/editing/userdefinedsnippets#_create-your-own-snippets You can check this out by using the
I am thinking we store everything in this single file instead of having another directory to store the snippet. This keeps things consistent and makes it easy to copy snippets between the IFS and local. It would be great if we could also have this placeholders feature in VS Code also for these IFS snippets. Again, what do you think about this? 😁
Yes I think we can still add support for this in the Db2 extension separately as I described. I believe I started this change a while ago, I will check later if I have the code for it still and will PR it. |
|
Hi @SanjulaGanepola, I made the requested change. The configuration is now contained in a single file and no longer in directories. I also replaced the various entries in the frontend from “templates” to “snippets.”
|


Changes
This PR adds the ability to create custom code snippets for use; these snippets are tied to the IBM i system you are connected to. The metadata is located at /etc/vscode/Code4iRepo.json, while the source files are located at /etc/vscode/Code4iRepo.
How to test this PR
You can try the steps shown in this video:
2026-08-21.17-39-11.1.mp4
Checklist
console.logs I added