-
Notifications
You must be signed in to change notification settings - Fork 22
Nano Highlighter initial implementation #29
Comments
I might have to use a negative look-ahead, but I'm a bit worried about performance as it will have to scan the text twice. |
|
Your syntax highlighter is awesome! |
Old opening: RegExp rules are not properly handled when the RegExp contains
Handle folding of Something is not right with Traditional Chinese locale: |
JFYI, I've just figured that Ace provides an easy conversion from TextMate language to Ace rules: The thing is that a lot of filters maintainers use external text editors (besides the filters editor inside of a blocker), and most of the popular text editors (Sublime, Atom, VS Code) support TextMate language extensions, so it might useful to use a TM language as the main source for the rules. I'm planning to experiment with this during the holidays, but anyway, I guess this might be useful to you if you decide to do the same. Here's a simple VS code language plugin: TM language file: It's rather simple (as I've just made it) and can only highlight classic elemhide rules: |
Filter rules are different than other programming language, it's not something you'd code 100 lines and test them together, I find myself code them in Nano's IDE, test them right away, then paste them into my filter list. Nano will validate and lint it right away with the existing filter parser, which can be a bit difficult to implement in Atom plugin. At first, I tried to make a plugin for Atom, but then I couldn't find the proper documentation. Maybe I was missing something... |
Take a look at all the languages VS code supports, some of them are very different from imperative languages we are used to:
I suppose, that validation and syntax highlighting are different types of tasks indeed. Every editor provides its own way for that. For instance, VS code does it via "language server" extensions. Some obvious mistakes can be highlighted using regular expressions, though. Regarding Atom, it also supports the TextMate theme conversion: |
Unless you guys have constructive comments, just don't post it. It's not getting anywhere. I can't change gorhill's decisions, no matter I agree with him or not. |
I don't mind civil discussions, but the discussion is getting not that civil and off topic from development of Nano. |
Added preprocessor highlighting: AdguardTeam/AdguardBrowserExtension#917 |
I'll leave this thread open for quick comments, but please report more complicated problems in new issues. |
Update: Initial implementation finished. Please open new issues for other problems.
The text was updated successfully, but these errors were encountered: