microsoft / vscode

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

javascript regex bug #178541

Closed kangping-git closed 1 year ago

kangping-git commented 1 year ago

Type: Bug

When using regular expressions, the syntax highlighting bugs out pairs of parentheses when I put curly braces within curly braces. Please fix.

VS Code version: Code 1.76.2 (ee2b180d582a7f601fa6ecfdad8d9fd269ab1884, 2023-03-14T17:55:54.936Z) OS version: Windows_NT x64 10.0.22621 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-12700 (20 x 2112)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|31.73GB (15.96GB free)| |Process Argv|--crash-reporter-id 94e4c632-1ba4-4844-a784-022b996a574a| |Screen Reader|no| |VM|0%|
Extensions (61) Extension|Author (truncated)|Version ---|---|--- asm-formatter|Ang|1.1.2 vscode-django|bat|1.10.0 doxdocgen|csc|1.4.0 vscode-markdownlint|Dav|0.49.0 javascript-ejs-support|Dig|1.3.3 githistory|don|0.6.20 python-environment-manager|don|1.0.4 python-extension-pack|don|1.7.0 vscode-wasm|dts|1.4.1 prettier-vscode|esb|9.10.4 live-p5|fil|1.4.3 chatgpt-vscode|gen|0.0.4 codespaces|Git|1.14.1 gc-excelviewer|Gra|4.2.56 todo-tree|Gru|0.0.224 discord-vscode|icr|5.8.0 latex-workshop|Jam|9.8.1 better-cpp-syntax|jef|1.17.2 svg|joc|1.5.2 vsc-python-indent|Kev|1.18.0 asm-code-lens|maz|2.4.0 vscode-filesize|mkx|3.1.0 vscode-language-pack-ja|MS-|1.76.2023031509 csharp|ms-|1.25.4 vscode-edge-devtools|ms-|2.1.1 isort|ms-|2022.8.0 python|ms-|2023.4.1 vscode-pylance|ms-|2023.3.30 jupyter|ms-|2023.2.1200692131 jupyter-keymap|ms-|1.1.0 jupyter-renderers|ms-|1.0.15 vscode-jupyter-cell-tags|ms-|0.1.8 vscode-jupyter-slideshow|ms-|0.1.5 cmake-tools|ms-|1.13.45 cpptools|ms-|1.14.5 cpptools-extension-pack|ms-|1.3.0 hexeditor|ms-|1.9.11 powershell|ms-|2023.3.2 vsliveshare|ms-|1.0.5834 vsliveshare-pack|ms-|0.4.0 autodocstring|njp|0.6.1 indent-rainbow|ode|8.3.1 markdown-checkbox|PKi|1.8.1 webgl-glsl-editor|rac|1.3.4 java|red|1.16.0 vscode-xml|red|0.24.0 LiveServer|rit|5.7.9 markdown-preview-enhanced|shd|0.6.8 vscode-spotify|shy|3.2.1 tex-preview|tia|0.0.4 cmake|twx|0.0.17 intellicode-api-usage-examples|Vis|0.2.7 vscodeintellicode|Vis|1.2.30 vscode-java-debug|vsc|0.49.1 vscode-java-dependency|vsc|0.21.2 vscode-java-pack|vsc|0.25.9 vscode-java-test|vsc|0.38.2 vscode-maven|vsc|0.41.0 vscode-icons|vsc|12.2.0 jinja|who|0.0.8 json|Zai|2.0.2
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931cf:30280410 vshan820:30294714 vstes263cf:30335440 vscoreces:30445986 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30410667 cppdebug:30492333 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30695312 azure-dev_surveyone:30548225 vscccc:30610679 nodejswelcome1cf:30587006 3biah626:30602489 pyind779:30671433 89544117:30613380 pythonsymbol12:30671437 2i9eh265:30646982 showlangstatbar:30672706 vscodedisable:30660115 functionswalk:30687959 pythonms35:30686772 ```
vscodenpa commented 1 year ago

この問題を作成していただきありがとうございます!

しかし、説明が英語ではないので、私たちがそれに取り組むのは難しいです。可能であれば、この問題を英語に編集してください。新しいコメントを追加したり、新しい問題を作成したりするのではなく、既存の問題を編集してください。

残念ながら、自動翻訳サービスでは、ソフトウェアの問題について効果的にコミュニケーションをとるために必要な技術用語を処理できないため、翻訳を支援するために、当社のテクノロジーに精通している人間の翻訳者を見つけることをお勧めします。

それ以外の場合、この問題は翻訳が必要としてマークされており、コミュニティメンバーが翻訳を支援できる可能性があります。


Thanks for creating this issue!

Unfortunately, as the description is not in English, it's hard for us to work on. If possible, please edit the original issue to be in English.

In our experience, automatic translation services are not able to handle the technical language needed to effectively communicate about software issues, so we recommend finding a human translator who is familiar with our technology to help.

Otherwise, we have marked this as needing translation and a community member may be able to help out.

mjbvz commented 1 year ago

Please share example code which demonstrates the issue

kangping-git commented 1 year ago

exampleCode is

console.log("Sample".match(/[[]]/));
mjbvz commented 1 year ago

Screenshot 2023-03-29 at 9 35 46 AM

Thanks.

The highlighting shows that first [ starts a character set. The following [ is then matching the [ character inside that set. That's why we highlight it differently, and in this case the highlighting actually helps you understand what this regex does