@Override @Nullable public SmartPointerElementInfo createElementInfo(@NotNull PsiElement element, @NotNull PsiFile containingFile) { if (element instanceof StubBasedPsiElement && containingFile instanceof PsiFileWithStubSupport) { PsiFileWithStubSupport stubFile = (PsiFileWithStubSupport)containingFile; StubTree stubTree = stubFile.getStubTree(); if (stubTree != null) { // use stubs when tree is not loaded StubBasedPsiElement stubPsi = (StubBasedPsiElement)element; int stubId = PsiAnchor.calcStubIndex(stubPsi); IStubElementType myStubElementType = stubPsi.getElementType(); IElementType contentElementType = ((PsiFileImpl)containingFile).getContentElementType(); if (stubId != -1 && contentElementType instanceof IStubFileElementType) { // TemplateDataElementType is not IStubFileElementType return new AnchorElementInfo(element, stubFile, stubId, myStubElementType); } } } PsiElement anchor = getAnchor(element); if (anchor != null) { return new AnchorElementInfo(anchor, containingFile); } return null; }
@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; }
public LuaGlobalDeclarationStubImpl(@Nullable StubElement parent, IStubElementType elementType, @Nullable StringRef name, @Nullable StringRef module, byte[] type, LuaType luaType) { super(parent, elementType, name); myModule = module; myType = type; this.luaType = luaType; }
SchemaTypeDefStubBaseImpl(StubElement parent, final IStubElementType elementType, final String name, final String namespace, @Nullable final List<SerializedFqnTypeRef> extendsTypeRefs) { super(parent, elementType); this.name = name; this.namespace = namespace; this.extendsTypeRefs = extendsTypeRefs; }
AnchorElementInfo(@NotNull PsiElement anchor, @NotNull PsiFileWithStubSupport containingFile, int stubId, @NotNull IStubElementType stubElementType) { super(containingFile.getProject(), new ProperTextRange(0, 0), anchor.getClass(), containingFile, containingFile.getLanguage(), false); myStubElementTypeAndId = pack(stubId, stubElementType); assert !(anchor instanceof PsiFile) : "FileElementInfo must be used for file: "+anchor; }
private StubIndexReference(@NotNull final PsiFile file, final int index, @NotNull Language language, IStubElementType elementType) { myLanguage = language; myElementType = elementType; myVirtualFile = file.getVirtualFile(); myProject = file.getProject(); myIndex = index; }
public PyFromImportStatementStubImpl(QualifiedName importSourceQName, boolean isStarImport, int relativeLevel, final StubElement parent, IStubElementType elementType) { super(parent, elementType); myImportSourceQName = importSourceQName; myStarImport = isStarImport; myRelativeLevel = relativeLevel; }
public PyClassStubImpl(final String name, StubElement parentStub, final QualifiedName[] superClasses, @Nullable QualifiedName metaClass, final List<String> slots, String docString, IStubElementType stubElementType) { super(parentStub, stubElementType); myName = name; mySuperClasses = superClasses; myMetaClass = metaClass; mySlots = slots; myDocString = docString; }
public PyNamedParameterStubImpl(String name, boolean isPositionalContainer, boolean isKeywordContainer, boolean hasDefaultValue, StubElement parent, IStubElementType stubElementType) { super(parent, stubElementType); myName = name; myPositionalContainer = isPositionalContainer; myKeywordContainer = isKeywordContainer; myHasDefaultValue = hasDefaultValue; }
public PyFunctionStubImpl(final String name, final String docString, @Nullable final StringRef deprecationMessage, boolean isAsync, final StubElement parent, IStubElementType stubElementType) { super(parent, stubElementType); myName = name; myDocString = docString; myDeprecationMessage = deprecationMessage; myAsync = isAsync; }
public GrImportStatementStub(StubElement parent, @NotNull IStubElementType elementType, @Nullable String referenceText, @Nullable String aliasName, byte flags) { super(parent, elementType); myFlags = flags; myReferenceText = referenceText; myAliasName = aliasName; }
SchemaRecordTypeDefStubImpl(StubElement parent, String name, String namespace, @Nullable final List<SerializedFqnTypeRef> extendsTypeRefs, @Nullable final List<SerializedFqnTypeRef> supplementedTypeRefs) { super(parent, (IStubElementType) SchemaElementTypes.S_RECORD_TYPE_DEF, name, namespace, extendsTypeRefs); this.supplementedTypeRefs = supplementedTypeRefs; }
public PsiTypeImpl(@NotNull MlTypes types, PsiTypeStub stub, IStubElementType nodeType) { super(stub, nodeType); m_types = types; }
public PsiLetImpl(@NotNull PsiLetStub stub, @NotNull IStubElementType nodeType) { super(stub, nodeType); }
public PsiModuleImpl(ModuleStub stub, IStubElementType nodeType) { super(stub, nodeType); }
public PsiLetStub(StubElement parent, @NotNull IStubElementType elementType, String name) { super(parent, elementType, name); }
public PsiLetStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name) { super(parent, elementType, name); }
public PsiTypeStub(StubElement parent, @NotNull IStubElementType elementType, String name) { super(parent, elementType, name); }
public PsiTypeStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name) { super(parent, elementType, name); }
public ModuleStub(StubElement parent, @NotNull IStubElementType elementType, String name, ModulePath modulePath) { super(parent, elementType, name); m_modulePath = modulePath; }
public ModuleStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, ModulePath modulePath) { super(parent, elementType, name); m_modulePath = modulePath; }
public AtParamMixin(AtParamStub stub, IStubElementType type) { super(stub, type); }
public NamespaceDeclarationMixin(NamespaceDeclarationStub stub, IStubElementType type) { super(stub, type); }
public TemplateDefinitionMixin(TemplateDefinitionStub stub, IStubElementType type) { super(stub, type); }
public SoyStubBasedPsiElementBase(@NotNull T stub, @NotNull IStubElementType nodeType) { super(stub, nodeType); }
public TemplateBlockMixin(TemplateBlockStub stub, IStubElementType type) { super(stub, type); }
public static IStubElementType<?, ?> getType(String elementName) { return stubTypeByElement.get(elementName); }
@NotNull @Override public IStubElementType getElementType() { return LuaElementTypes.GLOBAL_NAME_DECL; }
public SchemaNamespaceDeclImpl(SchemaNamespaceDeclStub stub, IStubElementType type) { super(stub, type); }
SchemaPrimitiveTypeDefStubImpl(StubElement parent) { super(parent, (IStubElementType) SchemaElementTypes.S_PRIMITIVE_TYPE_DEF); }
protected LuaStubElementBase(final T stub, IStubElementType nodeType) { super(stub, nodeType); }
SchemaTypeDefWrapperStubImpl(StubElement parent) { super(parent, (IStubElementType) SchemaElementTypes.S_TYPE_DEF_WRAPPER); }
public FusionStubbedElementImpl(@NotNull StubT stub, @NotNull IStubElementType nodeType) { super(stub, nodeType); }
public FusionStubbedNamedElementImpl(@NotNull StubT stub, @NotNull IStubElementType nodeType) { super(stub, nodeType); }
public FusionPrototypeSignatureImplMixin(@NotNull FusionPrototypeSignatureStub stub, @NotNull IStubElementType nodeType) { super(stub, nodeType); }
public FusionNamespaceDeclarationImplMixin(@NotNull FusionNamespaceDeclarationStub stub, @NotNull IStubElementType nodeType) { super(stub, nodeType); }
public GroupNode(GroupStub stub, IStubElementType type) { super(stub, type); }
DataTypeStub(StubElement parent, IStubElementType<?, T> type, String fullName, String name) { super(parent, type, name); this.fullName = fullName; }
public SchemaSupplementDefImpl(SchemaSupplementDefStub stub, IStubElementType type) { super(stub, type); }
SchemaPrimitiveTypeDefImplBase(@NotNull SchemaPrimitiveTypeDefStub stub, @NotNull IStubElementType nodeType) { super(stub, nodeType); }