本文整理汇总了Java中com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider类的典型用法代码示例。如果您正苦于以下问题:Java MultiplePsiFilesPerDocumentFileViewProvider类的具体用法?Java MultiplePsiFilesPerDocumentFileViewProvider怎么用?Java MultiplePsiFilesPerDocumentFileViewProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MultiplePsiFilesPerDocumentFileViewProvider类属于com.intellij.psi包,在下文中一共展示了MultiplePsiFilesPerDocumentFileViewProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findSupport
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@RequiredReadAction
private RangeMarker findSupport(RangeMarker leader, PsiFile file, Document document)
{
final int offset = leader.getStartOffset();
PsiElement element = InjectedLanguageUtil.findElementAtNoCommit(file, offset);
PsiElement support = findSupportElement(element);
if(support == null && file.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider)
{
element = file.getViewProvider().findElementAt(offset, myLanguage);
support = findSupportElement(element);
}
if(support == null)
{
return null;
}
final TextRange range = support.getTextRange();
TextRange realRange = InjectedLanguageManager.getInstance(file.getProject()).injectedToHost(element.getContainingFile(), range);
return document.createRangeMarker(realRange.getStartOffset(), realRange.getEndOffset(), true);
}
示例2: collectInformation
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@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);
}
示例3: isSupported
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
public boolean isSupported(@NotNull Class visitorClass, @NotNull PsiFile file) {
if (visitorClass == StringLiteralQuotesAnnotator.class &&
file.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
return false;
}
return true;
}
示例4: checkValue
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected void checkValue(XmlAttributeValue value, XmlFile file, XmlRefCountHolder refHolder, XmlTag tag, ProblemsHolder holder) {
String idRef = XmlHighlightVisitor.getUnquotedValue(value, tag);
if (tag instanceof HtmlTag) {
idRef = idRef.toLowerCase();
}
if (XmlUtil.isSimpleValue(idRef, value) && refHolder.isIdReferenceValue(value)) {
boolean hasIdDeclaration = refHolder.hasIdDeclaration(idRef);
if (!hasIdDeclaration && tag instanceof HtmlTag) {
hasIdDeclaration = refHolder.hasIdDeclaration(value.getValue());
}
if (!hasIdDeclaration) {
for(XmlIdContributor contributor: Extensions.getExtensions(XmlIdContributor.EP_NAME)) {
if (contributor.suppressExistingIdValidation(file)) {
return;
}
}
final FileViewProvider viewProvider = tag.getContainingFile().getViewProvider();
if (viewProvider instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL,
new XmlDeclareIdInCommentAction(idRef));
}
else {
holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL);
}
}
}
}
示例5: collectInformation
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@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);
}
示例6: collectInformation
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Nullable
private static ExternalLintAnnotationInput collectInformation(@NotNull PsiFile psiFile, @Nullable Editor editor) {
if (psiFile.getContext() != null || !CoffeeLintConfigFileUtil.isCoffeeScriptFile(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();
CoffeeLintProjectComponent component = project.getComponent(CoffeeLintProjectComponent.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);
}
示例7: collectInformation
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@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);
}
示例8: checkValue
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
protected void checkValue(XmlAttributeValue value, XmlFile file, XmlRefCountHolder refHolder, XmlTag tag, ProblemsHolder holder) {
String idRef = XmlHighlightVisitor.getUnquotedValue(value, tag);
if (tag instanceof HtmlTag) {
idRef = idRef.toLowerCase();
}
if (XmlUtil.isSimpleXmlAttributeValue(idRef, value) && refHolder.isIdReferenceValue(value)) {
boolean hasIdDeclaration = refHolder.hasIdDeclaration(idRef);
if (!hasIdDeclaration && tag instanceof HtmlTag) {
hasIdDeclaration = refHolder.hasIdDeclaration(value.getValue());
}
if (!hasIdDeclaration) {
for(XmlIdContributor contributor: Extensions.getExtensions(XmlIdContributor.EP_NAME)) {
if (contributor.suppressExistingIdValidation(file)) {
return;
}
}
final FileViewProvider viewProvider = tag.getContainingFile().getViewProvider();
if (viewProvider instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL,
new XmlDeclareIdInCommentAction(idRef));
}
else {
holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL);
}
}
}
}
示例9: checkValue
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
protected void checkValue(XmlAttributeValue value, XmlFile file, XmlRefCountHolder refHolder, XmlTag tag, ProblemsHolder holder) {
String idRef = XmlHighlightVisitor.getUnquotedValue(value, tag);
if (tag instanceof HtmlTag) {
idRef = idRef.toLowerCase();
}
if (XmlUtil.isSimpleValue(idRef, value) && refHolder.isIdReferenceValue(value)) {
boolean hasIdDeclaration = refHolder.hasIdDeclaration(idRef);
if (!hasIdDeclaration && tag instanceof HtmlTag) {
hasIdDeclaration = refHolder.hasIdDeclaration(value.getValue());
}
if (!hasIdDeclaration) {
for(XmlIdContributor contributor: Extensions.getExtensions(XmlIdContributor.EP_NAME)) {
if (contributor.suppressExistingIdValidation(file)) {
return;
}
}
final FileViewProvider viewProvider = tag.getContainingFile().getViewProvider();
if (viewProvider instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL,
new XmlDeclareIdInCommentAction(idRef));
}
else {
holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL);
}
}
}
}
示例10: cloneInner
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(VirtualFile virtualFile) {
return new SoyFileViewProvider(getManager(), virtualFile, false);
}
示例11: cloneInner
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(VirtualFile virtualFile) {
return new RythmFileViewProvider(getManager(), virtualFile, false, myBaseLanguage, myTemplateLanguage);
}
示例12: cloneInner
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(VirtualFile file) {
return new JetFileViewProvider(getManager(), file, false, myTemplateDataLanguage);
}
示例13: cloneInner
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(VirtualFile virtualFile) {
return new RestFileViewProvider(getManager(), virtualFile, false);
}
示例14: cloneInner
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(VirtualFile fileCopy) {
return new LatteFileViewProvider(getManager(), fileCopy, false);
}
示例15: cloneInner
import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(VirtualFile virtualFile) {
return new DotFileViewProvider(getManager(), virtualFile, false);
}