thefrontside/frontmacs

Syntax highlighting for comments in JS.

elrickvm opened this issue · 5 comments

When you have a multi line comment in JS opening it with /* works but if you have two asterisk it breaks /**. However i think it should still work.

Works:

/*
* some awesome multiline comment
* opening with one asterisks
*/

screen shot 2017-04-26 at 12 55 19 am

Does not work:

/**
* another sweet multiline comment
* opening with two asterisks
*/

screen shot 2017-04-26 at 12 54 53 am

Looks like it is actually working, but when you start a multiline comment with /** it starts a JSDoc comment block. For example, if you add some JSDoc tags, it will apply syntax highlighting to those.

screen shot 2017-04-26 at 9 43 51 am

It actually looks like the current frontmacs theme styles it like this on purpose as it defines both the font-lock-comment-face and font-lock-doc-face foregrounds as different colors.

Sweet find Wil...So essentially it will take some tweaking of those two variables font-lock-comment-face and font-lock-doc-face to tame the highlighting situation. :-).. I dont like it making my comment blocks green after i install a theme. I wonder if there is a way to make those stated variables be driven by the theme you have installed? Not sure if they do so already.

I think is mainly this is so that inline // comments appear differently than block comments. Isn't this kindo of a feature in that it reminds you to always add the second *?

In other words, a comment should either be inline or block, and the block style starts with /**

The theme usually handles setting those faces, but it could be that your theme doesn't. Search your theme's .el file for those faces to see if they're set.

If you don't like how it looks you could set the foreground color of that face to something you like better. Something like this should work in an initializer (and could also be a place you customize other faces):

(deftheme my-theme)
(custom-theme-set-faces
  'my-theme
  `(font-lock-doc-face ((t (:foreground "#aaaaaa")))))
(enable-theme 'my-theme)

Welp i think we can close this based on syntax highlighting preference per individual and it is something that can be customized. Awesome!