Parseable (final PsiFile file, final ErrorHandler eh) { final InputSource source = makeInputSource(file); final VirtualFile virtualFile = file.getVirtualFile(); if (file.getFileType() == RncFileType.getInstance()) { return new CompactParseable(source, eh) { @Override public ParsedPattern parseInclude(String uri, SchemaBuilder schemaBuilder, IncludedGrammar g, String inheritedNs) throws BuildException, IllegalSchemaException { ProgressManager.checkCanceled(); return super.parseInclude(resolveURI(virtualFile, uri), schemaBuilder, g, inheritedNs); } }; } else { return new SAXParseable(source, eh) { @Override public ParsedPattern parseInclude(String uri, SchemaBuilder schemaBuilder, IncludedGrammar g, String inheritedNs) throws BuildException, IllegalSchemaException { ProgressManager.checkCanceled(); return super.parseInclude(resolveURI(virtualFile, uri), schemaBuilder, g, inheritedNs); } }; } }