use of com.intellij.lang.documentation.DocumentationProvider in project intellij-community by JetBrains.
the class MavenDomTestCase method assertDocumentation.
protected void assertDocumentation(String expectedText) throws IOException {
PsiElement originalElement = getElementAtCaret(myProjectPom);
PsiElement targetElement = DocumentationManager.getInstance(myProject).findTargetElement(getEditor(), getTestPsiFile(), originalElement);
DocumentationProvider provider = DocumentationManager.getProviderFromElement(targetElement);
assertEquals(expectedText, provider.generateDoc(targetElement, originalElement));
// should work for lookup as well as for tags
PsiElement lookupElement = provider.getDocumentationElementForLookupItem(PsiManager.getInstance(myProject), originalElement.getText(), originalElement);
assertSame(targetElement, lookupElement);
}
use of com.intellij.lang.documentation.DocumentationProvider in project intellij-community by JetBrains.
the class HtmlDocumentationProvider method generateDoc.
@Override
public String generateDoc(PsiElement element, PsiElement originalElement) {
final XmlTag tag = PsiTreeUtil.getParentOfType(originalElement, XmlTag.class, false);
String result = generateDocForHtml(element, false, tag, originalElement);
DocumentationProvider styleProvider = getStyleProvider();
if (result == null && styleProvider != null) {
result = styleProvider.generateDoc(element, originalElement);
}
if (result == null && ourScriptProvider != null) {
result = ourScriptProvider.generateDoc(element, originalElement);
}
if (result == null && element instanceof XmlAttributeValue) {
result = generateDocForHtml(element.getParent(), false, tag, originalElement);
}
return result;
}
use of com.intellij.lang.documentation.DocumentationProvider in project intellij-community by JetBrains.
the class HtmlDocumentationProvider method getDocumentationElementForLink.
@Override
public PsiElement getDocumentationElementForLink(PsiManager psiManager, String link, PsiElement context) {
PsiElement result = createNavigationElementHTML(psiManager, link, context);
DocumentationProvider styleProvider = getStyleProvider();
if (result == null && styleProvider != null) {
result = styleProvider.getDocumentationElementForLink(psiManager, link, context);
}
if (result == null && ourScriptProvider != null && !DumbService.isDumb(psiManager.getProject())) {
result = ourScriptProvider.getDocumentationElementForLink(psiManager, link, context);
}
return result;
}
use of com.intellij.lang.documentation.DocumentationProvider in project intellij-plugins by JetBrains.
the class FlexDocumentationTest method testFlexCssProperty.
@JSTestOptions({ JSTestOption.WithCssSupportLoader, JSTestOption.WithFlexFacet })
public void testFlexCssProperty() throws Exception {
DocumentationProvider cssDocumentationProvider = new CssDocumentationProvider();
PsiElement docElement = getDocElementForLookupItem(cssDocumentationProvider, getTestName(false) + ".css");
assertInstanceOf(docElement, JSAttributeNameValuePair.class);
}
use of com.intellij.lang.documentation.DocumentationProvider in project intellij-plugins by JetBrains.
the class FlexDocumentationTest method testFlexCssPropertyMultiDocumentationInLookup.
@JSTestOptions({ JSTestOption.WithCssSupportLoader, JSTestOption.WithFlexFacet })
public void testFlexCssPropertyMultiDocumentationInLookup() throws Exception {
DocumentationProvider cssDocProvider = new CssDocumentationProvider();
String doc = testOne(cssDocProvider, getTestName(false) + ".css", new CssPropertyDescriptorStub("borderColor"));
assertNotNull(doc);
assertTrue("Container's borderColor property missing", doc.indexOf("Container") >= 0);
assertTrue("Button's borderColor property missing", doc.indexOf("Button") >= 0);
assertTrue("UIComponent's borderColor property missing", doc.indexOf("UIComponent") >= 0);
}
Aggregations