From f5fef72b27d0cd5f7fa87d909c402332251f38ad Mon Sep 17 00:00:00 2001 From: Kidon Chu Date: Thu, 2 Mar 2017 10:48:11 -0600 Subject: [PATCH 1/2] Syntax highlighting console.log --- syntax/javascript.vim | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/syntax/javascript.vim b/syntax/javascript.vim index 1344e876..c8c940a4 100644 --- a/syntax/javascript.vim +++ b/syntax/javascript.vim @@ -117,11 +117,7 @@ syntax keyword jsAsyncKeyword async await syntax match jsSwitchColon contained /::\@!/ skipwhite skipempty nextgroup=jsSwitchBlock " Keywords -syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat fetch -syntax keyword jsGlobalNodeObjects module exports global process __dirname __filename -syntax match jsGlobalNodeObjects /\/ containedin=jsFuncCall -syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError -syntax keyword jsBuiltins decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval +syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math document window Intl Collator DateTimeFormat NumberFormat fetch " DISCUSS: How imporant is this, really? Perhaps it should be linked to an error because I assume the keywords are reserved? syntax keyword jsFutureKeys abstract enum int short boolean interface byte long char final native synchronized float package throws goto private transient implements protected volatile double public @@ -225,6 +221,9 @@ syntax region jsCommentRepeat contained start=/\/\*/ end=/\*\// contains=j syntax match jsDecorator /^\s*@/ nextgroup=jsDecoratorFunction syntax match jsDecoratorFunction contained /[a-zA-Z_][a-zA-Z0-9_.]*/ nextgroup=jsParenDecorator +" Debugging +syntax match jsConsoleLog /\vconsole\.log.*/ contains=jsGlobalObjects + if exists("javascript_plugin_jsdoc") runtime extras/jsdoc.vim " NGDoc requires JSDoc From 7984dbae8ba3387a94f587fa8e1d3628b283b16c Mon Sep 17 00:00:00 2001 From: Kidon Chu Date: Thu, 2 Mar 2017 10:51:29 -0600 Subject: [PATCH 2/2] Undo removing console from global obj --- syntax/javascript.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/javascript.vim b/syntax/javascript.vim index c8c940a4..54480b39 100644 --- a/syntax/javascript.vim +++ b/syntax/javascript.vim @@ -117,7 +117,7 @@ syntax keyword jsAsyncKeyword async await syntax match jsSwitchColon contained /::\@!/ skipwhite skipempty nextgroup=jsSwitchBlock " Keywords -syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math document window Intl Collator DateTimeFormat NumberFormat fetch +syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat fetch " DISCUSS: How imporant is this, really? Perhaps it should be linked to an error because I assume the keywords are reserved? syntax keyword jsFutureKeys abstract enum int short boolean interface byte long char final native synchronized float package throws goto private transient implements protected volatile double public