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

Extension break comment-out shortcut in html files #2087

Open
1 of 2 tasks
67E9 opened this issue Sep 18, 2024 · 2 comments
Open
1 of 2 tasks

Extension break comment-out shortcut in html files #2087

67E9 opened this issue Sep 18, 2024 · 2 comments
Labels

Comments

@67E9
Copy link

67E9 commented Sep 18, 2024

Dear Vscode-ng-language-service Team,

I have found a bug related to commenting out part of html-files in an Angular project using the VSCode shortcut.

bug report

Is this a regression?

Not to my knowledge. I quick search of the issues did not show somehting similar.

Description

When I try to comment out part of an HTML file in an Angular project using the shortcut ctl+/, it adds JS style comment syntax (//) instead of html style comment syntax (<!-- -->).

Bug Type

What does this bug affect

  • Angular Language Service VSCode extension
  • Angular Language Service server

Reproduction

I use the kind of setup:

  1. OS: Windows 11
  2. Source code stored in WSL(Debian)-filesystem
  3. Open project from VSCode with the WSL extension.

Steps to reproduce the behavior:

  1. Open Angular Project stored in WSL-filesystem in VSCode.
  2. Open an HTML file from the project.
  3. Use VSCode shortcut (ctl + numpad / ) to comment out some lines of the HTML.

The issue disappeared, when I disabled the Angular Language Service VSCode extension in VSCode.

Expected behavior

Comment out the lines using <!-- --> syntax.

🌍 Your Environment

Angular Version:


Angular CLI: 17.3.9
Node: 20.11.0
Package Manager: npm 10.2.4
OS: linux x64

Angular: 17.3.12
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.1703.9
@angular-devkit/build-angular      17.3.9
@angular-devkit/core               17.3.9
@angular-devkit/schematics         17.3.9
@angular/cdk                       17.3.10
@angular/cli                       17.3.9
@angular/material                  17.3.10
@angular/material-moment-adapter   17.3.10
@schematics/angular                17.3.9
rxjs                               7.5.7
typescript                         5.4.5
zone.js                            0.14.10

Extension Version:


18.2.0

VSCode Version:


1.93.1

Operating System:


Host: Windows 11 Pro 10.0.22631 Build 22631
WSL: 2.2.4.0
Debian(WSL):
  PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
  NAME="Debian GNU/Linux"
  VERSION_ID="11"
  VERSION="11 (bullseye)"
  VERSION_CODENAME=bullseye
  ID=debian
@67E9 67E9 added the bug label Sep 18, 2024
@samueldmeyer
Copy link

I have the same issue running VSCode 1.94.2 with Angular 18.2.3 on macOS 14.6.1. Also, the code coloring for comments is not working correctly.

@samueldmeyer
Copy link

I realized that this only happens for me after a multi-line string. I'm not entirely sure if multi-line strings are supported, but the Angular compiler works just fine with it. I didn't notice because it is a very long file and that part must have been auto-formatted at some time.

<div>
{{
testValue
? ' Long text (that spans
multiple
lines)'
: ''
}}
<!-- Problem starts here -->
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants