public Source resolveAbsolute(final URI uri) { if (!"file".equals(uri.getScheme())) return null; final VirtualFile file = LocalFileSystem.getInstance().findFileByPath(uri.getPath()); final DartFileBasedSource source = file == null ? null : DartFileBasedSource.getSource(myProject, file); return source != null && source.getUriKind() == UriKind.FILE_URI ? source : null; }
public Source fromEncoding(final UriKind kind, final URI uri) { if (kind != UriKind.FILE_URI) return null; final VirtualFile file = LocalFileSystem.getInstance().findFileByPath(uri.getPath()); final DartFileBasedSource source = file == null ? null : DartFileBasedSource.getSource(myProject, file); if (source != null && source.getUriKind() != UriKind.PACKAGE_URI) { DartInProcessAnnotator.LOG.warn( "DartFileUriResolver.fromEncoding: unexpected uri kind for file " + uri); } return source; }