larshp / vscode-abap

ABAP syntax highlighting for Visual Studio Code

Home Page:https://marketplace.visualstudio.com/items?itemName=larshp.vscode-abap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syntax highlighting seems broken

Chris2011 opened this issue · comments

I'm adding basic syntax highlighting for ABAP via your textmate lexer to Apache NetBeans. I figured out a problem with this example https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abengame_2048_abexa.htm. It seems that the ending of a string is not correct, or maybe the example is wrong? The screenshot shows how it looks like. You can also test it in VS Code. It is the same problem.

image

As you an see at line 77 until the end, everything seems to be inside of the string. Sometimes inside of the string, not everything is captured as a string, but most of it. So I think this is not correct. If yes, please correct me :)

yea, its a bug in syntax highlighting

pull requests welcome

I'm planning to add https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide via the abaplint extension sometime

despite some improvements to interpolated strings this is still broken

header = REDUCE string( ##NO_TEXT
      LET  w = 360 / n IN
      INIT h =
        `<html><head><style type="text/css">` &
        `.t0{background-color:#cbbdb0}` &
        `td{border:1px solid bbada0;color:#776e65` &
        `;text-align:center;vertical-align:center` &
        `;font-family:'Century Gothic',sans-serif;font-weight:bold` &&
        |;width:{ w }px;height:{ w }px;font-size:{ w / 2 }px\}|
      FOR i = 1 UNTIL i > 11
      NEXT h =
        |{ h }.t{ ipow( base = 2 exp = i ) }\{| &
        |background-color:#{ segment( val   = tile_colors
                                      index = i ) }| &
        |{ COND #( WHEN i >= 3  THEN `;color:#f9f6f2` ) }| &
        |{ COND #( WHEN i >= 10 THEN |;font-size:{ w / 4 }px|
                   WHEN i >= 7  THEN |;font-size:{ w / 3 }px| ) }\}| ).
    header = header &&  `div{text-align:center}</style><script type="text/javascript">` &
     `function okd(e)` &
     `{c=window.event.keyCode;window.location='sapevent:'+c;}` &
     `document.onkeydown = okd;</script></head> <body scroll=no ` &
     `style="background-color:#bbada0;color:white;font-size:20pt">`.
    SET HANDLER at_click.