Search in sources :

Example 1 with CocoaDocumentationManagerImpl

use of com.jetbrains.cidr.CocoaDocumentationManagerImpl in project intellij-plugins by JetBrains.

the class RubyMotionUtilImpl method getMotionDoc.

@Nullable
public String getMotionDoc(PsiElement targetElement, @Nullable Symbol targetSymbol) {
    String descriptionText;
    final MotionSymbol motionSymbol = (MotionSymbol) targetSymbol;
    CocoaDocumentationManagerImpl.DocTokenType type = motionSymbol.getInfoType();
    CocoaDocumentationManagerImpl manager = (CocoaDocumentationManagerImpl) CocoaDocumentationManager.getInstance(targetSymbol.getProject());
    final Symbol parent = targetSymbol.getParentSymbol();
    final String parentName = parent != null ? parent.getName() : null;
    final CocoaDocumentationManagerImpl.DocumentationBean info = manager.getTokenInfo(targetElement, motionSymbol.getInfoName(), Collections.singletonList(Pair.create(parentName, type)));
    descriptionText = info != null ? patchObjCDoc(info.html, motionSymbol) : null;
    return descriptionText;
}
Also used : MotionSymbol(org.jetbrains.plugins.ruby.motion.symbols.MotionSymbol) CocoaDocumentationManagerImpl(com.jetbrains.cidr.CocoaDocumentationManagerImpl) MotionClassSymbol(org.jetbrains.plugins.ruby.motion.symbols.MotionClassSymbol) MotionSymbol(org.jetbrains.plugins.ruby.motion.symbols.MotionSymbol) FunctionSymbol(org.jetbrains.plugins.ruby.motion.symbols.FunctionSymbol) Symbol(org.jetbrains.plugins.ruby.ruby.codeInsight.symbols.structure.Symbol) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

CocoaDocumentationManagerImpl (com.jetbrains.cidr.CocoaDocumentationManagerImpl)1 Nullable (org.jetbrains.annotations.Nullable)1 FunctionSymbol (org.jetbrains.plugins.ruby.motion.symbols.FunctionSymbol)1 MotionClassSymbol (org.jetbrains.plugins.ruby.motion.symbols.MotionClassSymbol)1 MotionSymbol (org.jetbrains.plugins.ruby.motion.symbols.MotionSymbol)1 Symbol (org.jetbrains.plugins.ruby.ruby.codeInsight.symbols.structure.Symbol)1