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

Code for IBMi - direct link to source edit #591

Open
cosentino-smeup opened this issue Sep 18, 2024 · 8 comments
Open

Code for IBMi - direct link to source edit #591

cosentino-smeup opened this issue Sep 18, 2024 · 8 comments
Labels
question Further information is requested

Comments

@cosentino-smeup
Copy link

Hello, I have a very peculiar question. I am using OpenVSCode Server.

I would like to invoke the editor of "Code for IBM i" by clicking a button on my application.

My application would redirect to the OpenVSCode web page, in order to edit a member of a source file (eg.TXT, RPGLE..).

I was wondering if it's possible pass some parameter in the url so that I can:

  1. automatically start the connection with my IBMi and create it if does not exists (maybe it's possible when the extension starts on the server via configuration file?)
  2. specify the source file I want to open

Thank you

@sebjulliand sebjulliand added the question Further information is requested label Sep 18, 2024
@sebjulliand
Copy link
Collaborator

Hi, I guess the answer would be "yes, it should be possible in the near future".
Look at to this Pull Request on the Code for i repository: codefori/vscode-ibmi#2038

@cosentino-smeup
Copy link
Author

Hi, I guess the answer would be "yes, it should be possible in the near future". Look at to this Pull Request on the Code for i repository: codefori/vscode-ibmi#2038

That's great @sebjulliand !!! thank you. I will wait for the PR to be accepted.

@sebjulliand
Copy link
Collaborator

Funny coincidence: the PR just got validated 🤣

@cosentino-smeup
Copy link
Author

cosentino-smeup commented Sep 19, 2024

@sebjulliand, can I already update the extension "Code for IBM i" in OpenVSCode? Do you know from what version this feature will be available?

@cosentino-smeup
Copy link
Author

My OpenVSCode link is:

https://kokoslab.smeup.com:3500/

so, if I got it right, I should should create the following address to use in my button:

https://kokoslab.smeup.com:3500/?host=srvlab01&path=/W_COSANT/SCP_SCH/B£_160_04.UPP

where:
srvlab01 = ibmi connection name
path = library/src-pf/member

Is it right?

@sebjulliand
Copy link
Collaborator

@sebjulliand, can I already update the extension "Code for IBM i" in OpenVSCode? Do you know from what version this feature will be available?

No, the PR has been approved but not merged yet.
The next release will presumably contain this enhancement.

Is it right?

Hard to say if it's going to work with OpenVSCode...the correct URL in your case would be vscode://halcyontechltd.code-for-ibmi/open?host=srvlab01&path=/W_COSANT/SCP_SCH/B£_160_04.UPP, as it is a VSCode URL we're looking at. This will send a request to the halcyontechltd.code-for-ibmi extension, to run the open action on host srvlab01 to open file /W_COSANT/SCP_SCH/B£_160_04.UPP. VSCode can catch that URL when clicked in a browser. Whether or not OpenVSCode can handle this kind of URI is beyond me for the moment.

@cosentino-smeup
Copy link
Author

Hard_ to say if it's going to work with OpenVSCode...

I'll try as soon as the update will be available

Hard to say if it's going to work with OpenVSCode...the correct URL in your case would be vscode://halcyontechltd.code-for-ibmi/open?host=srvlab01&path=/W_COSANT/SCP_SCH/B£_160_04.UPP,

In case of OpenVSCode, the halcyontechltd.code-for-ibmi extension is on the server "https://kokoslab.smeup.com:3500/ " as shown in the screenshot

open-vs-code

If I use the following link in the browser it's not going to find it:

vscode://halcyontechltd.code-for-ibmi/open?host=srvlab01&path=/W_COSANT/SCP_SCH/B£_160_04.UPP

Is it possible that it should be like this instead?

https://kokoslab.smeup.com:3500/halcyontechltd.code-for-ibmi?host=srvlab01&path=/W_COSANT/SCP_SCH/B%C2%A3_160_04.UPP

Obviously at the moment it's not working in my environment. Maybe you can test it?

@sebjulliand
Copy link
Collaborator

You'd better ask on the OpenVSCode repository if it supports vscode:// URL then you'll know for sure 😉

@cosentino-smeup cosentino-smeup changed the title IBMi-bob direct link to source edit Code for IBMi - direct link to source edit Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants