Code Monkey home page Code Monkey logo

barrettotte / vscode-ibmi-languages Goto Github PK

View Code? Open in Web Editor NEW
33.0 14.0 11.0 1.28 MB

Syntax highlighting for IBM i languages such as RPG, CL, DDS, MI, and RPGLE fixed/free.

Home Page: https://marketplace.visualstudio.com/items?itemName=barrettotte.ibmi-languages

License: MIT License

JSON 78.88% RPGLE 21.12%
ibmi vscode rpg rpgle cl dds syntax-highlighting vscode-extension language-extensions rpgle-free control-language ile-rpg as400 iseries

vscode-ibmi-languages's Introduction

vscode-ibmi-languages

Syntax highlighting for IBMi languages such as RPG, CL, DDS, MI, and RPGLE fixed/free.

Please consider downloading code-for-ibmi to edit RPG, RPGLE, and CL directly in VS Code!

There's probably a few syntax bugs. Please submit a pull request or issue if you see something amiss.

Contributors

Features

  • Syntax highlighting for RPG III and RPG/400 - H,F,E,L,I,C,O specs
  • Syntax highlighting for Control Language (CL)
  • Syntax highlighting for Command Definition (CMD)
  • Syntax highlighting for UIM Panel Group (PNLGRP)
  • Syntax highlighting for DDS files - physical, logical, display, printer, and ICF
  • Syntax highlighting for Machine Interface (MI)
  • Syntax highlighting for RPGLE fixed - H,F,D,I,C,O,P specs
  • Syntax highlighting for RPGLE free
  • Syntax highlighting for embedded SQL in SQLRPG and SQLRPGLE
  • Support for a mix of RPGLE free and fixed format
  • Support for binder language
  • Support for DB2 SQL keywords in embedded SQL

Last updated to Fall 2023 PTF enhancements for 7.5 and 7.4

File Types (case insensitive)

For each source type, I lumped legacy (system/38) source types together with the regular source types.

Extension(s) Description
.cl, .clp, .clp38 .clle Control Language (CL)
.cmd Command Definition (CMD)
.pnlgrp UIM Panel Group (PNLGRP)
.dspf, .dspf38 DDS Display file
.icff DDS ICF file
.lf, .lf38 DDS Logical file
.pf, .pf38, .dds DDS Physical file
.prtf, .prtf38 DDS Printer file
.rpg, .rpg38, .sqlrpg RPG/400
.rpgle, .sqlrpgle RPGLE and SQLRPGLE
.bnd Binder Language
.mi Machine Interface (MI)

Screenshots

See screenshots/ for more examples of syntax highlighting.

RPG/400

RPG/400

RPGLE Fixed Format

RPGLE Fixed

RPGLE Free Format

RPGLE Free

RPGLE Free with Embedded SQL

SQLRPGLE

Control Language (CL)

CL

Command (CMD)

CL

UIM Panel Group (PNLGRP)

CL

Data Description Specification - Physical File (DDS)

PF

Machine Interface (MI)

MI

Publishing

VS Code Marketplace

  • npm install -g vsce
  • vsce package
  • vsce publish -p VSCE_SECRET

OpenVSX

This extension is also deployed to Open VSX

  • npx ovsx publish -p OPEN_VSX_SECRET

Changelog

See CHANGELOG.md

Known Bugs / Future Improvements

See issues.

Featured In

References

vscode-ibmi-languages's People

Contributors

barrettotte avatar chrjorgensen avatar gajenderi avatar lildude avatar worksofliam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-ibmi-languages's Issues

RPGLE hex literals messed up

    fptr = fopen(fpath: fmode);
    line = fgets(%addr(buffer): %size(buffer): fptr);

    dow (line <> *NULL);
      buffer = %xlate(x'00250D' : '   ': buffer); // CR,LF,NULL
    enddo;

image

RPG compile time arrays

**     TABER# / TABERD
1Text Text Text Text.
2Text Text Text Text Text Text Text Text Text Text.
3Text Text Text Text Text Text Text Text.
4
5
6
7
8

image

Unable to install for 1.38.1

Hi

I am not able to install the plugin, saying it is not compatible with the current version of vs code 1.38.1.

Btw, once I got the plugin installed, how to connect to back end? Thanks.

Outline the source

Hi Barrett,
I am wondering whether is possible to outline procedures' names and other stuff in the OUTLINE panel. I think it will be very helpful.
What do you think about it?

RPG, RPGLE, and DDS gutters

This is something I was painfully unaware of...gutters

RPG

OHMANC                     MOVEL'HELLO'   HELLO  11      
     C                     MOVE 'WORLD'   HELLO          
     C           HELLO     DSPLY          WAIT    1      
     C                     SETON                     LR  

image

RPGLE (mixed fix/free)

YIKESH/TITLE Messing around with fixed and free format              
     H*                                                             
OH NO   ctl-opt option(*srcstmt:*noDebugIO:*nounref) dftActGrp(*no);
     D*                                                             
     DCvtScore         S             10A                            

image

RPG fixed format

  • Incorrect color of D-section
  • Incorrect color of '' character. This is backslash character.
    image

H/ breaks syntax highlighting in RPGLE

Something that was changed recently with precompiler regex has broken all highlighting if something like this is in the file...

     H/TITLE Call Menu                 Execute external functio
     H DATFMT(*YMD) DATEDIT(*YMD) DEBUG(*YES)

Adjust identifier regex for '#'

Add '#' to identifier regex. Should apply to all languages

     A N79N31                               DSPATR(UL)
     A N31                                  DSPATR(HI)
     A N25                                  OVRATR
      * Lock status
     A                                  8  4'Lock Status:'

image

RPGLE/RPG: Gutter breaks highlighting, causes CT Array highlighting

Related to #52 .
The gutter on line 58 gets recognized as a ct array.

So, definitely need to change the ct array regex.

     C           UTIME     IFEQ 0                          FIRST RECORD
     C                     TIME           UTIME   60       GET TIME
     C                     MOVEL'XXXXXX'  PGM    10
     C                     Z-ADD1         RUNNBR  50
*****C*********            CALL 'XXXXXX'
*****C*********            PARM           PGM
*****C*********            PARM           RUNNBR
     C                     EXCPTHEADR
     C                     END
      *

image

Embedded SQL identifier '#'

slightly adjust regex to match RPGLE identifiers defined everywhere else, probably just missed a copy/paste at some point

image

RPG/400 C spec comment error

C Spec, EQ field extends to comment space if comment starts with numeric.

Suggested: regex for numeric literal highlighting to not extend past column 60

     C           PCVKEY    SETLLCP1107C                  8585=1 <==> FD

Highlights *on, *off, etc?

Planning the highlight *on, *off, *loval, *hival, *start, *zero, *zeros, *blank, *blanks, *lock, etc?

Reaching out phisycal source files in the system

Hi,
I really appreciate your work, because I would like to edit IBM i sources from VSC, so I am sorry to ask a question that may be silly, but I can't answer it on my own.
I would like to edit sources which are not in the IFS, but in IBM I operating system.
I tried to open such a mapped folder:
\myip\root\QSYS.LIB\MYLIB.LIB\QILESRC.FILE
and it works, meaning I can see the list of all source members inside it.
But when I open a single member to edit it, it is not translated into the correct code page, so all I see is a long list of useless characters.
How do you reach the IBM system through VSC?
Is there a different way to reach out source files in a library?
Thank you

RPGLE free precompiler not highlighting

Not highlighted when past column 5.
Just adjust regex from \s{0,5} to \s*

      * prototypes for xml procedure/function calls
      /copy cgidev2/qrpglesrc,prototypeb
      /copy qsysinc/qrpglesrc,QUSEC

Suggestions on how compile time arrays should be handled?

I'm decently content with compile time arrays just being a clump of data at the bottom of the program with non-sense highlighting. But, if someone has any suggestions for how they should be highlighted please let me know and I could give it a shot

Incorrect handling/color-coding of variables and labels with dash (-)

I tested your VS Code extension on an MI source

Dash (-) inside a variable or label is not interpreted correctly, but seems to be considered as a minus operation
e.g. MOVE-USAGE:
CPYBLA IO-SRCLIB,OIR-SRCLIB

Slash (/) in CMP* MI operations seems to be considered as a divide operation
e.g. CMPBLA(B) LIBNAM,'QTEMP '/EQ(TEMPLIB)

RPGLE I spec small highlighting problem

Small highlighting issue, the numbers next to 'C' should be highlighted constants as well

      *  xxx
     IXYZ123    AC  40   62 C4
      *                        a
     I         OR   41   62 C5
      *                        b
     I         OR   42   62 C6
      *                        c
     I         OR   43   62 C7
      *                        d
     I         OR   44   62 C8
      *                        e

image

RPGLE Free definition keywords false highlighting

In the example below, pos and time are being highlighted as keywords.

Suggested: Adjust keyword regex to only handle (DCL-(C|S|PARM|PROC) and make separate regex set for "complex" such as (DCL-(DS|PI|PR)).

NOTE: nested data structures are going to be...interesting...

         read  file; 
         dow not %eof(file); 
             if %error;
                 dsply 'The read failed';
                 leave;
             else;
                 chain(n) name database data;
                 time = hours * num_employees
                          + overtime_saved;
                 pos = %scan (',': name);
                 name = %xlate(upper:lower:name);
                 exsr handle_record;
                 read file;
             endif;
         enddo;

No highlighting for fixed format embedded SQL in RPGLE

     C* Embedded SQL fixed form
     C/EXEC SQL
     C+     DECLARE MYCSR     CURSOR FOR
     C+       SELECT * FROM SOMETABLE
     C+           WHERE (COLUMNA = :COLUMNA
     C+           AND    COLUMNB = :COLUMNB
     C+                 )
     C+       ORDER BY  COLUMNA ASC,
     C+                 COLUMNB ASC
     C/END-EXEC
     C*
     C/EXEC SQL
     C+   OPEN MYCSR
     C/END-EXEC
     C*
     C                   IF        SQLCOD = -502
     C/EXEC SQL
     C+   CLOSE MYCSR
     C/END-EXEC
     C                   ELSE
     C                   IF        SQLCOD < 0
     C                   EXSR      MYSUBR
     C                   ENDIF
     C                   ENDIF

image

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.