Java Code Examples for com.intellij.lang.annotation.Annotator#annotate()
The following examples show how to use
com.intellij.lang.annotation.Annotator#annotate() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultHighlightVisitor.java From consulo with Apache License 2.0 | 6 votes |
private void runAnnotators(PsiElement element) { List<Annotator> annotators = myCachedAnnotators.get(element.getLanguage().getID()); if (annotators.isEmpty()) return; final boolean dumb = myDumbService.isDumb(); //noinspection ForLoopReplaceableByForEach for (int i = 0; i < annotators.size(); i++) { Annotator annotator = annotators.get(i); if (dumb && !DumbService.isDumbAware(annotator)) { continue; } ProgressManager.checkCanceled(); annotator.annotate(element, myAnnotationHolder); } }
Example 2
Source File: AbstractTestCase.java From idea-php-typo3-plugin with MIT License | 5 votes |
@NotNull private AnnotationHolderImpl getAnnotationsAtCaret(String filename, String content) { PsiFile psiFile = myFixture.configureByText(filename, content); PsiElement psiElement = myFixture.getFile().findElementAt(myFixture.getCaretOffset()); AnnotationHolderImpl annotations = new AnnotationHolderImpl(new AnnotationSession(psiFile)); for (Annotator annotator : LanguageAnnotators.INSTANCE.allForLanguage(psiFile.getLanguage())) { annotator.annotate(psiElement, annotations); } return annotations; }
Example 3
Source File: ShopwareLightCodeInsightFixtureTestCase.java From idea-php-shopware-plugin with MIT License | 5 votes |
@NotNull private AnnotationHolderImpl getAnnotationsAtCaret(String filename, String content) { PsiFile psiFile = myFixture.configureByText(filename, content); PsiElement psiElement = myFixture.getFile().findElementAt(myFixture.getCaretOffset()); AnnotationHolderImpl annotations = new AnnotationHolderImpl(new AnnotationSession(psiFile)); for (Annotator annotator : LanguageAnnotators.INSTANCE.allForLanguage(psiFile.getLanguage())) { annotator.annotate(psiElement, annotations); } return annotations; }
Example 4
Source File: DrupalLightCodeInsightFixtureTestCase.java From idea-php-drupal-symfony2-bridge with MIT License | 5 votes |
@NotNull private AnnotationHolderImpl getAnnotationsAtCaret(String filename, String content) { PsiFile psiFile = myFixture.configureByText(filename, content); PsiElement psiElement = myFixture.getFile().findElementAt(myFixture.getCaretOffset()); AnnotationHolderImpl annotations = new AnnotationHolderImpl(new AnnotationSession(psiFile)); for (Annotator annotator : LanguageAnnotators.INSTANCE.allForLanguage(psiFile.getLanguage())) { annotator.annotate(psiElement, annotations); } return annotations; }
Example 5
Source File: SymfonyLightCodeInsightFixtureTestCase.java From idea-php-symfony2-plugin with MIT License | 5 votes |
@NotNull private AnnotationHolderImpl getAnnotationsAtCaret(String filename, String content) { PsiFile psiFile = myFixture.configureByText(filename, content); PsiElement psiElement = myFixture.getFile().findElementAt(myFixture.getCaretOffset()); AnnotationHolderImpl annotations = new AnnotationHolderImpl(new AnnotationSession(psiFile)); for (Annotator annotator : LanguageAnnotators.INSTANCE.allForLanguage(psiFile.getLanguage())) { annotator.annotate(psiElement, annotations); } return annotations; }