microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.63k stars 29.04k forks source link

[javascript] Comment syntax within a string incorrectly interpreted as a comment #49448

Closed johnbillion closed 6 years ago

johnbillion commented 6 years ago

Issue Type: Bug

The following code within a JavaScript file is syntax highlighted incorrectly in VS Code. The /* within the 'admin/*.js' string is wrongly interpreted as an opening comment tag.

This is about the minimum code that I was able to replicate the issue with. The original issue was seen in a Grunt configuration file.

foo({
    files: (
        function () {
            var files = [];
            files.push( {
                src: [
                    'admin/*.js'
                ],
                dest: 'themes/foo/js'
            } );
            return files;
        }
    )()
});

Screenshot:

Note that all the code following the /* is treated as a comment.

VS Code version: Code 1.23.0 (7c7da59c2333a1306c41e6e7b68d7f0caa7b3d45, 2018-05-03T15:23:14.634Z) OS version: Darwin x64 16.7.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-6567U CPU @ 3.30GHz (4 x 3300)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|9, 10, 6| |Memory (System)|16.00GB (0.39GB free)| |Process Argv|/Applications/Code.app/Contents/MacOS/Electron .| |Screen Reader|no| |VM|0%|
Extensions (40) Extension|Author (truncated)|Version ---|---|--- erb|Cra|0.0.1 EditorConfig|Edi|0.12.1 beautify|Hoo|1.3.0 sort-lines|Tyr|1.6.1 project-manager|ale|0.25.2 scope-bar|amo|0.0.5 alignment|ann|0.3.0 vscode-puppet|bit|0.4.5 vscode-intelephense-client|bme|0.8.8 vscode-svgviewer|css|1.4.3 transformer|dak|1.6.0 jshint|dba|0.10.18 vscode-eslint|dba|1.4.8 vscode-dash|dee|1.10.0 gitlens|eam|8.2.4 tslint|eg2|1.0.28 vs-code-xml-format|fab|0.1.5 php-debug|fel|1.12.3 url-encode|fle|1.1.0 vscode-zoneinfo|gil|2.1.1 phpcs|ika|1.0.5 svn-scm|joh|1.29.0 vscode-map-preview|jum|0.4.2 restructuredtext|lex|65.0.0 VS-code-vagrantfile|mar|0.0.7 rainbow-csv|mec|0.2.1 language-gettext|mro|0.0.3 python|ms-|2018.4.0 sublime-keybindings|ms-|4.0.0 php-docblocker|nei|1.6.0 vscode-phpcbf|per|0.0.8 polacode|pnp|0.2.2 vscode-sort-json|ric|1.11.0 vscode-nginx|sha|0.5.0 trailing-spaces|sha|0.2.11 gitconfig|sid|1.0.1 vscode-hexdump|sle|1.6.0 cucumber|ste|0.11.5 twig|wha|1.0.2 change-case|wma|1.0.0
mjbvz commented 6 years ago

Does not seem to repo in vscode insiders with all extensions disabled:

screen shot 2018-05-08 at 11 00 13 am

Can you please confirm

vscodebot[bot] commented 6 years ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!