5 ms·
Will be great to have something like this in Emacs.
by fourier 12y ago
Will be great to have something like this in Emacs.
- Jeaye 12y agoAfter looking, I'm astonished that this doesn't exist in Emacs. There is a completion plugin using libclang; maybe the highlighting could just be added into it. On vim's side, YouCompleteMe explicitly denied my approach to integrate highlighting.
- captainmuon 12y agoI hacked together something to add at least #ifdef highlighting* to YouCompleteMe. It's not quite ready to share due to some bugs, but I'm planning to release it as a patch / friendly fork when I find some time. I believe there's no reason to have two plugins each running an instance of clang. * i.e. showing parts of code that are ifdef'ed out in grey
- lsiebert 12y agoit would be nice if it could hook into YCM's config file instead of needing a separate one, when available.
- Jeaye 12y agoYeah, that's something I considered from the start. The issue is that, in order for that to work reliably, color_coded would basically need an embedded Python interpreter. YCM's config file can contain arbitrary python functions and doesn't really need to follow any standards. This makes it hard on color_coded and ultimately didn't seem worth the trouble.
- 616c 12y agoUh, what? http://truongtx.me/2013/03/10/emacs-setting-up-perfect-environment-for-cc-programming/ http://truongtx.me/2013/03/10/emacs-setting-up-perfect-envir...
- Jeaye 12y agoI don't see real-time semantic highlighting using an embedded compiler there. Maybe I missed it.
- 616c 12y agoMy bad, I assumed it included highlighting, but it appears it is just auto-complete from Clang. https://github.com/brianjcj/auto-complete-clang https://github.com/brianjcj/auto-complete-clang That being said, if the core infrastructure is there, the hard part (Clang backend) is there, how much more can semantic highlighting be? (I duck because I write amateurish code and do not do C/C++ yet, but would hopefully learn to do something awesome like that one day.)
- davidshepherd7 12y agoHave you got a plain text version of the highlighted source examples somewhere? I want to compare it with emacs' default highlighting (I think default emacs highlights almost as much as the "After color_coded" screen shot).
- Jeaye 12y agoThe first picture is from the color_coded source itself: https://github.com/jeaye/color_coded/blob/master/include/async/queue.hpp#L30 https://github.com/jeaye/color_coded/blob/master/include/asy... The second picture is from my C++14 JSON library: https://github.com/jeaye/jeayeson/blob/master/include/jeayeson/value.hpp#L69 https://github.com/jeaye/jeayeson/blob/master/include/jeayes...
- davidshepherd7 12y agoThanks, for anyone curious here's what emacs does with the first example: http://imgur.com/Rddi9QH http://imgur.com/Rddi9QH compare with color_coded: https://camo.githubusercontent.com/5cf719c6357f27b86c45bf9b5461686c70e322ef/687474703a2f2f6a656179652e636f6d2f63632f7472696d6d65645f63635f745f7965735f332e706e67 https://camo.githubusercontent.com/5cf719c6357f27b86c45bf9b5... So it looks like color_coded can highlight at least a few things that default emacs doesn't: function calls, variables (when they are used, both can highlight declarations) and non-standard type template parameters.