IBM / zopeneditor-about

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

Parsing errors due to compiler options not loaded from zapp file #364

Closed oseam87 closed 6 months ago

oseam87 commented 8 months ago

Problem Description

In some instances, the compiler options (PLI or COBOL) from the zapp file are not loaded, which causes parsing errors. In the log, the "compilerOptions" passed to the language client is blank:

2023-11-11T17:33:11.700+01:00 DEBUG: AbstractZLanguageClient.initializeLanguageClient: Started initializing a new PL1 language client with these initialization options: {"publishDiagnostics":true,"includeFileExtensions":[".inc",".include",".plinc",".pcx",".pci"],"compilerOptions":""}.
2023-11-11T17:33:11.733+01:00 DEBUG: ZAPP: A valid ZAPP file was found in "/home/oseam/test01".
2023-11-11T17:33:11.822+01:00 INFO : IBM Z Open Editor extension has (re)started.

It might be because the zapp file is loaded after the initialization of the language client?

Detailed steps for reproducing the problem:

  1. Add a compiler options in the zapp file, for example:

    propertyGroups:
    - name: pl1-settings
    language: pl1
    compilerOptions: "NOT(^), OR(!)"
  2. Open the following test program in a new tab:

    TEST: PROC() OPTIONS(MAIN);
    
    DCL VAR1 BIT INIT('0'B);
    DCL VAR2 BIT INIT('0'B);
    
    IF VAR1 ! VAR2 THEN DO;
    END;
    
    END TEST;
  3. Restart vscode (which will reopen the workspace with the test program)

Observed behavior

Parsing errors, due to the character "!" not recognized.

Expected behavior

No errors.

phaumer commented 7 months ago

A workaround would be to close your editor tabs and restart the editor (crtl-shift-p > Developer: Reload Window).

phaumer commented 6 months ago

Fixed in v3.3.3. Can you try @oseam87?