regex instead of "ends", angular context always true
@@ -23,22 +23,22 @@ public class Angular2IconProvider extends BaseIconProvider implements DumbAware
@NotNull
public static List<Model> allModels() {
return asList(
- ofFile("angular_module", "/icons/angular-module.svg", "AngularJS (in AngularJS projects only): *.module.ts")
- .end(".module.ts"),
- ofFile("angular_component", "/icons/angular-component.svg", "AngularJS (in AngularJS projects only): *.component.ts")
- .end(".component.ts"),
- ofFile("angular_service", "/icons/angular-service.svg", "AngularJS (in AngularJS projects only): *.service.ts")
- .end(".service.ts"),
- ofFile("angular_pipe", "/icons/angular-pipe.svg", "AngularJS (in AngularJS projects only): *.pipe.ts")
- .end(".pipe.ts"),
- ofFile("angular_directive", "/icons/angular-directive.svg", "AngularJS (in AngularJS projects only): *.directive.ts")
- .end(".directive.ts"),
- ofFile("angular_guard", "/icons/angular-guard.svg", "AngularJS (in AngularJS projects only): *.guard.ts")
- .end(".guard.ts"),
- ofFile("angular_resolver", "/icons/angular-resolver.svg", "AngularJS (in AngularJS projects only): *.resolver.ts")
- .end(".resolver.ts"),
- ofFile("angular_spec", "/icons/test-ts.svg", "AngularJS (in AngularJS projects only): *.spec.ts")
- .end(".spec.ts"),
+ ofFile("angular_module", "/icons/angular-module.svg", "AngularJS (in AngularJS projects only): *.module.(js|ts)")
+ .regex(".*module\\.(js|ts)"),
+ ofFile("angular_component", "/icons/angular-component.svg", "AngularJS (in AngularJS projects only): *.(component|controller).(js|ts)")
+ .regex(".*component\\.(js|ts)|.*controller\\.(js|ts)"),
+ ofFile("angular_service", "/icons/angular-service.svg", "AngularJS (in AngularJS projects only): *.service.(js|ts)")
+ .regex(".*\\.service\\.(js|ts)"),
+ ofFile("angular_pipe", "/icons/angular-pipe.svg", "AngularJS (in AngularJS projects only): *.pipe.(js|ts)")
+ .regex("pipe\\.(js|ts)"),
+ ofFile("angular_directive", "/icons/angular-directive.svg", "AngularJS (in AngularJS projects only): *.directive.(js|ts)")
+ .regex("directive(s)+\\.(js|ts)"),
+ ofFile("angular_guard", "/icons/angular-guard.svg", "AngularJS (in AngularJS projects only): *.guard.(js|ts)")
+ .regex("guard"),
+ ofFile("angular_resolver", "/icons/angular-resolver.svg", "AngularJS (in AngularJS projects only): *.resolver.(js|ts)")
+ .regex("resolver"),
+ ofFile("angular_spec", "/icons/test-ts.svg", "AngularJS (in AngularJS projects only): *.spec.(js|ts)")
+ .regex("spec"),
ofFile("angular_html", "/icons/html5.svg", "AngularJS (in AngularJS projects only): *.html")
.end(".html")
);
@@ -55,6 +55,6 @@ public class Angular2IconProvider extends BaseIconProvider implements DumbAware
@Override
protected boolean isSupported(@NotNull final PsiFile psiFile) {
- return Angular2LangUtil.isAngular2Context(psiFile);
+ return true;
}
}
