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

Copybook not being recognized after being copied down #108

Closed
1 task
davidkjackson54 opened this issue Dec 17, 2020 · 5 comments
Closed
1 task

Copybook not being recognized after being copied down #108

davidkjackson54 opened this issue Dec 17, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@davidkjackson54
Copy link

davidkjackson54 commented Dec 17, 2020

I have a VSCode extension that create a tree view. When the user clicks on a source member in the Treeview, it is downloaded with a .COB suffix and z/Open Editor takes over and displays it in the right hand pane.
A Copy statement is flagged as not being found - this is correct.
Whilst leaving the COBOL source member open, I bring down the Cobol copy member using one of our REST api's into the same local directory as the original source and give it a .CPY suffix which I have added in z/Open Editor settings as an acceptable copybook suffix.
The Copy statement is still flagged as 'not found' even though it does not exist. I can somewhat understand that as it has no knowledge that the copy file is now present.
I close the source member editor pane and from my Treeview, I once again open up the local source file - however once again z/Open Editor is still not recognizing the presence of the copybook file.

The only way I can get this to be accepted, is if I close VSCode down entirely and reopen it, then once again click in my Treeview to again present the source back to z/Open Editor. Then the presence of the copy member is recognized.

Development environment used

  • Z Open Editor version:
  • Editor Platform
  • Visual Studio Code 1.52
  • Operating System Windows 10
@gplambert
Copy link

@davidkjackson54 Did you try just reloading the window instead of exiting and restarting VS Code? I tried the same steps and Opened the Command Pallette, then ran the Developer: Reload Window command. The copybook was then resolved.

@davidkjackson54
Copy link
Author

The problem with that is that my Treeview in the left hand pane is then contracted down and the user has to then go navigate his way back down the tree to get to where he was previously and reopen the file from scratch. It is very messy.
test

@gplambert gplambert added the enhancement New feature or request label Dec 21, 2020
@phaumer
Copy link
Member

phaumer commented Jan 13, 2021

@davidkjackson54 thanks for submitting. This is a great enhancement request. There has to be an event to tell the Language Server that the program file should be reevaluated. For example, if you simply edit the file (just a space somewhere) you see that the missing copybooks are immediately found. I assume that this will be a quite common scenario that developer download the program file, because they want to edit it. Then the errors will immediately go away.

But I agree that this should also work without editing the file. For example, we would have to set watchers on the folders that are listed in the property groups that can fire an event right away when the files appear locally. We have to look into that.

Until then edit the program file that has the COPY statements (e.g. add a space and do a ctrl-z to undo) is the easiest workaround I could find. Closing and opening the program (just close the editor tab, not the entire VS Code application) also works.

@phaumer phaumer changed the title Copybook not being recognized after being copied down - requires VSCode to be recycled Copybook not being recognized after being copied down Jan 13, 2021
@davidkjackson54
Copy link
Author

davidkjackson54 commented Jan 13, 2021 via email

@phaumer
Copy link
Member

phaumer commented Mar 10, 2023

Added file watcher support in Z Open Editor 3.1.0. See the release notes for a limitation using libraries that we intend to address in the future.

@phaumer phaumer closed this as completed Mar 10, 2023
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

3 participants