Force documentation string to be interpreted as javadoc

I've overriden generateDocgetDocumentationElementForLookupItem in my custom AbstractDocumentationProvider

 

I am showing documentation for yaml keys. But I need the documentation to be interpreted as Java doc such that user can navigate to the right java class form the quick documentaion window.

 

However, the quick window is interpretting javadoc {@link Class} as plain text instead of javadoc.

 

Is there a to force intellij to interpret the suggestion as javadoc instead?

0
4 comments

You can create links in documentation you provide by using a special URL type. See DocumentationManagerProtocol, DocumentationManagerUtil and DocumentationProvider#getDocumentationElementForLink.

0
Avatar
Permanently deleted user

Thanks.. That solved the issue.

 

I'm using this to build links instead of javadoc version

StringBuilder buffer = new StringBuilder();
DocumentationManager.createHyperlink(buffer, type, type, false);
String finalDocumentation = buffer.toString();

 

0
Avatar
Permanently deleted user

There seems to be issues with the approach I followed.

Though java navigation works fine for Simple types, it has problems with the following scenarios

1. if type refers to an inner class, navigation is not working

type = "a.MyClass$Inner"

2. If the type mentioned is have generic arguments, i,.e 

type = "a.MyClass<CustomEntity>"

The documentation window only shows this as a.MyClass

Would appreciate if there are any workaround w.r.t these two corner cases. Thanks

0
  1. Try to use "a.MyClass.Inner" instead.
  2. That's expected, it works in the same way if you request 'quick documentation' for usage of a class with generic argument in a Java file. Documentation is shown for MyClass<T> like in its original definition.
0

Please sign in to leave a comment.