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

Literal translation in copybooks #404

Open
dvag-dominik-schumacher opened this issue Apr 15, 2024 · 2 comments
Open

Literal translation in copybooks #404

dvag-dominik-schumacher opened this issue Apr 15, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@dvag-dominik-schumacher

Development environment used

  • Z Open Editor version:
  • Editor Platform
    • Visual Studio Code 1.88.0
  • Editor Platform Version: v4.1.0
  • Operating System: Windows 11
  • Java Version: OpenJDK Runtime Environment Zulu17.40+19-CA (build 17.0.6+10-LTS)

Problem Description

Detailed steps for reproducing the problem:

We have a lot of copybooks in which fields begin with a literal in the form 'XX', which are later replaced in the Cobol program with a REPLACE. These literals are not recognized correctly by the language server due to the single apostrophes, the error message "ERROR_TOKEN" unexpected tokens ignored is displayed.

I came across the same problem while searching (#305).

Is it possible to adapt the configuration of the Language Server so that a string replacement of literals in the form 'XX' (or similiar) is possible?

Observed behavior

excerpt from a copybook
zopen1


excerpt from a cobol program in which the literal 'XX' is replaced
zopen2
@FALLAI-Denis
Copy link

FALLAI-Denis commented Apr 15, 2024

Hi @dvag-dominik-schumacher,

Perhaps unrelated to the issue reported, which seems to me to be the same use case as the issue #305, but it seems to me that there is a space on COBOL level 01 between the string 'XX'- and the end of the variable name.
image

Then as indicated on issue #305, the construction of the copybook is not correct from a syntactical point of view, and therefore it does not seem abnormal to me that ZOE reports it, but this should only impact the copybook itself and not the program which uses the copybook and which applies a replacing on this syntactically incorrect part to make it correct.
What happens if you filter the problems view to only show those that relate to the active editor's file?
image

@dvag-dominik-schumacher
Copy link
Author

Hi @FALLAI-Denis ,

thanks for your fast response.
Yes, the blank space was a typing error while creating the screenshot, but is independent of the actual problem. If I set the filter to "Show active File Only" and I have the program in the active editor window, the errors disappear from the copybook and only errors of the respective program are displayed.

Unfortunately, we do not have the possibility and resources to change the literals (i.e. without apostrophes) in several hundred copybooks (and the programs that use them) so that they are syntactically correct (from the point of view of the Cobol Language Server). Especially if you edit these copybooks and have errors, which even the compiler will flag, these errors are unfortunately lost.

Hence my question as to whether it is possible to adjust the configuration in the Language Server so that the above constellation is no longer displayed as an error.

@phaumer phaumer added the enhancement New feature or request label Apr 18, 2024
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