Java源码示例:com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider
示例1
@Nullable
private static ExternalLintAnnotationInput collectInformation(@NotNull PsiFile psiFile, @Nullable Editor editor) {
if (psiFile.getContext() != null || !SassLintConfigFileUtil.isSassFile(psiFile)) {
return null;
}
VirtualFile virtualFile = psiFile.getVirtualFile();
if (virtualFile == null || !virtualFile.isInLocalFileSystem()) {
return null;
}
if (psiFile.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
return null;
}
Project project = psiFile.getProject();
SassLintProjectComponent component = project.getComponent(SassLintProjectComponent.class);
if (!component.isSettingsValid() || !component.isEnabled()) {
return null;
}
Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
if (document == null) {
return null;
}
String fileContent = document.getText();
if (StringUtil.isEmptyOrSpaces(fileContent)) {
return null;
}
EditorColorsScheme colorsScheme = editor != null ? editor.getColorsScheme() : null;
// tabSize = getTabSize(editor);
// tabSize = 4;
return new ExternalLintAnnotationInput(project, psiFile, fileContent, colorsScheme);
}
示例2
@Nullable
private static ExternalLintAnnotationInput collectInformation(@NotNull PsiFile psiFile, @Nullable Editor editor) {
if (psiFile.getContext() != null || !RTFileUtil.isRTFile(psiFile)) {
return null;
}
VirtualFile virtualFile = psiFile.getVirtualFile();
if (virtualFile == null || !virtualFile.isInLocalFileSystem()) {
return null;
}
if (psiFile.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
return null;
}
Project project = psiFile.getProject();
RTProjectComponent component = project.getComponent(RTProjectComponent.class);
if (component == null || !component.isValidAndEnabled()) {
return null;
}
Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
if (document == null) {
return null;
}
String fileContent = document.getText();
if (StringUtil.isEmptyOrSpaces(fileContent)) {
return null;
}
EditorColorsScheme colorsScheme = editor == null ? null : editor.getColorsScheme();
// tabSize = getTabSize(editor);
// tabSize = 4;
return new ExternalLintAnnotationInput(project, psiFile, fileContent, colorsScheme);
}
示例3
@Nullable
private static ExternalLintAnnotationInput collectInformation(@NotNull PsiFile psiFile, @Nullable Editor editor) {
if (psiFile.getContext() != null || !RTFileUtil.isRTFile(psiFile)) {
return null;
}
VirtualFile virtualFile = psiFile.getVirtualFile();
if (virtualFile == null || !virtualFile.isInLocalFileSystem()) {
return null;
}
if (psiFile.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
return null;
}
Project project = psiFile.getProject();
RTProjectComponent component = project.getComponent(RTProjectComponent.class);
if (component == null || !component.isValidAndEnabled()) {
return null;
}
Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
if (document == null) {
return null;
}
String fileContent = document.getText();
if (StringUtil.isEmptyOrSpaces(fileContent)) {
return null;
}
EditorColorsScheme colorsScheme = editor == null ? null : editor.getColorsScheme();
// tabSize = getTabSize(editor);
// tabSize = 4;
return new ExternalLintAnnotationInput(project, psiFile, fileContent, colorsScheme);
}
示例4
@Nullable
private static ExternalLintAnnotationInput collectInformation(@NotNull PsiFile psiFile, @Nullable Editor editor) {
if (psiFile.getContext() != null) {
return null;
}
VirtualFile virtualFile = psiFile.getVirtualFile();
if (virtualFile == null || !virtualFile.isInLocalFileSystem()) {
return null;
}
if (psiFile.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
return null;
}
Project project = psiFile.getProject();
ESLintProjectComponent component = project.getComponent(ESLintProjectComponent.class);
if (!component.isSettingsValid() || !component.isEnabled() || !isJavaScriptFile(psiFile, component.ext)) {
return null;
}
Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
if (document == null) {
return null;
}
String fileContent = document.getText();
if (StringUtil.isEmptyOrSpaces(fileContent)) {
return null;
}
EditorColorsScheme colorsScheme = editor == null ? null : editor.getColorsScheme();
// tabSize = getTabSize(editor);
// tabSize = 4;
return new ExternalLintAnnotationInput(project, psiFile, fileContent, colorsScheme);
}
示例5
@NotNull
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(@NotNull VirtualFile file) {
return new FluidFileViewProvider(getManager(), file, false, myTemplateDataLanguage);
}
示例6
@NotNull
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(
@NotNull VirtualFile virtualFile) {
return new SoyFileViewProvider(getManager(), virtualFile, false);
}
示例7
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(VirtualFile fileCopy) {
return new LatteFileViewProvider(getManager(), fileCopy, false);
}