Annotating elements from other files

I've implemented custom annotator (subclass of com.intellij.lang.annotation.Annotator) and made operations only on PsiElement given as argument of annotate method, its children and siblings and I'm getting this when creating annotations:

16:54:53 Throwable
         Annotation must be registered for an element inside 'YAML file' which is in 'file://C:/Development/Projects/nmo/branch_2_3/HPP/scripts/HPP_common.yml'.
         Element passed: 'PsiElement(scalar key)' is inside the 'YAML file' which is in 'file://C:/Development/Projects/nmo/branch_2_3/HPP/scripts/HPP_process.yml'
16:54:55 Throwable
         Annotation must be registered for an element inside 'YAML file' which is in 'file://C:/Development/Projects/nmo/branch_2_3/HPP/scripts/HPP_common.yml'.
         Element passed: 'PsiElement(scalar key)' is inside the 'YAML file' which is in 'file://C:/Development/Projects/nmo/branch_2_3/HPP/scripts/HPP_process.yml'
16:54:55 Throwable
         Annotation must be registered for an element inside 'YAML file' which is in 'file://C:/Development/Projects/nmo/branch_2_3/HPP/scripts/HPP_common.yml'.
         Element passed: 'PsiElement(scalar key)' is inside the 'YAML file' which is in 'file://C:/Development/Projects/nmo/branch_2_3/HPP/scripts/HPP_inicjalizacja.yml'
17:01:44 Throwable
         Annotation must be registered for an element inside 'YAML file' which is in 'file://C:/Development/Projects/nmo/branch_2_3/HPP/scripts/HPP_common.yml'.
         Element passed: 'PsiElement(scalar key)' is inside the 'YAML file' which is in 'file://C:/Development/Projects/nmo/branch_2_3/HPP/scripts/HPP_process.yml'
17:01:44 Throwable
         Annotation must be registered for an element inside 'YAML file' which is in 'file://C:/Development/Projects/nmo/branch_2_3/HPP/scripts/HPP_common.yml'.
         Element passed: 'PsiElement(scalar key)' is inside the 'YAML file' which is in 'file://C:/Development/Projects/nmo/branch_2_3/HPP/scripts/HPP_inicjalizacja.yml'

I've opened only HPP_common.yml and HPP_inicjalizacja.yml files, but not HPP_process.yml.

[  15289]  ERROR - emon.impl.AnnotationHolderImpl - IntelliJ IDEA 12.1.7  Build #IU-129.1521
[  15289]  ERROR - emon.impl.AnnotationHolderImpl - JDK: 1.7.0_21
[  15289]  ERROR - emon.impl.AnnotationHolderImpl - VM: Java HotSpot(TM) 64-Bit Server VM
[  15289]  ERROR - emon.impl.AnnotationHolderImpl - Vendor: Oracle Corporation
[  15289]  ERROR - emon.impl.AnnotationHolderImpl - OS: Windows 7
[  15289]  ERROR - emon.impl.AnnotationHolderImpl - Last Action:
[  15289]  ERROR - emon.impl.AnnotationHolderImpl - Annotation must be registered for an element inside 'YAML file' which is in 'file://C:/Development/Projects/nmo/branch_2_3/HPP/scripts/HPP_common.yml'.
Element passed: 'PsiElement(scalar key)' is inside the 'YAML file' which is in 'file://C:/Development/Projects/nmo/branch_2_3/HPP/scripts/HPP_inicjalizacja.yml'
java.lang.Throwable
 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:54)
 at com.intellij.codeInsight.daemon.impl.AnnotationHolderImpl.a(AnnotationHolderImpl.java:147)
 at com.intellij.codeInsight.daemon.impl.AnnotationHolderImpl.createWarningAnnotation(AnnotationHolderImpl.java:78)
...

YamlPsiElements have siblings/references to elements from other files???

I want to validate yaml document structure for jyaml parser (proper qualified classes, properties, etc.).

0
1 comment

Ok, my bad - asking for sibling on PsiFile element returns next PsiFile in the same directory...

0

Please sign in to leave a comment.