Giter Site home page Giter Site logo

eclipse-che4z / che-che4z-lsp-for-hlasm Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 25.0 11.78 MB

HLASM Language Support is an LSP extension that adds support for the High Level Assembler language to IDEs

License: Eclipse Public License 2.0

CMake 1.52% C++ 87.34% ANTLR 2.23% C 0.03% Shell 0.12% JavaScript 0.37% TypeScript 8.36% Assembly 0.01% Lua 0.03%

che-che4z-lsp-for-hlasm's People

Contributors

actions-user avatar asmelko avatar fox0r avatar ishche avatar jirimosinger avatar lukasjaks avatar malimi97 avatar marcel1hruska avatar michalbali256 avatar pe-trik avatar slavek-kucera avatar swetas04 avatar vitgottwald avatar zdmullen avatar zeibura avatar zimlu02 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

che-che4z-lsp-for-hlasm's Issues

Extension Does Not Work with VS Code Color Theme

Describe the bug
The HLASM uses fixed colors for instructions which forces uses to select a theme that is readable for this extension.

To Reproduce
Change color preferences from light to dark to any other build-in or addon theme.

Expected behavior
The HLASM extension should honor theme settings in VS Code

Screenshots
Changing color preferences in VS Code has no effect on colors within the HLASM editor.

colors

Platform

  • Editor: VS Code
  • OS: Windows 10
  • Plugin version: 0.11.0

Additional context
Add any other context about the problem here.

Variable symbols hover in Macro tracer

Is your feature request related to a problem? Please describe.
In Macro tracer, the Variables panel contains values of variable symbols and ordinary symbols. During macro tracer usage, I can hover over the ordinary symbols in code and see the value of the symbol that is written in the Variables panel. The problem is, that names of variable symbols start without the beginning ampersand character (&). Hence, when I hover over any variable symbol in code, no value is shown and I need to find the value in the Variables panel. It can be tedious as the panel usually contains a lot of variable symbols.

Describe the solution you'd like
During macro tracer usage, I would like to see variable symbol value when I hover over it.

Describe alternatives you've considered
Probably, we just need to add beginning & for variable symbols in the Variables panel.

Print error messages while tracing macros

Describe the solution you'd like
I'd like to see error message generated by a statement in the debug console whenever the statement is "executed" in the macro debugger.

[Security] Workflow CI.yml is using vulnerable action actions/checkout

The workflow CI.yml is referencing action actions/checkout using references v1. However this reference is missing the commit a6747255bd19d7a757dbdda8c654a9f84db19839 which may contain fix to the some vulnerability.
The vulnerability fix that is missing by actions version could be related to:
(1) CVE fix
(2) upgrade of vulnerable dependency
(3) fix to secret leak and others.
Please consider to update the reference to the action.

Possibility to analyse HLASM listings

I noticed that it could be of great use to have some support to analyse HLASM listings in a more friendly way there, too!

Having the references and colors as we already have for sources can speed up the process of analysis there!
Also, another improvement could be coloring parameters and their counterparts in the machine representation correspondingly (41 1 0 0000 LA R1,0).

For now I don't think we have such features anywhere, so I keep analyzing old ways and sometimes needing to consult external references to complement information that could be already there

Symbols are not recognized inside literals

Symbols are not recognized inside literals.
E.g., 'Find All References' to X issued in line 1 returns no result.

x

Platform

  • Editor: VS Code Version 1.61.0
  • OS: Microsoft Windows Version 10.0.19043.1237
  • Plugin version: HLASM Language Support v0.14.1

BRAS flagged when 2nd argument is large but still valid

Describe the bug
The valid range for branch addresses in BRAS is a half of what it should be.

To Reproduce
Code a BRAS instruction so that RI2 falls between X'4000' and X'7FFF'.
The 2nd argument is falsely flagged as in error.

Expected behavior
The correct upper limit should be +65534 because the binary value represents the number of halfwords that is added
to the address of the instruction
.
Similarly with the lower limit.

Screenshots
image

Platform

  • Editor: VS Code 1.60.0
  • OS: Windows
  • Plugin version: 0.14.1

Additional context
(unrelated quote)

image

HLASM plugin does flag some long displacement (RXY) intructions as error

The instructions marked as bold are recognized as Syntax error by the Plugin. The error description is: Error at LAY instruction: value of address Operand displacement value must be between -2048 and 2047.
Example:

DoItAgain MVCOS 0(R14),0(R2),R10 Move data to output area
LAY R2,4096(,R2) Prepare source > 4 K
LAY R14,4096(,R14) Prepare target for > 4k
AHI R10,-4096 Check if bytes left
JP DoItAgain

There are two Problems with this.

  1. The error would be correct if i had something like LA R2,4096 BUT the range in the error message i.e. -2048 and 2047 is wrong cause LA does not allow signed values. So if i had something like LA R2,-100(,R2) in my Code, the Plugin would be happy but HLASM would throw an "Invalid displacement" error, cause a 12 Bit displacement has to be between 0 and 4095.

  2. The z990 processors support “long displacement (20-Bit)” RX-format instructions (RXY-a), with a displacement field range of -524288 to +524287 (± 0.5 Megabyte). All of the z/Architecture RX-format instructions introduced by the z900 are “long displacement” except for the floating point instructions. There are “Y” (long displacement) forms of most of the ESA/390 RX-format instructions except branch and as already mentioned floating Point intructions. Examples: AY, AHY, LY, LAY, STY

So the LAY instructions in the above example are perfectly valid and should never be flagged as error. For 12-Bit displacement intructions the error message text is wrong.

Self-defining term with the value of one apostrophe parsed incorrectly in model statements

Describe the bug
Self-defining term with the value of one apostrophe parsed incorrectly in model statements.

To Reproduce

ABC LR 1,1
&BLM SETC 'ABC'
 MVI   &BLM,C''''

The input above emits the following error:
While evaluating the result of substitution 'SYM,C'''' => Expected an apostrophe
Note that in the substituted string, there are only three apostrophes C''', but there should be 4.

Expected behavior
No errors.

Platform

  • Editor: Any
  • OS: Any
  • Plugin version: 0.13.0

`&SYSNDX(1,1)` reports a false positive diagnostic

Describe the bug
Using &SYSNDX with subscripts is valid hlasm.

To Reproduce

 MACRO
 MAC
 &SYSNDX(1,1)
 MEND 
 
 MAC

There is an error at &SYSNDX(1,1). It is valid on mainframe.

Expected behavior
No errors.

Screenshots
image

Platform

  • Editor: VS Code 1.63
  • OS: Windows
  • Plugin version: 0.15.1

Additional context
It seems like the assembler treats SYSNDX (and possibly more system variables) more like macro parameters, while we treat it internally like C type variable symbol.

LANGUAGE_SERVER.EXE has not been allowed to run

Describe the bug
At our site with virtual "locked down" desktops we can not use the HLASM extension because of this error "LANGUAGE_SERVER.EXE has not been allowed to run". We can not run .exe files.

To Reproduce
Steps to reproduce the behavior:
Enable HLASM Language Support on our virtual desktop,

Expected behavior
"LANGUAGE_SERVER.EXE has not been allowed to run" error message

Screenshots
If applicable, add screenshots to help explain your problem.

Platform

  • Editor: VS Code/Theia (including version)
  • OS: [e.g. iOS] (including distro)
  • Plugin version: [e.g. 0.10.0]

Additional context
Add any other context about the problem here.

Introduce release automation / conventional commits

Describe the solution you'd like
We would like to introduce release automation in to the project by adding semantic release / versioning / conventional commits

Acceptance criteria

  • Automatically GitHub changelog creation is in place (based on conventional commits?)
  • Version is updated in package.json
  • Newest release is pushed to master
  • New GitHub releases are automatically created

Vector instructions flagged when VR16-31 are used

Describe the bug
A valid instruction coding is incorrectly flagged as an error.

Example:

Error at VLM instruction: vector register operand absolute value must be between 0 and 15
HLASM Plugin(M124)

To Reproduce
Steps to reproduce the behavior:

         VSTM  16,31,SAVE
         VLM   16,31,SAVE

Expected behavior
The example code should produce no errors for the leftmost two operands (V1, V3).

Screenshots
image

Platform

  • Editor: VS Code 1.58.0
  • OS: Windows 10
  • Plugin version: 0.13.0

Additional context
The 5th bit necessary to encode values 0-31 is located in the RXB portion of vector instructions:
image

EQUATES of the form <LABEL> EQU *-<OTHER LABEL> erreanously flagged as error

Describe the bug
The HLASM Plugin flags some Assembler equate statements Statements as error, but those are perfectly valid, no Assembly Errors at all. To see what i am Talking About, please have a look at the attached screen shots. The first Shows that it is flagged, the second shot Shows the error as detected by the Plugin. There is really not much more i can tell you.

To Reproduce
Put a sequence like the ones shown in the attached screenshots into your Code and you see what i am talking About.

Expected behavior
Since this is not an error it should not be flagged as one

Screenshots
shot1

shot2

Platform

  • Editor: VS Code/Theia 1.44.2
  • OS: Windows NT Version 1809 Build 17763.1158
  • Plugin version: 0.10.0

Allow wildcards to be specified in the proc_grps settings for macro resolution across multiple folders

Our product distributes its macros across multiple folders. Each project a person works on will mirror the folder structure.

In order to resolve the COPY and macro usage, each distinct folder that has macros must be added to proc_grp. This is a lot of typing, time-consuming and error-prone.

Being able to specify wildcards in place of folders would be ideal, such as /TL1//SSF1/

In the example, "TL1" is the top layer for a project I am working on. TL2 would be a different project and so on.

The folder structure underneath is the same across all of the projects. The second layer distributes the product into ~100 components, so a wild-card is preferred here. The SSF1 folder is a fixed name. After SSF1, there are 4-5 other folders that each could contain macros. So, the enumeration of the specific directories that would need to be provided is 400-500.

Syntax errors reported in bilingual macros

Describe the bug
@Jakub-CZ reported syntax errors diagnosed on lines of code that are skipped using the AGO/ANOP instructions.

To Reproduce

      MACRO
      MAC
      AGO .SKIP
      2 a
.SKIP ANOP
      MEND

Expected behavior
No syntax errors are reported.

Platform

  • Plugin version: dev

Valid ALIAS operands are marked as errors

Describe the bug
Valid ALIAS operands are marked as errors.

https://www.ibm.com/docs/en/zos/2.1.0?topic=statements-alias-instruction

To Reproduce
Write the following program:

 ALIAS C'somestring'
 ALIAS X'4343434343'

Currently, it is marked as 'Bad operand value'.

Expected behavior
No errors.

Platform

  • Editor: Any
  • OS: Any
  • Plugin version: 0.13.0

Additional context
The operands are parsed as self-defining term - as a term of machine instruction. See assembler_operand_rules.g4 and machine_expr_rules. Once parsed as self_def_term, it is immediately checked whether it has 4 and less characters.

Literals

Describe the solution you'd like
In some HLASM programs, literals are used. The current plugin version does not provide any functionality for literals. Also, an attribute reference to a literal causes a diagnostic.

We would like to implement a new feature that will provide all needed functionality to properly evaluate and use HLASM literals.

Acceptance criteria

  • implement literal logic employing already implemented data definition logic
  • add an implementation that allows attribute reference to literals
  • implement LTORG instruction to make the literal feature complete

SYSMAC is special

Describe the bug
SYSMAC variable has unique properties being both scalar and an array (with valid index 0).

Platform

  • Plugin version: dev

Macro expansion not working as expected

Describe the bug

Macro expansion is not working correctly. I work on the z390 project (https://github.com/z390development/z390).
There is a register equate macro called EQUREGS and it provides the same function of the z/OS macro YREGS except dynamically.
When using this macro, the editor does not recognise the expanded register equates.

To Reproduce

Base assembly program - An IEFBR14 called hello.mlc

         CSECT
         EQUREGS       Use in place of YREGS
         BASR  R15,0
         USING *,R15
         BR   R14
         END

EQUREGS macro

        MACRO
        EQUREGS &REGS=GPR,&TYPE=DEC
        GBLB  &EQUREGS_GPR_DEC(16),&EQUREGS_GPR_HEX(16)
        GBLB  &EQUREGS_FPR_DEC(16),&EQUREGS_FPR_HEX(16)
        AIF    ('&REGS' EQ 'GPR')
               :&PFX SETC 'R'
        AELSE
               :&PFX SETC 'F'
        AEND
        LCLC   &HEX(16)
&HEX(1) SETC   '0','1','2','3','4','5','6','7',                        X
               '8','9','A','B','C','D','E','F'
        AIF   ('&SYSLIST(1)' NE '')
              MNOTE 12,'EQUREGS UNSUPPORTED OPERANDS - &SYSLIST(1)'
              MEXIT
        AEND
&I      SETA   0
        AWHILE (&I LT 16)
               AIF (NOT &(EQUREGS_&REGS._&TYPE)(&I+1))
                   :&(EQUREGS_&REGS._&TYPE)(&I+1) SETB 1
                   AIF ('&TYPE' EQ 'DEC')
                       :&PFX&I EQU &I
                   AELSE
                       :&PFX&HEX(&I+1) EQU &I
                   AEND
               AEND
               :&I SETA &I+1
        AEND
        MEND

Does not recognise R14 and R15 from EQUREGS macro

image

Expected behavior

Editor recognises the register equates - in this case the same as using YREGS
image

Screenshots
Used inline above

Platform

  • Editor: VS Code
    • Version: 1.62.1
    • Commit: f4af3cbf5a99787542e2a30fe1fd37cd644cc31f
    • Date: 2021-11-05T09:23:14.144Z
    • Electron: 13.5.2
    • Chrome: 91.0.4472.164
    • Node.js: 14.16.0
    • V8: 9.1.269.39-electron.0
  • OS: Darwin x64 20.6.0
  • Plugin version: v0.15.0

Additional context
N/A

Cache macro and copy files during editing

Describe the solution you'd like
Currently, when a file is changed, a program with all of its dependencies (macro and copy files) is reparsed. This may be a parsing bottleneck that increases the response time of the plugin.

It could be useful to parse only such dependencies that got actually changed.

Acceptance criteria

  • When user changes an opencode, only the opencode file is reparsed.
  • When user changes a macro or copy file, only the opencode file and the changed file are reparsed.

Label operand of macros passed as upper case

Describe the bug
When calling a macro, all operands should retain their case. However, in current version, label does not.

To Reproduce

      MACRO
&V    CASE
    
      AIF ('&V' EQ 'MixedCase').SKIP
      rubbish
.SKIP ANOP
      MEND
      
MixedCase CASE

The program should not yield an error

Screenshots
image

Platform

  • Editor: Any
  • OS: Any
  • Plugin version: 0.13.0

Refactor attribute lookahead

Is your feature request related to a problem? Please describe.
In the current implementation, the lookahead for attributes of undefined symbols is triggered during an CA expression evaluation. As the evaluation can happen at any place during parsing, the lookahead for attributes needs to stash current parsing context, trigger lookahead parsing and when finishes, pop the context back.

This puts complexity to a parsing flow of the plugin and potentially prohibits further extensions.

Describe the solution you'd like
Create a step between parsing and processing of a statement where the lookahead will be triggered when needed.

Specify compiler options

Is your feature request related to a problem? Please describe.

Many HLASM programs rely on flags and system variables that are specified by compiler options. (i.e., SYSPARM, MACROCASE, DBCS, ...).

Describe the solution you'd like

Find a way to provide user with the ability to specify compiler options.

Describe alternatives you've considered

In MF, the options for compiler are specified separately for each processor group.
We can provide the behavior by adding the system variables to each processor group in proc_grps.json.

Peak/goto macro definition from within a macro

The peak/goto definition feature for expanding macros is great. Is it possible to add a feature to expand a macro included in another macro?

I can't really give a screenshot example as my company blocks github, but we have alot of cases with macros within macros.

Extension README has errors in config file names

Describe the bug
In the section File Extensions in the extension README (and in Extension Marketplace), the config file name proc_conf.json is incorrect; it should be proc_grps.json instead.

To Reproduce
N/A

Expected behavior
proc_conf.json should not occur anywhere in the docs.

Screenshots
image

Platform

  • Plugin version: 0.13.0

Additional context
N/A

Code completion issue

The code completion list does not seem to take the initial @ symbol into consideration.

image

The list contains @obj but it is not sorted to the top.

Plugin version: 0.11.0

Arithmetic overflow not detected

Describe the bug
symbol_value and address arithmetic operations should detect overflow and report it.

To Reproduce

00000006 0000 0000 0000          00000000      3      BRASL 0,*+2147483646+2
** ASMA075E Arithmetic overflow                                             
** ASMA435I Record 3 in *** on volume:     

Highlighting not available in diff mode

Describe the bug
If you view changes to an HLASM source code before commit, only half of the screen (the uncommitted version) is highlighted.

To Reproduce
Steps to reproduce the behavior:

  1. Create a git repo
  2. Create a non-empty HLASM file, commit it.
  3. Make changes to the file.
  4. Use the vscode integrated diff viewer.

Expected behavior
Both the committed and the new version should be highlighted.

Platform

  • Editor: VS Code
  • Plugin version: 0.11.0

Processing of source should end after `END` instruction

Describe the bug
In HLASM, a program with two END instructions is valid, since the assembler ends processing after encountering the first END. However, that is not the case with this extension.

The problem is most visible when the DB2 preprocessor is enabled - two END instructions are processed by the preprocessor, generating the same symbols twice.

To Reproduce
Steps to reproduce the behavior:
Configure your processor group with the DB2 preprocessor, then type in the following:

   END
   END

32 errors apper, but there should be none.

Expected behavior
Processing should end after the first END.

Platform

  • Editor: Any
  • OS: Any
  • Plugin version: 0.13.0

HLASM structured macros (e.g. IF, ELSE, ENDIF) are not recognized.

The HLASM provides a suite of structured macros that apparently are not recognized or found through the HLA.SASMMAC1 & HLA.SASMMAC2 macro members, since they are not explicit members matching the names (IF, DO, etc).

To Reproduce
Steps to reproduce the behavior:

  1. Provide the members of HLA.SASMMAC1 & 2 in the proc_grps.json libs: directories.
  2. Use ASM source members that use the HLASM macro suite
  3. All structured macros are flagged in error.

Expected behavior
The structure logic macros should be recognized and not flagged in error.

Screenshots
Capture
Capture

Platform

  • OS: z/OS
  • Plugin version: 0.11.0

Additional context
Add any other context about the problem here.

Disable colorization of whitespace characters

Hello!

I work with enabled "editor.renderWhitespace": "all" option.
But the extention colorizes whitespace characters (see comment or next continuation line spaces):
image

Is there any way to avoid this?

Thank you!

JC instruction not found

Describe the bug
JC is not recognized as a valid HLASM instruction.

Additional context
It seems to have 2 parameters. The first is a register, the second is an address.

Support for SPM (Structured Programming Macros) in Syntax Highlighting

Is your feature request related to a problem? Please describe.
First of all, thank you guys for this wonderfull extention to VSCode! I was waiting for something like this since years! I am a z/OS systems programmer in germany and do write IBM assembler code since more than 30 years. One of the biggest problems people without a good understanding about assembler lanuguage are facing is the detection of control flow in assembler programs. IBM has tried to address this problem with SPM (Structured Programming Macros).

Describe the solution you'd like
I would like to see the syntax highlighting feature to automatically detect those macros and highlight them properly.

Describe alternatives you've considered
None ;-)

Additional context
Here is the link to the relevant IBM manual:
https://www.ibm.com/support/knowledgecenter/en/SSENW6_1.6.0/com.ibm.zos.v2r3.asmk200/ax3.htm

and a screenshot from VSCode:

image

Code page support

The syntax checker doesn't seem to recognise characters in the 1146 code page (UK English euro), for example the below code is fine (with $ symbol) but with a £ it flags a syntactical error.

Screenshot 2020-04-09 at 10 48 35

Theia tests are not working correctly

Describe the bug
It seems that under "normal" conditions theia never terminates and therefore the test script times out and fails.
However, when the test suite includes exactly 8 tests and they all pass, the mocha framework attempts to write out a summary message that causes the writeBuffer to crash the whole process and in that case and only in that case the test as a whole passes.

Typescript code coverage is not reported in SonarCloud

Describe the bug
Typescript code coverage detection fails for some reason.

INFO: Sensor JavaScript/TypeScript Coverage [javascript]
INFO: No LCOV files were found using clients/vscode-hlasmplugin/coverage/lcov.info
WARN: No coverage information will be saved because all LCOV files cannot be found.

Platform
CI - Github actions

HLASM highlighting activated for .txt files

Describe the bug
HLASM highlighting activated for .txt files

To Reproduce
Steps to reproduce the behavior:

  1. Install/Enable HLASM Language Support
  2. Open a .txt file

Expected behavior
HLASM highlighting activated, HLASM is marked as the file type in the bottom right hand corner

Screenshots
If applicable, add screenshots to help explain your problem.

Platform

  • Editor: VS Code/Theia (including version) - 1.55.2
  • OS: [e.g. iOS] (including distro) - Windows
  • Plugin version: [e.g. 0.10.0] - 0.12.0

Additional context

Remove ANLTR visitors from the code

Describe the solution you'd like
The current evaluation of conditional assembly expressions rely on ANTLR visitors. It is due to the fact that these expressions are stored as ANTLR ParsingRuleContext pointer.

However, this is not convenient because to preserve the validity of these pointers, we must not destroy ANTLR parser that created the pointers.

This restricts us in the further development of the plugin.

Acceptance criteria

  • Design and implement a new architecture for the CA expressions
  • Rewrite grammar rule actions to produce new architecture classes rather than ParsingRuleContext pointers
  • Refactor the source code that uses these pointers
  • Update wiki pages

EXRL instruction flagged as error by plugin

Hi guys,

have a look at the following code fragment:

*-B E G I N-----------------------------------------------------------*
*  Move command from CIB to internal buffer                           *
*---------------------------------------------------------------------*
             MVIY  CMDBUFF,C' '              Clear command buffer
             MVC   CMDBUFF+1(L'CMDBUFF-1),CMDBUFF
             LAY   R1,CMDBUFF                Load command pointer$02$06
             LAY   R2,CIBDATA                  Load A(MODIFY/F data). $06
             BCTR  R3,0                             Decrement it for MVC.
             EXRL  R3,MVCEX                    Changed to EXRL        $06
*-E N D---------------------------------------------------------------*
*  Move command from CIB to internal buffer                           *
*---------------------------------------------------------------------*
              .
              .
MVCEX  MVC   0(0,R1),0(R2)                 Move command to internal

The EXRL instruction above is perfectly valid. MVCEX is a label in code. EXRL is of format RIL-b and available since z10. MVCEX in the instruction is converted to the number of halfwords distance between the EXRL instruction address and the MVCEX label.
The plugin marks this instruction with the following error:

Error at EXRL instruction: operand must be an absolute immediate value"

This is wrong and should be fixed!

  • Editor: VS Code/Theia 1.45.1
  • OS: Windows 10 64-Bit
  • Plugin version: 0.11.0

greetings

Ronny

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.