本文整理汇总了Java中com.intellij.psi.SmartPsiFileRange类的典型用法代码示例。如果您正苦于以下问题:Java SmartPsiFileRange类的具体用法?Java SmartPsiFileRange怎么用?Java SmartPsiFileRange使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SmartPsiFileRange类属于com.intellij.psi包,在下文中一共展示了SmartPsiFileRange类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ShredImpl
import com.intellij.psi.SmartPsiFileRange; //导入依赖的package包/类
ShredImpl(@Nonnull SmartPsiFileRange relevantRangeInHost,
@Nonnull SmartPsiElementPointer<PsiLanguageInjectionHost> hostElementPointer,
@Nonnull String prefix,
@Nonnull String suffix,
@Nonnull TextRange rangeInDecodedPSI,
boolean usePsiRange,
boolean isOneLine) {
this.hostElementPointer = hostElementPointer;
this.relevantRangeInHost = relevantRangeInHost;
this.prefix = prefix;
this.suffix = suffix;
this.rangeInDecodedPSI = rangeInDecodedPSI;
this.usePsiRange = usePsiRange;
this.isOneLine = isOneLine;
assertValid();
}
示例2: withRange
import com.intellij.psi.SmartPsiFileRange; //导入依赖的package包/类
@Nonnull
ShredImpl withRange(@Nonnull TextRange rangeInDecodedPSI, @Nonnull TextRange rangeInHostElementPSI, @Nonnull PsiLanguageInjectionHost newHost) {
SmartPsiFileRange rangeMarker = relevantRangeInHost;
Segment oldRangeInHostElementPSI = calcRangeInsideHostElement(false);
SmartPointerManager pointerManager = SmartPointerManager.getInstance(rangeMarker.getProject());
SmartPsiElementPointer<PsiLanguageInjectionHost> newHostPointer = pointerManager.createSmartPsiElementPointer(newHost);
if (!rangeInHostElementPSI.equals(TextRange.create(oldRangeInHostElementPSI))) {
Segment hostElementRange = newHostPointer.getRange();
rangeMarker =
((SmartPointerManagerImpl)pointerManager).createSmartPsiFileRangePointer(rangeMarker.getContainingFile(), rangeInHostElementPSI.shiftRight(hostElementRange.getStartOffset()), true);
}
return new ShredImpl(rangeMarker, newHostPointer, prefix, suffix, rangeInDecodedPSI, usePsiRange, isOneLine);
}