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

CL prompting for any CL command - Hinders me from leaving SEU for CL programming #2391

Open
richardschoen opened this issue Dec 1, 2024 · 9 comments
Labels
discussion For questions, or when something isn't working as expected idea Feature suggestion

Comments

@richardschoen
Copy link
Contributor

Is your feature request related to a problem? Please describe.

This is not really a problem, but a feature that holds me back from leaving SEU for editing CL programs and commands.

First off, SEU does CL command prompting really well in a CL source member when editing. RDI does command prompting, but it's slow to prompt, so that's a no go for any real productivity at the speed I code :-)

I create a lot of CL programs and rely heavily on CL command prompting to fill in optional and mandatory parameters and do some line formatting for me.

Since SEU and RDI can retrieve and create a command prompt screen, I'm pretty sure there is probably a way to do this and build an on-the-fly CL prompt dialog in VS Code. Or possibly just fill in all the parameter markers with defaults in VS Code editor so the rest can just be filled in.

Ex: I tried CL prompting briefly. It does appear that DCLF kind of works for this because it filled our info like this:

image

Created this in the editor:

DCLF FILE(*LIBL/File) RCDFMT(File) OPNID(*NONE) +
ALWVARLEN(*NO) ALWNULL(*NO) ALWGRAPHIC(*NO) DCLBINFLD(*DEC)

I suppose another way to do it would be to do something similar to what DCLF example is doing. I'm guessing there's some prompting info stored in the Code for I settings somewhere.

However, ideally retrieving command definitions on the fly from IBMi would put VS Code on par with RDI and SEU for CL programming.

Anyway I hope this makes sense. It would remove the barrier for me continuing to use SEU for CL programming.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

When I type a CL command and press F4 (or some other prompting mechanism such as the DCLF example above), locate the existing command info and create a prompt dialog to complete the command or just default the entire command with all its parameters into the VS Code editor so I can complete the command definition without needing to switch back to SEU or RDI.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Perhaps create a keyword settings file where common commands can be defined by the developer/user. Similar to the DCLF example I mentioned above. In Code for i it may actually work this way already perhaps, but I would need to know where the keywords are stored.

Ideally retrieving command definitions on the fly from IBMi would put VS Code on par with RDI and SEU for CL programming.

Additional context
Add any other context or screenshots about the feature request here.

@richardschoen richardschoen added the idea Feature suggestion label Dec 1, 2024
@richardschoen
Copy link
Contributor Author

richardschoen commented Dec 1, 2024

I did see this gets installed:
image

There are also a couple other CL lang plugins I plan to check out.

image image

@richardschoen
Copy link
Contributor Author

Ah, interesting. It does look like Control-Spacebar will show me available parms for existing commands and let me select all parts, but it doesn't fill in any of the default values.

@richardschoen
Copy link
Contributor Author

Here's what I'm visualizing.

Instead of this for all parms. (which is how it appears to work now once I figured out the Control-Spacebar option):

QSHONI/CMDLINE() SETPKGPATH() DSPSTDOUT() LOGSTDOUT() PRTSTDOUT() DLTSTDOUT() IFSSTDOUT() IFSFILE() IFSOPT() CCSID() PRTSPLF() PRTUSRDTA() PRTTXT() PRTHOLD() PRTOUTQ() OUTFILE() MBROPT() PASEJOBNAM()

Something like this perhaps if I select to see all parms or maybe an "All Parms with Defaults" option:

Example how it could look just picking up all the default all the keywords:

QSHONI/QSHEXEC SETPKGPATH(*YES) DSPSTDOUT(*NO) LOGSTDOUT(*NO) PRTSTDOUT(*NO) DLTSTDOUT(*YES) IFSSTDOUT(*NO) IFSOPT(*REPLACE) CCSID(*SAME) PRTSPLF(QSHEXECLOG) PRTUSRDTA(*NONE) PRTTXT(*NONE) PRTHOLD(*YES) PRTOUTQ(*SAME) OUTFILE(STDOUTQSH) MBROPT(*REPLACE) PASEJOBNAM(*DEFAULT)    

Perhaps an option to default all the keywords with a 1 or 2 keywords per line option. "All Parms with Defaults-Keyword Per Line"

QSHONI/QSHEXEC SETPKGPATH(*YES) DSPSTDOUT(*NO) LOGSTDOUT(*NO)  +
               PRTSTDOUT(*NO) +
               DLTSTDOUT(*YES)  +       
               IFSSTDOUT(*NO) +   
               IFSOPT(*REPLACE) +        
               CCSID(*SAME)  + 
               PRTSPLF(QSHEXECLOG)  +    
               PRTUSRDTA(*NONE)  +
               PRTTXT(*NONE)  +
               PRTHOLD(*YES) +      
               PRTOUTQ(*SAME)  +      
               OUTFILE(STDOUTQSH)  +     
               MBROPT(*REPLACE)  +
               PASEJOBNAM(*DEFAULT)  +   

Or possibly a prompt screen, but I could possibly settle for an option that allows me to see/prefill all my defaults perhaps with some line formatting as above.

image

Hopefully this is useful info.

@richardschoen
Copy link
Contributor Author

richardschoen commented Dec 1, 2024

Looks like this issue is related:
IBM/vscode-clle#7

All good info related to CL editing and how it could move more of us CL types forward :-)

@worksofliam
Copy link
Contributor

@richardschoen this is all great info. Thanks!

I am glad you found the content assist for parameters (and it also works for special values).

I believe we can have an option to put the default parameters in automatically. I think we have access to those default values.

Regarding the program: we have wanted a prompt for sometime. Sadly we haven't had the time to build the UI for it. Perhaps something for 2025.

Again, thanks for all the info.

@worksofliam worksofliam added the discussion For questions, or when something isn't working as expected label Dec 1, 2024
@SJLennon
Copy link
Contributor

SJLennon commented Dec 1, 2024

@richardschoen
There is a section in the documentation on CL: https://codefori.github.io/docs/extensions/clle/

@richardschoen
Copy link
Contributor Author

@SJLennon Thanks. There's not any way to get default parm values currently, correct ?

@SJLennon
Copy link
Contributor

SJLennon commented Dec 2, 2024

@richardschoen
I'm not a developer, just a user who has contributed to the documentation, but as far as I can see there isn't a way to highlight the default value. I believe the information comes from an API call, and perhaps it doesn't specify the default parm value. For example, here the default for AUT is *LIBCRTAUT, but it looks like the values are always sorted
alphabetically:
image

It might be more useful to have the wrench items at the top of the list, especially if you have a lot or program variables.

What's the use case for knowing the default value?

@richardschoen
Copy link
Contributor Author

The use case for seeing the default values is pretty much the same as when you prompt a CL command in SEU or RDI. It's good to do a visual reference point on the available parms and their available default values. Sometimes you will want to specify a value for a default parm to make sure someone doesn't override your choices by changing command defaults. I've seen that happen many times over the year when customers have changed system default parm values and it caused undesirable results. Thanks for feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion For questions, or when something isn't working as expected idea Feature suggestion
Projects
None yet
Development

No branches or pull requests

3 participants