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

All language - Expose copybook/include search and download functionality returning a link to the corresponding file to third party extensions #436

Open
FALLAI-Denis opened this issue Aug 18, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@FALLAI-Denis
Copy link

Description of the enhancement requested

Hi,

Z Open Editor has a feature to search and download copybooks / includes referenced in a source program.
It uses it to provide access to the files containing these copybooks / includes through a clickable hyperlink from the referencing program source code, which opens this copybook / include file in a new editor.

We have developed an internal extension that is an assistant for writing COBOL programs.
This assistant has input screens, in the form of webviews, to enter various information including references to copybooks.
We would like to offer in these input screens the function of opening files corresponding to copybooks.
We could develop our own system for searching and downloading copybooks, but we would find it smarter (and also simpler for us!) to reuse the function already available in Z Open Editor.
The copybook search and download function would be useful to us for:

  • ensuring that the copybook exists and is accessible from the workspace context, whether it is a local copybook or an mvs copybook, (at this stage, these copybooks are not yet in the program source code since it is our assistant who is responsible for including the necessary code in the program)
  • being able to open the copybook file to consult it, or even being able to drag and drop information from this file to our input screens, (in particular data-item names and associated pictures)

Would it be possible for the Z Open Editor copybook search and download function to be exposed to third-party extensions in the form of an API?
The expected result of calling this API, certainly asynchronous promise, would be a path string or a uri object, or an error.
Then it is up to us to set up the hyperlink in the input screens of our assistant.

Is this search and download function dependent on the Language Server or only internal to the Z Open Editor extension? If it is dependent on the Language Server, then the exposed API must also ensure the startup of this server.

Thanks.

@phaumer
Copy link
Member

phaumer commented Aug 20, 2024

The language server requests the files and the extensions retrieves them and sends them back. They are stored in a canonical way in a temp folder and there is a setting to define the root directory. (However, Zowe v3 will make some changes here that we are evaluating.) So your extension could find the file in this folder after executing a File Open command. Providing a documented API for extenders is currently not something we have planned; however I do want to collect such use cases for internal discussion.

@phaumer phaumer added the enhancement New feature or request label Aug 20, 2024
@FALLAI-Denis
Copy link
Author

FALLAI-Denis commented Aug 20, 2024

Hi @phaumer,

In our context of use, the copybook is not yet referenced in a COBOL program, and therefore ZOE does not know it yet and we cannot find it in the temporary folder.
Furthermore it seems to me that for local copybooks ZOE does not copy them into the temporary folder?

See illustration in discussion IBM Z Open Editor User Survey:

  • in screenshots 2 and 3, we enter a copybook name in the interface of our extension, and we would like to benefit from ZOE's contribution to obtain a hyperlink to the file of this copybook,
  • it is only after entering, then validating this entry, that the reference to the copybook is injected into the source code of the COBOL program and that ZOE takes note of it to determine its location, and possibly download it from mvs.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants