-
Had to write a eC antlr grammar, and then parse it to get all symbols. Also works if it has a Java parser.
-
Just note that you are referring to syntax highlighting. In this case, a codemirror language mode is necessary. Unfortunately eC is not in its supported language list yet:
-
Thank you very much @robin . We will try to contribute support for eC in Code Mirror. eC is a superset of C, with a few extra keywords.
I think we can add it to the C-Like mode.
Just enabling C-style syntax highlighting for .ec and .eh files would already be a big improvement.
See also:
- full set of keywords (in addition to those from C) for eC in the syntax highlighter within our own IDE code editor:
- "class", "private", "public", "property","import", "delete", "new", "new0", "renew", "renew0", "define", "get", "set", "remote", "dllexport", "dllimport", "stdcall", "subclass", "__on_register_module", "namespace", "using", "typed_object", "any_object", "incref", "register", "watch", "stopwatching", "firewatchers", "watchable", "class_designer", "class_fixed", "class_no_expansion", "isset", "class_default_property", "property_category", "class_data", "class_property", "virtual", "thisclass", "dbtable", "dbindex", "database_open", "dbfield"
- additional types: "uint", "uint32", "uint16", "uint64", "bool", "byte", "int64", "uintptr", "intptr", "intsize", "uintsize","unichar",
- highlighted identifiers: "this", "true", "false", "null", "value"
- rail-road grammar
- grammar summary
- Bison grammar in eC compiler (with extra rules for error tolerance), and Flex lexer
- Hand-written Recursive Descent parser (written in eC)
- Pygments lexer for eC
- Linguist TextMate bundle for eC
- full set of keywords (in addition to those from C) for eC in the syntax highlighter within our own IDE code editor:
-
As long as eC support is in CodeMirror, I will upgrade to take the chagne. As to symbol navigation which requires to parse eC source, a pure-java approach will be preferred to avoid creating multiple processes to increase memory foot print and sacrifying cross-platform nature of JVM.
-
I have this patch here that enhances the C-like mode to support eC:
https://github.com/jerstlouis/codemirror5/commit/9621f326027face2ec175225130e2d0811e87a60
However, they explicitly state that they don't accept Pull Requests for new modes, but instead suggest to create stand-alone npm packages for them, and point to the Elixir mode as an example. Not sure what the best way to go about it would be.
-
This is great. I will add this mode separately into OneDev.
-
Or you may submit a pull request here to add mode directly in OneDev:
-
@robin Thanks a lot, how can I do a Pull Request on OneDev itself? Do I need to be given access? I can't push new branches.
-
You may fork the repository, and then submit pull request there.

Thanks for your help on this!
-
https://code.onedev.io/projects/599/pulls/51
EDIT: Figured out the mapping is done in mode/meta.js
Thank you very much @robin ! We are already so happy with OneDev, but eC highlighting will be the cherry on top! :)
-
OneDev
changed state to 'Closed' 3 years ago
Previous Value Current Value Open
Closed
-
OneDev
changed state to 'Released' 3 years ago
Previous Value Current Value Closed
Released
-
State changed as build #3112 is successful
| Type |
Question
|
| Priority |
Minor
|
| Assignee |
How can we add support for a particular programming language?
Our codebase is in eC which is supported by Linguist and pygments, including on GitHub.
Thank you.