microsoft / vscode

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

Inline Scripting comment bug #161250

Closed chibuezedev closed 2 years ago

chibuezedev commented 2 years ago

Type: Bug

Hey, i noticed a flaw while using VScode and i'd like if considerations are taking to ensure best user experience.

The error is based on the senario whereby if one is writing an in-line base javaScript in a Html file using (). If one wants to use the keyboard shortcut for comments that is (ctrl + / ), the default comment tags(<-- comment -->) are executed instead of the scripting comment tag.

However, it will be nice if the keyboard shortcuts are active based on the tags and not based on the file type.

VS Code version: Code 1.70.2 (e4503b30fc78200f846c62cf8091b76ff5547662, 2022-08-16T05:36:25.715Z) OS version: Linux x64 5.4.0-125-generic Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz (4 x 1418)| |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: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|2, 2, 2| |Memory (System)|7.72GB (0.15GB free)| |Process Argv|--unity-launch --crash-reporter-id 8476e72c-4081-4b37-8e0f-d78d695a8020| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu| |XDG_SESSION_TYPE|x11|
Extensions (49) Extension|Author (truncated)|Version ---|---|--- codesnap|adp|1.3.4 TabOut|alb|0.2.1 aws-toolkit-vscode|ama|1.50.0 All-Autocomplete|Ati|0.0.23 vscode-django|bat|1.10.0 django-html|bib|1.3.0 django|big|1.0.2 vscode-tailwindcss|bra|0.8.7 npm-intellisense|chr|1.4.2 vscode-eslint|dba|2.2.6 vscode-motoko|dfi|0.3.9 python-preview|don|0.0.4 python-environment-manager|don|1.0.4 python-extension-pack|don|1.7.0 es7-react-js-snippets|dsz|4.4.3 gitlens|eam|2022.8.3105 vscode-html-css|ecm|1.13.1 EditorConfig|Edi|0.16.4 prettier-vscode|esb|9.8.0 auto-rename-tag|for|0.1.10 code-runner|for|0.11.8 pythonsnippets|frh|1.0.2 terraform|has|2.24.2 path-autocomplete|ion|1.22.1 vsc-python-indent|Kev|1.17.0 kite|kit|0.147.0 node-module-intellisense|lei|1.5.0 mongodb-vscode|mon|0.9.3 vscode-docker|ms-|1.22.1 python|ms-|2022.14.0 vscode-pylance|ms-|2022.9.10 jupyter|ms-|2022.7.1102252217 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.9 remote-containers|ms-|0.245.2 autodocstring|njp|0.6.1 vscode-react-refactor|pla|1.1.3 LiveServer|rit|5.7.9 vscode-zipexplorer|sle|0.3.1 tabnine-vscode|Tab|3.6.15 python|tht|0.2.3 intellicode-api-usage-examples|Vis|0.2.2 vscodeintellicode|Vis|1.2.24 vscode-wakatime|Wak|19.3.0 jinja|who|0.0.8 change-case|wma|1.0.0 JavaScriptSnippets|xab|1.8.0 ReactSnippets|xab|2.4.0 html-css-class-completion|Zig|1.20.0 (1 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30256859 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 pythondataviewer:30285071 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30557514 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vsclangdf:30486550 c4g48928:30535728 hb751961:30553087 dsvsc012cf:30540253 azure-dev_surveyonecf:30548226 i497e931:30553904 fc301958:30567733 ```
vscodenpa commented 2 years ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.71.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

RedCMD commented 2 years ago

Simple as changing the scope name source.js to meta.embedded.source.js in the html extension's package.json and .tmLanguage.json files

chibuezedev commented 2 years ago

Alright, I have to try this approach to see if it works. Thank you so much.