Rickard Johansson wrote: ↑31 Jul 2022 17:30
Unknown properties ("fnt-weight") has a different color than the standard properties by design. It's common in other editors as well...
Hey, no need to convince me of that
Of course it is very convenient, but my point is that its name (#Properties) is very vague; why not call it e.g. Unrecognized/Incorrect properties instead?
New css.syx works much better, thank you! However it still has some quirks, e.g.
Code: Select all
#id { this is OK: #_Id }
a#id { and this isn't: Text }
or
Code: Select all
h1 {
padding: 10px; /* padding is recognized as property */
padding-block-start: 10px; /* padding-block-start isn't, even though it was inserted via Ctrl-Space */
}
Perhaps there's a better solution to this problem. (Disclaimer: I don't know what I'm talking about.)
Some time ago I was about to suggest using themes that were prepared for different editors and can be
freely downloaded from the Internet; there are at least four types of these themes:
- Atom
- Sublime
- TextMate
- VS Code
Most of them are licensed with MIT License, which is very lenient, so there would be no need to open-source RJ TE. They are prepared for many languages. There are converters between them (not possible in every direction, though). Perhaps RJ TE could use (import) one of these types?
3 and 4 (possibly others, too) are based on TextMate grammar: set of regex rules. However, there is also another approach --
Tree-sitter:
Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited. Tree-sitter aims to be:
- General enough to parse any programming language
- Fast enough to parse on every keystroke in a text editor
- Robust enough to provide useful results even in the presence of syntax errors
- Dependency-free so that the runtime library (which is written in pure C) can be embedded in any application
Tree-sitter allows for semantic highlight (which I mentioned
here;
more examples). Sadly, there's no (at least official)
binding of Tree-sitter for Delphi, however there are JS and
WASM bindings, so maybe it is doable without writing own binding for Delphi?
Perhaps the same thing (semantic highlighting) can be obtained via LSP:
but I guess this requires running LSP for many languages that one uses; or just some, and another would work with current/TextMate regex-based rules.
So my point is, I guess, this: please consider using Tree-sitter/LSP for syntax and semantic highlighting. Please use foreign components as much as possible, so they can be quickly imported/updated/adapted to RJ TE -- by you or by other users.