Skip to content

Missing language ABAP for PRISM #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mlaggner opened this issue Mar 24, 2025 · 2 comments
Open

Missing language ABAP for PRISM #5

mlaggner opened this issue Mar 24, 2025 · 2 comments

Comments

@mlaggner
Copy link

Describe the bug

As you see in https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD the underlying library supports ABAP (https://prismjs.com/#supported-languages), you did not include it into your enum for PRISM.

Could you please add this in the next version?

Expected behavior

Highlight ABAP code

Minimal reproducible example

You can use this code example for testing

 REPORT  z_ram_test_csv_to_itab_regex.
* this is a comment by ramtiwari.
* select '100' from something or just multiply to check that * does not comment

 a = 1 * 10.

DATA : g_input TYPE string.
DATA : l_tab TYPE c value cl_abap_char_utilities=>HORIZONTAL_TAB.
DATA : l_regex type string.

g_input = '"F1",F2,""Hello",  "How" are "you"","F3"'.

REPLACE ALL OCCURRENCES OF
  REGEX ',(?=(?:[^"]*$)|(?:[^"]*"[^"]*"[^"]*)*$)'
  IN g_input WITH l_tab.

REPLACE FIRST OCCURRENCE OF
  REGEX '^"'
  IN g_input WITH ' '.

CONCATENATE '"' l_tab '"|"' l_tab '|' l_tab '"' into l_regex.
REPLACE ALL OCCURRENCES OF
  REGEX l_regex                         "    '"l_tab"|"l_tab|l_tab"'
  IN g_input WITH l_tab.

REPLACE ALL OCCURRENCES OF '""' IN g_input
  WITH '"'.    "Added during testing

REPLACE ALL OCCURRENCES OF REGEX '"$' IN g_input
  WITH ' '.

WRITE :/ g_input.

Add-on Version

1.0.0

Vaadin Version

24.7.0

Additional information

No response

@github-project-automation github-project-automation bot moved this to Inbox (needs triage) in Flowing Code Addons Mar 25, 2025
@paodb paodb moved this from Inbox (needs triage) to To Do in Flowing Code Addons Mar 25, 2025
@javier-godoy javier-godoy self-assigned this Apr 10, 2025
@javier-godoy
Copy link
Member

Hello. I see that the enum is missing ABAP and ABNF, which is unintentional. A complete fix will require not only updating the enum, but also resolving the underlying issue discussed in #6.

@javier-godoy javier-godoy removed their assignment Apr 10, 2025
@mlaggner
Copy link
Author

Thanks for getting back to me. I see that there is a need to enhance refractor.

Meanwhile I managed to include prismjs directly into my Vaadin project, so I do not need this change any longer - but for completeness of your project I would keep this issue open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To Do
Development

No branches or pull requests

3 participants