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
Create and save a new .html file. Add a script tag, such as:
<script>
function main() {
/**/
}
</script>
You will notice that after typing the closing slash, IntelliSense pops up (leading to potential unintended insertions if Enter is pressed, for example). If the identical JavaScript code is put into a .js file, the behavior does not occur.
VS Code version: Code 1.45.1 (5763d90, 2020-05-14T08:27:35.169Z)
OS version: Windows_NT x64 10.0.18363
System Info
Item
Value
CPUs
Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2808)
aeschli
changed the title
Block comment within <script> tag triggers IntelliSense popup
[html] don't let '/' trigger a suggest in embedded JavaScipt
May 18, 2020
Trigger characters are defined by completion providers and there's one one suggest provider for the whole HTML.
We would have to split them up in 3.
jplackey
changed the title
[html] don't let '/' trigger a suggest in embedded JavaScipt
[html] don't let '/' trigger a suggest in embedded JavaScript
May 18, 2020
After playing with this a bit more, I do see what you mean in regards to the shared suggestion provider, as I was able to find a few other instances of it being triggered in specific cases.
/**/ <!-- does not trigger suggest -->
<script>
function main() {
< // triggers suggest
/**/ // triggers suggest
a = b / // triggers suggest (with fewer suggestions)
a = b * // does not trigger suggest
}
</script>
That said, since there are cases where "/" doesn't trigger a suggestion (including /**/ outside of the script block), I wonder if this could somehow be addressed without splitting up the suggestion provider.
Issue Type: Bug
Create and save a new .html file. Add a script tag, such as:
You will notice that after typing the closing slash, IntelliSense pops up (leading to potential unintended insertions if Enter is pressed, for example). If the identical JavaScript code is put into a .js file, the behavior does not occur.
VS Code version: Code 1.45.1 (5763d90, 2020-05-14T08:27:35.169Z)
OS version: Windows_NT x64 10.0.18363
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Extensions (2)
The text was updated successfully, but these errors were encountered: