コード例 #1
0
  SelfElementInfo(
      @NotNull Project project,
      @Nullable ProperTextRange range,
      @NotNull AnchorTypeInfo info,
      @NotNull PsiFile containingFile,
      boolean forInjected) {
    myForInjected = forInjected;
    myType = info;

    myManager = (SmartPointerManagerImpl) SmartPointerManager.getInstance(project);
    myMarkerCache = myManager.getMarkerCache(containingFile.getViewProvider().getVirtualFile());
    setRange(range);
    myMarkerCache.rangeChanged();
  }
コード例 #2
0
 @Override
 @Nullable
 public Segment getRange() {
   if (hasRange()) {
     Document document = getDocumentToSynchronize();
     if (document != null) {
       PsiDocumentManagerBase documentManager = myManager.getPsiDocumentManager();
       List<DocumentEvent> events = documentManager.getEventsSinceCommit(document);
       if (!events.isEmpty()) {
         return myMarkerCache.getUpdatedRange(
             this, (FrozenDocument) documentManager.getLastCommittedDocument(document), events);
       }
     }
   }
   return calcPsiRange();
 }
コード例 #3
0
 @Override
 @NotNull
 public final VirtualFile getVirtualFile() {
   return myMarkerCache.getVirtualFile();
 }