barrettotte / vscode-ibmi-languages

Syntax highlighting for IBM i languages such as RPG, CL, DDS, MI, and RPGLE fixed/free.
https://marketplace.visualstudio.com/items?itemName=barrettotte.ibmi-languages
MIT License
35 stars 14 forks source link

RPGLE Color coding #142

Closed NextPage66 closed 5 months ago

NextPage66 commented 5 months ago

I am using the most current version of Code for IBM i. We are still learning how to use this editor but all of our code was created and maintained in SEU. When we make changes in our source we will mark our initials in columns 1-5. We are starting to maintain source in Code for IBM i. I have noticed the color of the line typically changes to light grey when it is commented out and nothing is in columns 1-5. If there is anything in columns 1-5 and we comment the line out, it will turn to black(and possibly other colors for op-codes). Why doesn't it change to light grey like the others? Is there something special about columns 1-5 in the editor?

Sometimes there are large blocks of code that are light grey and they are not commented out. Looks like the standard color for source is green. But sometimes commented lines will also stay green. I am confused on this coloring and it is hard to read. CL source seems to be ok. DSPF source seem to be ok. But SQLRPGLE has colors i do not understand what is going on.

I have tried different themes. Currently using Quiet Light Theme. Is there a menu option that describes formatting rules? Is there a special rule for columns 1-5?

I will post screen shots and some text.

Thanks for any help.

NextPage66 commented 5 months ago

colors-5 colors-4 colors-3 colors-2 colors-1

NextPage66 commented 5 months ago

Example text for screen shot #3 above: D ZKYDS E DS EXTNAME(ZKY) D D INFDS FOR CURSOR LOCATION D* D DSPFDS DS D SFLRRN 378 379B 0

BEG>/ ------------------ Informational Data Structure Fields Added ----- #COM(05) 3 INFM :D X1DISPLAY 01 08 INF(1) 4 SSAW :D X1FORMAT 38 45 INF(2) 5 SSAW :D X1ALTDSP 83 90 INF(6) 6 SSAW :D X1ALTFMT 261 270 INF(7) 7 SSAW :D X1STACTN 369 369 INF(3) 8 SSAW :D X1STCSRP 370 371 INF(4) 9 SSAW :D X1STWINC 382 383B 0 INF(9) 10 SSAW :D X1RCDNBR 378 379B00 INF(8) 11 SSAW END>* -------------------------------------------------------- End ----- #COM(03) 12 INFM D D WORK DATA STRUCTURE FOR CURSOR D D @DS001 DS D HALFWD 1 2B 0 D BYTE2 2 2 D D DISPLAY ATTRIBUTE STRUCTURE D* D @DS002 DS D FLDSCR 1 10 D FLDNAM 11 20 D FLDINX 21 24 0 D DSPERR 25 25 D #DS 26 26 D #HI 27 27 D #RI 28 28 D #UL 29 29 D #BL 30 30

barrettotte commented 5 months ago

Ah this was some tricky regex to get the "gutter" columns working originally. I thought I had it worked out, but I'll figure out how to fix this. Also, thanks for the well explained examples!

NextPage66 commented 5 months ago

I am sure there is some great code to get this working. It works fantastic on most everything. Is there a way to allow color choices to be personalized?...maybe a future release…..:)

From: Barrett Otte @.> Sent: Sunday, August 4, 2024 3:54 PM To: barrettotte/vscode-ibmi-languages @.> Cc: Duane Sanders @.>; Author @.> Subject: Re: [barrettotte/vscode-ibmi-languages] RPGLE Color coding (Issue #142)

Ah this was some tricky regex to get the "gutter" columns working originally. I thought I had it worked out, but I'll figure out how to fix this. Also, thanks for the well explained examples!

— Reply to this email directly, view it on GitHubhttps://github.com/barrettotte/vscode-ibmi-languages/issues/142#issuecomment-2267665374, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BEV6P7P4G3H5LBCHLFTOY7DZP2IF3AVCNFSM6AAAAABL2THN5CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRXGY3DKMZXGQ. You are receiving this because you authored the thread.Message ID: @.***>

Notice: This email and any files transmitted within it may contain privileged, confidential, and or proprietary information intended solely for the use of the individual or entity to whom they are addressed. To prevent the disclosure of sensitive information this message should be treated with the appropriate level of security. If you are not the intended recipient or person responsible for delivering it to the intended recipient, please notify the sender via email and delete the original message immediately. You are hereby advised that any disclosure, copying or distribution of the contents of this information is prohibited. Aromatique accepts no liability for any loss or damage resulting from the transmission of this email. Thank you.

chrjorgensen commented 5 months ago

@NextPage66 The colours are determined by your VS Code colour theme, so you could try switching to another theme.

barrettotte commented 5 months ago

@NextPage66 I noticed that in screenshots 4 and 5 there seems to be some characters with bad encoding (the little question mark block), that would explain why syntax gets messed up in those examples. You may need to dig into documentation for https://github.com/codefori/vscode-ibmi at https://codefori.github.io/docs/#/

For screenshots 1-3, I could not recreate the syntax highlighting error you encountered. Can you confirm that you are on the latest version of this extension and see if the following code block still has errors in your VS Code instance.

Note: you may have to explicitly save this snippet as something like test.rpgle to easily activate the syntax highlighting for this file.

**********************************************************************
      * SCREENSHOT 1 SNIPPET
**********************************************************************

     F*         ALSO USED TO GET UPS ROUTING CODE ('RT' IN @TERM)
MMSCAF*
MMSCAF*         ALSO USED TO GET HUNDRED-WEIGHT CHARGE:
MMSCAF*            SPECIAL PARMS: @TQTY   = TOTAL # OF PACKAGES
MMSCAF*                           @WEIGHT = TOTAL WEIGHT
MMSCAF*                           @HIGH   = 999.999
MMSCAF*            IF DOESN'T QUALIFY FOR HUNDRED-WEIGHT,
MMSCAF*               RETURNS ZEROS IN @FRTCH.
     F*
MMSCAF* CALLED FROM BPCUSR:

**********************************************************************
      * SCREENSHOT 2 SNIPPET
**********************************************************************

     C*************
     C    A0DECLARE BEGSR
     C* MR0074906D
     C*/EXEC SQL
     C*+    DECLARE I1 CURSOR FOR SELECT CCUST,
     C*+        CASE WHEN CECNAM IS NULL OR CHAR(CECNAM) = ' '

**********************************************************************
      * SCREENSHOT 3 SNIPPET
**********************************************************************

     D ZKYDS         E DS                  EXTNAME(ZKY)
     D*
     D* INFDS FOR CURSOR LOCATION
     D*
     D DSPFDS          DS
     D  SFLRRN               378    379B 0
>BEG>/*  ------------------  Informational Data Structure Fields Added  -----  *#COM(05) 3      INFM
    :D  X1DISPLAY             01     08                                         INF(1)   4      SSAW
    :D  X1FORMAT              38     45                                         INF(2)   5      SSAW
    :D  X1ALTDSP              83     90                                         INF(6)   6      SSAW
    :D  X1ALTFMT             261    270                                         INF(7)   7      SSAW
    :D  X1STACTN             369    369                                         INF(3)   8      SSAW
    :D  X1STCSRP             370    371                                         INF(4)   9      SSAW
    :D  X1STWINC             382    383B 0                                      INF(9)   10     SSAW
    :D  X1RCDNBR             378    379B00                                      INF(8)   11     SSAW
>END>\*  --------------------------------------------------------  End  -----  *#COM(03) 12     INFM
     D*
     D* WORK DATA STRUCTURE FOR CURSOR
     D*
     D @DS001          DS
     D  HALFWD                 1      2B 0
     D  BYTE2                  2      2
     D*
     D* DISPLAY ATTRIBUTE STRUCTURE
     D*
     D @DS002          DS
     D  FLDSCR                 1     10
     D  FLDNAM                11     20
     D  FLDINX                21     24  0
     D  DSPERR                25     25
     D  #DS                   26     26
     D  #HI                   27     27
     D  #RI                   28     28
     D  #UL                   29     29
     D  #BL                   30     30

**********************************************************************
      * SCREENSHOT 4 SNIPPET
**********************************************************************

     D*
     D* MERGED DATA STRUCTURE FOR UPS LABELS
     D UPSMDR        E DS                  EXTNAME(UPSMD)
PHS4?D* MERGED DATA STRUCTURE FOR UCC LABELS
PHS4 D UCCLABRC      E DS                  EXTNAME(UCCLABF)
PHS4 D                                     INZ
    ?D* MERGED DATA STRUCTURE FOR FEDEX LABELS
     D FDXMDR        E DS                  EXTNAME(FEDEXMDN)
     D*

**********************************************************************
      * SCREENSHOT 5 SNIPPET
**********************************************************************
PHS1 F*?PHS1 ...

I got the following results with Monokai theme:

image

image

image

NextPage66 commented 5 months ago

Thanks for the responses. The little question marks are from the color coding we have done inside the SEU.
I found another comment somewhere on the VSCODE modes and encoding at the bottom of the UI. It seems that I was opening RPGLE source but the mode was configured for "RPG". I changed it to "RPGLE" and everything is great. It also seems to ignore the color coding from the SEU which is good.

See image. vscode mode

Thanks for the reminder on themes: I am liking the Monokai and GitHub Colorblind themes.

barrettotte commented 5 months ago

@NextPage66 Oh yeah I forgot about the SEU coloring, its been a while lol. Thanks for re-checking this.

I'll close this issue out, but feel free to submit future issues if you notice any weird highlighting problems