SpartanJ / ecode

Lightweight multi-platform code editor designed for modern hardware with a focus on responsiveness and performance.
MIT License
911 stars 13 forks source link

FR: Update CMake lexer to support more keywords #205

Open ghost opened 5 months ago

ghost commented 5 months ago

For example, keywords like COMMENT and VERBATIM are currently not highlighted:

https://github.com/AdeptLanguage/Adept/blob/master/CMakeLists.txt

SpartanJ commented 5 months ago

Maybe you can give me a hand with this one? You already know how to do it =)

ghost commented 5 months ago

Maybe you can give me a hand with this one? You already know how to do it =)

Where can I get a full list of CMake keywords? I can only add the keywords I found that are not properly highlighted when I read people's CMakeLists.txt.

Update: I can't help. Your addCMake() is a mess. How do you tell if a keyword is of type literal, keyword1, or keyword2? I really don't know!

SpartanJ commented 5 months ago

 Update: I can't help. Your addCMake() is a mess. How do you tell if a keyword is of type literal, keyword1, or keyword2? I really don't know!

😆 keywords use "keyword2", literals use "literal" and operators use "operator" haha sorry but that's all the logic behind. But yeah, don't worry, we can get the list from other editors, as always. As far as I saw in this comment, CMake has a ridiculous number of keywords, we can add them with some patience.

ghost commented 5 months ago

Update: I can't help. Your addCMake() is a mess. How do you tell if a keyword is of type literal, keyword1, or keyword2? I really don't know!

😆 keywords use "keyword2", literals use "literal" and operators use "operator" haha sorry but that's all the logic behind. But yeah, don't worry, we can get the list from other editors, as always. As far as I saw in this comment, CMake has a ridiculous number of keywords, we can add them with some patience.

By what logic do you have APPEND as literal? I really don't understand!

There are a lot of cases like that. For example, COMMAND is also literal. Yes, I know you do that to make it correctly highlight CMake. But I don't get the logic behind it. This is the reason why I don't think I can help.

SpartanJ commented 5 months ago

If you want to collaborate you are free to change all that logic, I really don't care if it looks good, so feel free to change it! I really don't remember where I took the list. Scintillua looks pretty complete. I might do it myself.

ghost commented 5 months ago

I might do it myself.

Please help me this time. Thank you.