codefori / vscode-ibmi

🌍 IBM i development extension for VS Code
https://codefori.github.io/docs/#/
MIT License
288 stars 96 forks source link

Open member using STRPCCMD #492

Closed ngmhun closed 2 years ago

ngmhun commented 2 years ago

Is your feature request related to a problem? Please describe. We have a green-screen source management tool, where we can edit the sources with a PDM-like option. It would be nice it we could define an option code that opens the source for editing in vscode-ibmi. (Could also work from PDM itself.)

Describe the solution you'd like If it was possible from a windows command line to trigger somehow the IBM i: Open File command, then it would also be possible to do this from the IBM i server via STRPCCMD, and a PDM-like option could be defined for this.

Describe alternatives you've considered I have tried to run code -r member:/lib/file/member.ext, but it did not work.

Additional context Maybe a small js script could also work by connecting to the running vscode instance and triggering this IBM i:Open File command. I have tried the member: scheme, because I have seen in the source code, that this was registered with vscode.workspace.registerfileSystemProvider, but unfortunately, I am not a JS developer, so I could not figure out how it works.

worksofliam commented 2 years ago

Hi @ngmhun Thanks for a cool idea!

Sounds very similar to an idea I had before.

Does your idea look something like this video? https://www.youtube.com/watch?v=FtgVTZLD3Hc&ab_channel=LiamAllan

ngmhun commented 2 years ago

Yes, something like that, but maybe connecting to a specific session is not necessary, with the STRPCCMD method, opening a member from any session would work.

worksofliam commented 2 years ago

@ngmhun Need some time to think about how this could work. Will get back to you.

pedromelim commented 2 years ago

Ya, this would be very cool to be able to use. For companies that already have software management and do have sources spread on so many libraries, making a "shortcut command" to be able to use directly inside an emulator to open that source (library/file) in VS Code, would be great.

worksofliam commented 2 years ago

I am going to work on this, but it is going to use the same method of listening to a specific interactive job. If there is only one inter job, then it will select it automatically. If there are more, the user will have to select it.

ngmhun commented 2 years ago

Thank you! I don't know how this communication with an interactive session works. Did you consider listening to a data queue?

worksofliam commented 2 years ago

@ngmhun Data queue has and will continue to be considered while I work on this feature.

This will work by the VS Code connection reading the job log and looking for specific commands that start with c4i.

dferrand commented 2 years ago

I have it working using named pipe.

I can create a PR once #543 is merged.

worksofliam commented 2 years ago

@dferrand I've had some people we should consider looking at this API: https://code.visualstudio.com/api/references/vscode-api#window.registerUriHandler

Using this may make it easier, and should integrate nicely with STRPCCMD.

Liam

Also a nice SO answer: https://stackoverflow.com/a/55434913/4763757