IBM / zopeneditor-about

IBM Z Open Editor: File issues here!
https://ibm.github.io/zopeneditor-about
Apache License 2.0
49 stars 20 forks source link

Literal translation in copybooks #404

Open dvag-dominik-schumacher opened 5 months ago

dvag-dominik-schumacher commented 5 months ago

Development environment used

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 (https://github.com/IBM/zopeneditor-about/issues/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 commented 5 months ago

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 commented 5 months ago

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.