You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a few cases where comments do not highlight correctly. I'm not familiar enough with Vim syntax highlighting to really understand what's going on, but I was able to get my files highlighting with a couple small changes.
Inside arrays
leta=[1,2,// testing3,/* test */4];
Inside nested object literals where one of the values involves a function call with more than one dot. I found this when using React.PropTypes.shape({ ... }).
leta={b: a.b.c({key: "value"// test})};
(Changing a.b.c to a.b makes this example work.)
Inside the argument list to functions
Math.floor(1,2,/* test */3);Math.fllor(1,2,// test3);
I was able to fix 1. and 2. with the following changes, though I don't know if they're the correct changes:
diff --git a/syntax/javascript.vim b/syntax/javascript.vim
index ce42d24..a10628e 100644
--- a/syntax/javascript.vim+++ b/syntax/javascript.vim@@ -131,7 +131,7 @@ syntax match javascriptTemplateSStringRB /}/ contained
syntax region javascriptString start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ nextgroup=@javascriptSymbols skipwhite skipempty
syntax region javascriptTemplate start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/ contains=javascriptTemplateSubstitution nextgroup=@javascriptSymbols skipwhite skipempty
" syntax match javascriptTemplateTag /\k\+/ nextgroup=javascriptTemplate
-syntax region javascriptArray matchgroup=javascriptBraces start=/\[/ end=/]/ contains=@javascriptValue,javascriptForComprehension nextgroup=@javascriptSymbols,@javascriptComments skipwhite skipempty+syntax region javascriptArray matchgroup=javascriptBraces start=/\[/ end=/]/ contains=@javascriptValue,javascriptForComprehension,@javascriptComments nextgroup=@javascriptSymbols,@javascriptComments skipwhite skipempty
syntax match javascriptNumber /\<0[bB][01]\+\>/ nextgroup=@javascriptSymbols skipwhite skipempty
syntax match javascriptNumber /\<0[oO][0-7]\+\>/ nextgroup=@javascriptSymbols skipwhite skipempty
@@ -249,7 +249,7 @@ syntax keyword javascriptExport export module
syntax region javascriptBlock matchgroup=javascriptBraces start=/\([\^:]\s\*\)\=\zs{/ end=/}/ contains=@htmlJavaScript
syntax region javascriptMethodDef contained start=/\(\(\(set\|get\)\_s\+\)\?\)[a-zA-Z_$]\k*\_s*(/ end=/)/ contains=javascriptMethodAccessor,javascriptMethodName,javascriptFuncArg nextgroup=javascriptBlock skipwhite keepend
-syntax region javascriptMethodArgs contained start=/(/ end=/)/ contains=javascriptFuncArg nextgroup=javascriptBlock skipwhite keepend+syntax region javascriptMethodArgs contained start=/(/ end=/)/ contains=javascriptFuncArg,@javascriptComments nextgroup=javascriptBlock skipwhite keepend
syntax keyword javascriptMethodAccessor contained get set
syntax match javascriptMethodName contained /[a-zA-Z_$]\k*/ nextgroup=javascriptMethodArgs skipwhite skipempty
syntax region javascriptMethodName contained matchgroup=javascriptPropertyName start=/\[/ end=/]/ contains=@javascriptValue nextgroup=javascriptMethodArgs skipwhite skipempty
The text was updated successfully, but these errors were encountered:
There are a few cases where comments do not highlight correctly. I'm not familiar enough with Vim syntax highlighting to really understand what's going on, but I was able to get my files highlighting with a couple small changes.
Inside arrays
Inside nested object literals where one of the values involves a function call with more than one dot. I found this when using
React.PropTypes.shape({ ... })
.(Changing
a.b.c
toa.b
makes this example work.)Inside the argument list to functions
I was able to fix 1. and 2. with the following changes, though I don't know if they're the correct changes:
The text was updated successfully, but these errors were encountered: