-
I realized how much ecode is relying on the language server to do correct syntax highlighting now. Without the language server, code like this will not be highlighted. But there are programming languages that don't have a language server. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
In which language? What's the context? What do you want to highlight from You can always add more rules to highlight whatever is needed. Over languages where semantic-highlighting is available I usually do not try to do much work highlighting things that the semantic-highlighter will cover, but in cases where this is not an option we just need to add more rules depending on the language. This particular case it depends on what you want to do because what pattern-matching highlighting won't give you is context-aware highlighting since we don't have the AST (for example highlighting user-defined types). So it might not be possible to highlight. Currently for most languages without semantic-highlighting I did not do an in depth pattern matching of everything, but it's possible to improve basically all definitions, I just don't focus on that because all languages that I use daily provide semantic-highlighting and the quality is really good. This is one of the things I would like collaboration, since I'm focused mostly on fixes and new features, my time is very limited so I try to work on things I do actually care. |
Beta Was this translation helpful? Give feedback.
-
I have been using this pattern with my custom
But I found a new problem. It can only color |
Beta Was this translation helpful? Give feedback.
Sorry but I don't follow this case, if the index is just a number you'll have the number highlighted, if the index is being acceded via a user-defined variable, you won't have enough context to highlight anything useful.
I'll leave a pattern for matching what you are asking but I'm not following:
{ { "%[([%a_][%w_]*)%]" }, { "operator", "keyword2", "keyword2" } }
Please try to dedicate some time in understanding pattern matching otherwise it isn't very useful if you implement new languages without understanding what you're actually doing, because you won't be able to solve any highlighting problem in the languages implemented, which is one of the things that can take time.