fxbois / web-mode

web template editing mode for emacs
https://web-mode.org
GNU General Public License v3.0
1.64k stars 260 forks source link

Syntax highlighting extremely barebones #1314

Open tjohnman opened 1 month ago

tjohnman commented 1 month ago

I'm experiencing extremely lacking syntax highlighting in JS and PHP (HTML and CSS are not as noticeable). As you can see in the attached image, which is a plain .js file, there are a lot of elements using the default face. Of all of them, only strings and variable names (only when being declared) show using a different face (web-mode-javascript-string-face and web-mode-variable-name-face). All the rest is default-face. Including numbers, accessed properties, operators, parentheses, and brackets. This is using no customization or special loading (simply require the package and add-to-list 'auto-mode-alist it). It happens with about five different themes I tested (both default ones and third-party).

Screenshot_2024-09-23_14-48-57

fxbois commented 1 month ago

I would say that web-mode is not suited for plain JS. You have many better modes for that (especially nowadays with tree-sitter). As I do not really "parse" the code, I'll never be able to offer better fontification. Web-mode is really suited for HTML embedding small blocks of heterogeneous code.