pangloss / vim-javascript

Vastly improved Javascript indentation and syntax support in Vim.
http://www.vim.org/scripts/script.php?script_id=4452
3.79k stars 358 forks source link

require( is not highlighted #639

Closed dbellavista closed 7 years ago

dbellavista commented 8 years ago
// test.js
const test = require("test");

By using this utility: http://vim.wikia.com/wiki/Identify_the_syntax_highlighting_group_used_at_the_cursor

The High group of require is:

hi<jsFuncCall> trans<jsFuncCall> lo<jsFuncCall> instead of jsGlobalNodeObjects

bounceme commented 8 years ago

https://github.com/pangloss/vim-javascript/issues/410

dbellavista commented 8 years ago

Thanks, but just in case, the purpose of this instruction:

syntax match   jsGlobalNodeObjects  /require/ contains=jsFuncCall

(https://github.com/pangloss/vim-javascript/blob/master/syntax/javascript.vim#L118)

Wasn't to set the require( as a jsGlobalNodeObjects ?

bounceme commented 8 years ago

@amadeus , any thoughts?

amadeus commented 8 years ago

Fixed in develop

danielepiccone commented 7 years ago

It might be related to this, but I get this situation whenever I call a function that contains require in the name.

screenshot from 2016-10-31 09-36-20

bounceme commented 7 years ago

should be a word boundary in the regex, thanks !

danielepiccone commented 7 years ago

Since require is part of global objects https://nodejs.org/api/globals.html shouldn't this be declared here instead?

https://github.com/pangloss/vim-javascript/blob/997c2b12f5fffedd3a787b8840dfe710b2e6d3f9/syntax/javascript.vim#L116

amadeus commented 7 years ago

Fixed!