Search in sources :

Example 1 with DialectOptionHolder

use of com.intellij.lang.javascript.DialectOptionHolder in project intellij-plugins by JetBrains.

the class TsLintExternalAnnotator method acceptPsiFile.

@Override
protected boolean acceptPsiFile(@NotNull PsiFile file) {
    if (!(file instanceof JSFile))
        return false;
    final TsLintConfiguration configuration = TsLintConfiguration.getInstance(file.getProject());
    if (configuration.isAllowJs() && JSUtils.isJavaScriptFile(file))
        return true;
    final DialectOptionHolder holder = DialectDetector.dialectOfFile(file);
    return holder != null && holder.isTypeScript;
}
Also used : DialectOptionHolder(com.intellij.lang.javascript.DialectOptionHolder) TsLintConfiguration(com.intellij.lang.javascript.linter.tslint.config.TsLintConfiguration) JSFile(com.intellij.lang.javascript.psi.JSFile)

Aggregations

DialectOptionHolder (com.intellij.lang.javascript.DialectOptionHolder)1 TsLintConfiguration (com.intellij.lang.javascript.linter.tslint.config.TsLintConfiguration)1 JSFile (com.intellij.lang.javascript.psi.JSFile)1