mooz / js-doc

Insert JsDoc style comment easily in Emacs
60 stars 19 forks source link

syntax highlighting #10

Open axyz opened 8 years ago

axyz commented 8 years ago

would be great to add some font-lock configuration to have syntax highlight inside jsdoc comments.

Keywords are already known and listed on variables and should not be hard to get regexps from them, the only possible tricky part would be to only apply font-lock o element inside jsdoc comments /* / as it is going to be used as a minor mode and should not affect other fonts.

Also may need some work coloring arguments or similar stuff that is not a keyword but live in some specific positions, but for a first implementation also simple keyword highlighting would be a really good starting point.

I do not have experience in this field, but I guess some logic may be extracted from js2-mode however it can't be a full copy-paste as I think on js2-mode they are not using font-lock but their specific syntax highlighting engine

wyuenho commented 6 years ago

If you use js2-mode, it's already highlighted. Adding font-lock config to js-doc mode will conflict with js2-mode's. It's probably a better idea to add to js-mode instead.