IntelliJ IDEA: Syntax Highlighting for Angular Pug templates like WebStorm
已回答
Hi,
I use IntelliJ IDEA for almost all my development projects. Not only Android and Java but also my web (Javascript) projects. The only feature that I see it doesn't have (in compare to WebStorm) is when I use Pug (instead of HTML) for Angular's components' templates. See below snapshots ... first in IntelliJ IDEA and the second (same project) in WebStorm:


The note is IntelliJ IDEA can detect symbols correctly. The issue is in view only. See below:

I have installed these plugins on IntelliJ IDEA:
- Angular Templates
- Pug (ex-Jade)
- Angular 2 TypeScript Live Templates
- ...
And these were installed by default:
- AngularJS
- HTML Tools
- ...
There is no issue for HTML templates.
Thanks anyway.
请先登录再写评论。
Hello,
Is it possible to provide code example and idea.log ("Help | Show Log in...") after restarting from both IDEs?
Hello,
Excuse me for too large content.
Note: I never open one project in two IDEs at the same time. I first, close it in one IDE and then open it in another.
reg-table.component.pug:
reg-table.component.ts:
import {Component} from '@angular/core';
@Component({
selector: 'app-reg-table',
templateUrl: './reg-table.component.pug',
styleUrls: ['./reg-table.component.scss'],
})
export class RegTableComponent {
displayedColumns = ['position', 'name', 'description', 'quantity', 'price'];
dataSource = ELEMENT_DATA;
}
export interface PeriodicElement {
position: number;
name: string;
description: string;
quantity: number;
price: string;
}
const ELEMENT_DATA: PeriodicElement[] = [
{position: 1, name: 'Hydr', description: 'Hydrogen', quantity: 1.0079, price: 'H' },
{position: 2, name: 'Heli', description: 'Helium', quantity: 4.0026, price: 'He'},
{position: 3, name: 'Lith', description: 'Lithium', quantity: 6.941, price: 'Li'},
{position: 4, name: 'Bery', description: 'Beryllium', quantity: 9.0122, price: 'Be'},
{position: 5, name: 'Boro', description: 'Boron', quantity: 10.811, price: 'B' },
{position: 6, name: 'Carb', description: 'Carbon', quantity: 12.0107, price: 'C' },
{position: 7, name: 'Nitr', description: 'Nitrogen', quantity: 14.0067, price: 'N' },
{position: 8, name: 'Oxyg', description: 'Oxygen', quantity: 15.9994, price: 'O' },
];
...\.IntelliJIdea\system\log\idea.log:
works fine for me in IU-183.5912.2, even with (most of) your custom plugins installed:
what editor color scheme do you use? please provide your settings (File > Export Settings)
Thanks. You showed me the question is incorrect and the issue is not related to IDE itself but is related to its configurations, settings or customizations. After a lot of trials and errors, I found the source of the issue:
This is in:
I had made editor.injected.highlighting.enabled unchecked for other purposes and that had caused this problem.
I see, thanks for clearing it up:)