Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[html] don't let '/' trigger a suggest in embedded JavaScript #97949

Open
jplackey opened this issue May 15, 2020 · 2 comments · May be fixed by #171547
Open

[html] don't let '/' trigger a suggest in embedded JavaScript #97949

jplackey opened this issue May 15, 2020 · 2 comments · May be fixed by #171547
Assignees
Labels
feature-request Request for new features or functionality html HTML support issues
Milestone

Comments

@jplackey
Copy link

Issue Type: Bug

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)
GPU Status 2d_canvas: enabled
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
Load (avg) undefined
Memory (System) 15.86GB (8.52GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (2)
Extension Author (truncated) Version
vscode-eslint dba 2.1.5
python ms- 2020.5.78807
@aeschli 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
@aeschli aeschli added html HTML support issues feature-request Request for new features or functionality labels May 18, 2020
@aeschli aeschli added this to the Backlog milestone May 18, 2020
@aeschli
Copy link
Contributor

aeschli commented 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 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
@jplackey
Copy link
Author

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.

@johnsoncodehk johnsoncodehk linked a pull request Jan 17, 2023 that will close this issue
35 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality html HTML support issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants