Java 类com.intellij.lang.javascript.psi.impl.JSFileImpl 实例源码

项目:WebStormRequireJsPlugin    文件:RequirejsProjectComponent.java   
public boolean parseRequirejsConfig() {
    VirtualFile mainJsVirtualFile = findPathInWebDir(settings.configFilePath);
    if (null == mainJsVirtualFile) {
        this.showErrorConfigNotification("Config file not found. File " + settings.publicPath + '/' + settings.configFilePath + " not found in project");
        LOG.debug("Config not found");
        return false;
    } else {
        PsiFile mainJs = PsiManager.getInstance(project).findFile(mainJsVirtualFile);
        if (mainJs instanceof JSFileImpl || mainJs instanceof XmlFileImpl) {
            Map<String, VirtualFile> allConfigPaths;
            packageConfig.clear();
            requireMap.clear();
            requirePaths.clear();
            if (((PsiFileImpl) mainJs).getTreeElement() == null) {
                parseMainJsFile(((PsiFileImpl) mainJs).calcTreeElement());
            } else {
                parseMainJsFile(((PsiFileImpl) mainJs).getTreeElement());
            }
        } else {
            this.showErrorConfigNotification("Config file wrong format");
            LOG.debug("Config file wrong format");
            return false;
        }
    }

    return true;
}
项目:consulo-javascript    文件:JavaScriptParsingDefinition.java   
@Override
public PsiFile createFile(FileViewProvider fileViewProvider)
{
    return new JSFileImpl(fileViewProvider);
}