IBM / zopeneditor-about

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

COBOL: "IDENTIFICATION" formed from merged tokens #407

Closed ssamayoa closed 6 months ago

ssamayoa commented 7 months ago

Lately I have this error all COBOL programs I edit: "IDENTIFICATION" formed from merged tokens

Note that I'm using Zowe Explorer Extension for FTP. I have the same problem when open local COBOL programs. No harm but is annoying.

VS Code: Version: 1.88.1 (user setup) Commit: e170252f762678dec6ca2cc69aba1570769a5d39 Date: 2024-04-10T17:41:02.734Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Windows_NT x64 10.0.22631

Plugins: IBM Z Open Editor v4.1.0 Zowe Explorer Extension for FTP v2.15.4

Java: openjdk version "17.0.9" 2023-10-17 OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9) OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)

phaumer commented 6 months ago

@ssamayoa could you provide a simple COBOL program here that allows us to reproduce the error?

ssamayoa commented 6 months ago

@ssamayoa could you provide a simple COBOL program here that allows us to reproduce the error?

Here it is:

TEST1.cbl.txt

cobol-prog

Russell-May commented 6 months ago

This is an unusual error message as it indicates that the parse originally failed and then was able to resolve by merging 2 tokens together specifically "IDENTIFICATION". I'm not sure what would cause this token to be parsed as 2 separate tokens off the top of my head and am unable to replicate the issue using your example file. Can you also provide your zapp file and settings file? I'm suspecting that something is adjusting your columns, creating multiple tokens in the parse where there should only be 1.

ssamayoa commented 6 months ago

@Russell-May

Can you also provide your zapp file and settings file?

zapp.yaml has nothing special but here it is, renamed because yaml extension is not allowed. I edited settings.json removing saved settings like URLs, usernames and so - hope is not a problem in you investigation.

zapp.yaml.txt

settings.json

Worth mentioning that I associated .SQB to COBOL and no problem for those. And yes, I already tried removing the association and re-launching VS Code but the problem persist on CBL files.

Russell-May commented 6 months ago

I believe I see the problem.

In your settings file, under: zopeneditor.cobol.includeFileExtensions you have listed ".cbl" so the parser is trying to parse your main COBOL file as a copybook. Can you remove the ".cbl" entry and verify that resolves the issue?

ssamayoa commented 6 months ago

@Russell-May

I believe I see the problem.

You are right my friend! That fixed! I forgot that I added it because a customer's project had a lot of copy books with such extension.