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

ctrl + / in html file displays {% comment %} ... {% endcomment %} #61348

Closed
qdirks opened this issue Oct 19, 2018 · 11 comments
Closed

ctrl + / in html file displays {% comment %} ... {% endcomment %} #61348

qdirks opened this issue Oct 19, 2018 · 11 comments
Assignees

Comments

@qdirks
Copy link

qdirks commented Oct 19, 2018

Issue Type: Bug

This comment was copied from issue #61030.

@aeschli

Yeah, it's happening again. I can believe that there are no changes in that area. This has been an issue for me in previous versions I think. Sometimes it works fine, and sometimes it doesn't.

I guess I'm leaving my computer (and vscode) on for several hours at a time without usage. Could that cause the bug to manifest?

I can confirm that closing and re-opening the program does not fix the problem. I will try a reboot really quick and see if the problem is gone.

The bug is still present after rebooting. As of right now, I'm not sure what I'm doing to cause the bug to manifest, or what causes the bug to disappear.

VS Code version: Code 1.28.2 (7f3ce96, 2018-10-17T00:23:51.859Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz (8 x 3411)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 15.90GB (10.91GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (17)
Extension Author (truncated) Version
language-x86-64-assembly 13x 2.2.11
vscode-color ans 0.4.5
django-html bib 1.2.0
django-snippets bib 1.1.0
jshint dba 0.10.20
tslint eg2 1.0.40
python ms- 2018.9.1
cpptools ms- 0.19.0
csharp ms- 1.16.2
vsliveshare ms- 0.3.834
debugger-for-chrome msj 4.10.2
java red 0.32.0
vscode-icons rob 7.27.0
vscode-java-debug vsc 0.14.0
vscode-java-pack vsc 0.4.0
vscode-java-test vsc 0.10.0
vscode-maven vsc 0.11.1
@qdirks
Copy link
Author

qdirks commented Oct 19, 2018

It's the next day now, my computer was off all night, and I'm still seeing the incorrect behavior exhibited.

@collinsnji
Copy link
Contributor

@qdirks hi, out of curiosity, did you ever change your key bindings at some point? I can't reproduce this behaviour

@qdirks
Copy link
Author

qdirks commented Oct 20, 2018

Not to my knowledge. Ctrl + / is the default binding for comment shortcut, right? That's what it is for me.

It was working correctly for me just a moment ago, but I was able to trigger the bug just now.

Can you please try to:
step 1: open vscode
step 2: open an html file or untitled file with html language
step 3: test if the comment shortcut is working, if it is
step 4: leave the tab open in vscode, and close vscode
step 5: re-open vscode. your tab is probably still there
step 6: test if the comment shortcut is not working now for the html

or basically:
step 1: test html comment shortcut
step 2: close and reopen vscode
step 3: test html comment shortcut

That seemed to trigger it for me. I was thinking, maybe it happens if I try to comment something before vscode is done loading up completely; you might see if that can trigger it. Or I'll try to see if that is the cause the next time it starts working again.

@aeschli
Copy link
Contributor

aeschli commented Oct 22, 2018

@qdirks I tried your steps and don't see the problem. This is my sample code:

<html>
<script>

   console.log("Hello")

</script>
</html>

I set the cursor at the beginning of the 'console.log' line and press 'Ctrl + /'.

@qdirks
Copy link
Author

qdirks commented Oct 23, 2018

@aeschli
I uploaded a video of the bug on youtube. It's a 1 minute, 23 seconds long. I hope it helps.

https://youtu.be/_C_oshj_vWg

@qdirks
Copy link
Author

qdirks commented Oct 23, 2018

After vscode does those little updates, it starts working again.

I also tested to see if it matters about vscode still loading up, and no it doesn't. The comment shortcut always fails after closing and reopening vscode for me, no matter how long you wait for vscode to be done loading, but -- so far as I'm aware -- it only happens in html files. After it has failed, it does not work again until something happens, like an update, or you uninstall it and reinstall it. Rebooting does nothing.

@aeschli
Copy link
Contributor

aeschli commented Oct 23, 2018

Thanks for the video. The problem is that your editor language is 'Django Template' (as seen in the status bar). You have to file an issue against the extension that provides the Django Template language to configure embedded languages like HTML does.

@aeschli aeschli closed this as completed Oct 23, 2018
@qdirks
Copy link
Author

qdirks commented Oct 24, 2018

Okay. And when you uninstall and reinstall, it plainly says that extensions are not removed. I don't remember ever installing the django extension, but I can believe that I did at some point. Disabling that fixed the issue for me. Thanks so much.

@aeschli
Copy link
Contributor

aeschli commented Oct 24, 2018

which django extension was it? We should file an issue against it.

@qdirks
Copy link
Author

qdirks commented Oct 24, 2018

https://github.com/iambibhas/vscode-django-template

or if you type in "django template" when searching the extension marketplace inside vscode. It's the one by bibhasdn, v.1.2.0

I would have filed an issue with it but I don't see how to do it. And I was looking at it... that actually might be intended for it to markup the comments that way. Look at this image:

Very similar markup. This picture is on the extension page. Perhaps I was not cognizant of why I was installing the extension in the first place so long ago.

@aeschli
Copy link
Contributor

aeschli commented Oct 25, 2018

@iambibhas Can you enable issues for https://github.com/iambibhas/vscode-django-template?

To handle embedded languages, you need to declare the scope names of the embedded language as done here: https://github.com/Microsoft/vscode/blob/3dd2b19b2ab7303d76296267217798d417251804/extensions/html/package.json#L47

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants