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

Completion stops working when switched to a profile based on Angular template #284

Open
NeuSandeZ opened this issue Feb 4, 2024 · 19 comments
Labels

Comments

@NeuSandeZ
Copy link

As in title. I run both extensions in latest versions.

@ecmel
Copy link
Owner

ecmel commented Feb 4, 2024

Could you provide a link for other extension?

@NeuSandeZ
Copy link
Author

NeuSandeZ commented Feb 4, 2024

I use Angular profile built into VSCode + your extension.

@ecmel
Copy link
Owner

ecmel commented Feb 4, 2024

What is exactly broken? can you provide more info

@NeuSandeZ
Copy link
Author

NeuSandeZ commented Feb 4, 2024

IntelliSsense doesn't pop up automatically when i start typing some css class in html code. It happens only when your extension is on. I'm able to trigger it by ctrl+space and it works correctly. I use legacy colors.

@ecmel
Copy link
Owner

ecmel commented Feb 4, 2024

Can you share your .vscode/settings.json file? This extension is named "HTML CSS Support" as well so can you provide the file you are working on?

@NeuSandeZ
Copy link
Author

NeuSandeZ commented Feb 4, 2024

Sorry for the late replay. Here are files you've asked for.

settings.json

This is just html in an angular project.

<div>
  <h1>{{ recipe.title }}</h1>
  <div class="card">
    <img class="card-img-top" [src]="recipe.imgUrl" alt="Card image cap" />
    <div class="card-body">
      <p class="card-text">
        {{ recipe.description }}
      </p>
    </div>
    <ul class="list-group list-group-flush">
      <li class="list-group-item">Submited by: nick | updated on:</li>
      <li class="list-group-item">Tested by:</li>
    </ul>
    <div class="card-body">
      <button mat-raised-button color="warn">
        Save <span><mat-icon>favorite</mat-icon></span>
      </button>
      <a class="card-link">Another link</a>
    </div>
  </div>

  <div class="mt-4">
    <mat-accordion class="example-headers-align" multi>
      <mat-expansion-panel>
        <mat-expansion-panel-header>
          <mat-panel-title class="mat-panel-title-custom-style">
            Ingredients
          </mat-panel-title>
        </mat-expansion-panel-header>

        <ul>
          @for (item of recipe.ingredients; track $index) {
          <li>{{ item.ingredient }}</li>
          <hr />
          }
        </ul>
      </mat-expansion-panel>
    </mat-accordion>
  </div>

  <div class="recipe-box mt-4">
    <div class="row g-3">
      @for (item of recipe.prepTime; track $index) {
      <div class="col-sm-4">
        <span class="recipe-header">{{ item.name }}:</span>
        {{ item.amount }} mins
      </div>
      }
    </div>
    <hr />
    <a href="#nutrition-facts" class="jump-link">Jump to Nutrition Facts</a>
  </div>

  <div class="card mt-4">
    <div class="card-body">
      <h1 class="card-header">Directions</h1>
      <div class="col m-2">
        @for (item of recipe.steps; track $index) {
        <div class="card-body">
          <h3 class="card-title">Step {{ $index }}</h3>
          <p class="card-text">{{ item.directionStep }}</p>
        </div>
        }
      </div>
    </div>
  </div>
</div>

@ecmel
Copy link
Owner

ecmel commented Feb 4, 2024

Can you also tell me where is your css located? e.g in which file cardclass is defined in your project?

@ecmel ecmel added the question label Feb 4, 2024
@NeuSandeZ
Copy link
Author

NeuSandeZ commented Feb 4, 2024

Class card is a bootstrap class and it is acknowledged by HTML extension in .vscode.settings.json as well as all of css files references.

"css.styleSheets": [
    "https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css",
    "src/**/*.css",
    // "SRC/Frontend/RecipeRhapsody/src/**/*.css",
  ],

On top of that in angular.json project file i provide:

 "styles": [
            "node_modules/bootstrap/dist/css/bootstrap.min.css",
            "@angular/material/prebuilt-themes/deeppurple-amber.css",
            "src/styles.css"
          ],

@ecmel
Copy link
Owner

ecmel commented Feb 4, 2024

With the same settings:

"css.styleSheets": [
    "https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css",
    "src/**/*.css",
    // "SRC/Frontend/RecipeRhapsody/src/**/*.css",
  ],

Completion works in the html file.

Screenshot 2024-02-04 at 20 18 23

Which Angular extension are you using?

@NeuSandeZ
Copy link
Author

NeuSandeZ commented Feb 4, 2024

Oh i'm sorry i didn't specify

vscode-angular-html

extension for highlighting angular syntax. When it's enabled the intellisense doesn't work for css html.

@ecmel
Copy link
Owner

ecmel commented Feb 5, 2024

I installed vscode-angular-html but no matter I tried the completion worked.

@NeuSandeZ
Copy link
Author

Can you switch to Angular profile built in vscode install the vscode-angular-html and try again cause there's bunch of extensions installed there? Did you run the command 'vscode-angular-html: Set legacy color customizations' from the command pallette?

@ecmel
Copy link
Owner

ecmel commented Feb 6, 2024

Created a new profile based on Angular template now the completion stopped working. At last. :)

@ecmel ecmel changed the title It breaks the HTML CSS Support extension. Completion stops working when switched to a profile based on Angular template Feb 6, 2024
@ecmel
Copy link
Owner

ecmel commented Feb 6, 2024

You should install this extension again in that profile and the completions will start working again. Hope this helps.

@NeuSandeZ
Copy link
Author

Unfortunately i've done that and it still doesn't work. Only ctrl+space trigger the intellisense.

@ecmel
Copy link
Owner

ecmel commented Feb 7, 2024

I replicated the bug, everything works in angular default profile but if I install the following extension only ctrl space triggers completions. Something in that extension is interfering:

https://marketplace.visualstudio.com/items?itemName=ghaschel.vscode-angular-html

Can you disable that extension and try again to confirm?

@NeuSandeZ
Copy link
Author

Yes that's exactly the case. When i disable the vscode-angular-html it works properly. However the thing is that i need that extansion haha

@ecmel
Copy link
Owner

ecmel commented Feb 7, 2024

Can you file a bug report in vscode-angular-html extension's github page referencing this issue since not much I can think of to do in this extension to fix the problem.

@ecmel ecmel added wontfix and removed question labels Feb 7, 2024
@NeuSandeZ
Copy link
Author

NeuSandeZ commented Feb 7, 2024

Yes i'll do that! Thank you for your time and effort!

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