You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TanStack Highlight should ship an isolated language definition for ABAP, with the fence name abap.
We render a large number of ABAP code blocks, and they currently fall back to plaintext. Shiki supports ABAP out of the box, and highlight.js supports it through the third-party highlightjs-sap-abap plugin. A built-in definition would let us use the normal selective registration path instead of maintaining our own tokenization logic.
I have an implementation ready on the existing pattern helpers, with a small linear scanner for comments and literals. It handles:
* comments in the first column versus multiplication, and " line comments
'…' and `…` literals with doubled delimiters
string templates |…{ expr }…|, where the { } holes are tokenized as code
case-insensitive and hyphenated keywords (CLASS-METHODS, START-OF-SELECTION)
field symbols <fs>, pragmas ##NEEDED, and class names before =>
component selectors (-, ->, =>, ~), which keep keyword-like names plain, for example ls_entry-type
Deliberate limits: a variable named like a keyword (value, length, key) is highlighted as a keyword outside those positions. highlight.js behaves the same way.
Size: Core + ABAP is 3.64 KB gzip. The all-language entry grows from 17.68 KB to 18.94 KB gzip, mostly because of the keyword list. Core and the existing selective profiles are unchanged. Tests, a size profile, a benchmark profile, a fixture, docs, and a changeset are included, and pnpm run verify passes.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
TanStack Highlight should ship an isolated language definition for ABAP, with the fence name
abap.We render a large number of ABAP code blocks, and they currently fall back to plaintext. Shiki supports ABAP out of the box, and highlight.js supports it through the third-party
highlightjs-sap-abapplugin. A built-in definition would let us use the normal selective registration path instead of maintaining our own tokenization logic.I have an implementation ready on the existing pattern helpers, with a small linear scanner for comments and literals. It handles:
*comments in the first column versus multiplication, and"line comments'…'and`…`literals with doubled delimiters|…{ expr }…|, where the{ }holes are tokenized as codeCLASS-METHODS,START-OF-SELECTION)<fs>, pragmas##NEEDED, and class names before=>-,->,=>,~), which keep keyword-like names plain, for examplels_entry-typeDeliberate limits: a variable named like a keyword (
value,length,key) is highlighted as a keyword outside those positions. highlight.js behaves the same way.Size: Core + ABAP is 3.64 KB gzip. The all-language entry grows from 17.68 KB to 18.94 KB gzip, mostly because of the keyword list. Core and the existing selective profiles are unchanged. Tests, a size profile, a benchmark profile, a fixture, docs, and a changeset are included, and
pnpm run verifypasses.All reactions