Пример #1
0
 @Override
 public int hashCode() {
   return ((31 * myVirtualFile.hashCode() + myIndex) * 31
               + (myElementType == null ? 0 : myElementType.hashCode()))
           * 31
       + myLanguage.hashCode();
 }
Пример #2
0
 @Nullable
 public static StubIndexReference createStubReference(
     @NotNull PsiElement element, @NotNull PsiFile containingFile) {
   if (element instanceof StubBasedPsiElement
       && element.isPhysical()
       && (element instanceof PsiCompiledElement || canHaveStub(containingFile))) {
     final StubBasedPsiElement elt = (StubBasedPsiElement) element;
     final IStubElementType elementType = elt.getElementType();
     if (elt.getStub() != null || elementType.shouldCreateStub(element.getNode())) {
       int index = calcStubIndex((StubBasedPsiElement) element);
       if (index != -1) {
         return new StubIndexReference(
             containingFile, index, containingFile.getLanguage(), elementType);
       }
     }
   }
   return null;
 }
Пример #3
0
 private static long pack(int stubId, IStubElementType stubElementType) {
   short index = stubElementType == null ? 0 : stubElementType.getIndex();
   assert index >= 0 : "Unregistered token types not allowed here: " + stubElementType;
   return ((long) stubId) | ((long) index << 32);
 }