Support for showing rendered doc comments in editor

Fixed #KT-37361
This commit is contained in:
Igor Yakovlev
2020-03-20 23:20:15 +03:00
parent d620802a18
commit a71fd0e6d9
21 changed files with 419 additions and 131 deletions
@@ -0,0 +1,24 @@
/**
* Hello darling
* @author DarkWing Duck
*/
class testClass
/**
* Hello darling outher
* @author Morgana Macawber
*/
class outherClass {
/**
* Hello darling inner
* @author Launchpad McQuack
*/
inner class innerClass {
}
}
// RENDER: <div class='content'><p>Hello darling</p></div><table class='sections'><tr><td valign='top' class='section'><p>Author:</td><td valign='top'>DarkWing Duck</td></table>
// RENDER: <div class='content'><p>Hello darling outher</p></div><table class='sections'><tr><td valign='top' class='section'><p>Author:</td><td valign='top'>Morgana Macawber</td></table>
// RENDER: <div class='content'><p>Hello darling inner</p></div><table class='sections'><tr><td valign='top' class='section'><p>Author:</td><td valign='top'>Launchpad McQuack</td></table>
@@ -0,0 +1,57 @@
/**
*
* This class has no useful logic; it's just a documentation example.
*
* @param T the type of a member in this class.
* @param X the type of a member in this class.
* @property name is blablabla for name
* @property name2 is blublublu for name2
* @constructor primary ctor for it
*/
class klass<T, X>(val name: String, val name2: String) {
/**
* This method has no useful logic; it's just a documentation example.
*
* @param M the type of a member in this method.
* @param K the type of a member in this group.
* @property[name] is blablabla for name
* @property name2 blublublu for name2
* @throws IndexOutOfBoundsException if something wrong
* @throws ArrayIndexOutOfBoundsException if else something wrong
* @exception java.io.IOException if something else else wrong
* @see method2
* @see method3
* @return [returnMethod] if Duck is Dark
* @author DarkWing Duck
* @suppress something to suppress
* @sample sample
* @sample sample2
*/
fun <M, K> method(name: String, name2: String) {
}
fun method2() {
}
fun method3() {
}
fun returnMethod() {
}
fun sample() {
//this is the sample
}
fun sample2() {
//this is the sample2
}
}
//RENDER: <div class='content'><p>This class has no useful logic; it's just a documentation example.</p></div><table class='sections'><tr><td valign='top' class='section'><p>Params:</td><td valign='top'><p><code>T</code> - the type of a member in this class.<p><code>X</code> - the type of a member in this class.</td><tr><td valign='top' class='section'><p>Properties:</td><td valign='top'><p><code>name</code> - is blablabla for name<p><code>name2</code> - is blublublu for name2</td><tr><td valign='top' class='section'><p>Constructor:</td><td valign='top'>primary ctor for it</td></table>
//RENDER: <div class='content'><p>This method has no useful logic; it's just a documentation example.</p></div><table class='sections'><tr><td valign='top' class='section'><p>Params:</td><td valign='top'><p><code>M</code> - the type of a member in this method.<p><code>K</code> - the type of a member in this group.</td><tr><td valign='top' class='section'><p>Properties:</td><td valign='top'><p><code>name</code> - is blablabla for name<p><code>name2</code> - blublublu for name2</td><tr><td valign='top' class='section'><p>Returns:</td><td valign='top'><a href="psi_element://returnMethod">returnMethod</a> if Duck is Dark</td><tr><td valign='top' class='section'><p>Throws:</td><td valign='top'><p><code><a href="psi_element://IndexOutOfBoundsException"><code>IndexOutOfBoundsException</code></a></code> - if something wrong<p><code><a href="psi_element://ArrayIndexOutOfBoundsException"><code>ArrayIndexOutOfBoundsException</code></a></code> - if else something wrong<p><code><a href="psi_element://java.io.IOException"><code>java.io.IOException</code></a></code> - if something else else wrong</td><tr><td valign='top' class='section'><p>Author:</td><td valign='top'>DarkWing Duck</td><tr><td valign='top' class='section'><p>Suppress:</td><td valign='top'>something to suppress</td><tr><td valign='top' class='section'><p>See Also:</td><td valign='top'><a href="psi_element://method2"><code>method2</code></a>, <a href="psi_element://method3"><code>method3</code></a></td><tr><td valign='top' class='section'><p>Samples:</td><td valign='top'><p><a href="psi_element://sample"><code>sample</code></a><pre><code>//this is the sample</code></pre><p><a href="psi_element://sample2"><code>sample2</code></a><pre><code>//this is the sample2</code></pre></td></table>
@@ -0,0 +1,36 @@
/**
* Hello darling
* @author DarkWing Duck
*/
fun testFun() {}
class outherClass {
/**
* Hello darling instance
* @author Morgana Macawber
*/
fun instanceFun() {
/**
* Hello darling local
* @author Launchpad McQuack
*/
fun localFun() {
if (true) {
/**
* Hello darling superLocal
* @author Reginald Bushroot
*/
fun superLocalFun() {
}
}
}
}
}
// RENDER: <div class='content'><p>Hello darling</p></div><table class='sections'><tr><td valign='top' class='section'><p>Author:</td><td valign='top'>DarkWing Duck</td></table>
// RENDER: <div class='content'><p>Hello darling instance</p></div><table class='sections'><tr><td valign='top' class='section'><p>Author:</td><td valign='top'>Morgana Macawber</td></table>
// RENDER: <div class='content'><p>Hello darling local</p></div><table class='sections'><tr><td valign='top' class='section'><p>Author:</td><td valign='top'>Launchpad McQuack</td></table>
// RENDER: <div class='content'><p>Hello darling superLocal</p></div><table class='sections'><tr><td valign='top' class='section'><p>Author:</td><td valign='top'>Reginald Bushroot</td></table>
@@ -0,0 +1,41 @@
/**
* Hello darling
* @author DarkWing Duck
*/
val prop = 2
/**
* Hello darling var
* @author Megavolt
*/
var prop = 2
class outherClass {
/**
* Hello darling instance
* @author Morgana Macawber
*/
val instanceProp get() {
/**
* Hello darling local
* @author Launchpad McQuack
*/
val localProp get() {
if (true) {
/**
* Hello darling superLocal
* @author Reginald Bushroot
*/
val superLocalProp = 4
}
}
}
}
// RENDER: <div class='content'><p>Hello darling</p></div><table class='sections'><tr><td valign='top' class='section'><p>Author:</td><td valign='top'>DarkWing Duck</td></table>
// RENDER: <div class='content'><p>Hello darling var</p></div><table class='sections'><tr><td valign='top' class='section'><p>Author:</td><td valign='top'>Megavolt</td></table>
// RENDER: <div class='content'><p>Hello darling instance</p></div><table class='sections'><tr><td valign='top' class='section'><p>Author:</td><td valign='top'>Morgana Macawber</td></table>
// RENDER: <div class='content'><p>Hello darling local</p></div><table class='sections'><tr><td valign='top' class='section'><p>Author:</td><td valign='top'>Launchpad McQuack</td></table>
// RENDER: <div class='content'><p>Hello darling superLocal</p></div><table class='sections'><tr><td valign='top' class='section'><p>Author:</td><td valign='top'>Reginald Bushroot</td></table>