I am struggling to write a types documentation for a module I'm working on and to get VSCode to show things in hover / intellisense.
Take this example:
/**
* @description a complex object
* @property prop1 - a string
* @property prop2 - a number argument
*/
interface myObj {
/** string prop1 */
prop1: string;
prop2?: number;
[key: string]: any
}
interface myfunc {
/**
* @description method description
* @argument foo The first argument
* @argument {myObj} bar
*/
some_method: (
/** simple string argument */
foo : string,
/** how to get this to display the description above? */
bar : myObj
) => void
}
What's working:
- Hovering over
some_methodin either.jsor.tsI get the three line description & arg comments CTRL+SHFIT+SPACEwhile over the first argument gives me thesimple string argumenthelp- Opening an Object as the second argument and hitting
CTRL+SPACEsuggestsprop1andprop2 - Hovering over
prop1inside the second argument gives mestring prop1
What isn't working:
The problem I'm having is how do I get the whole description block for myObj displayed when I hit CTRL + SHFIT + SPACE while inside the object of the second argument? It would be super helpful for this kind of argument where there are some predefined properties like prop1 and prop2 but it also allows the user to add any other keys, to have the markdown supported description of myObj displayed.
The moment I add any @ decorators in the comment line above bar : myObj in the myfunc interface VS Code doesn't display anything anymore. And if I want to reuse the myObj interface in other methods, it of course doesn't make sense to use that inline documenting style like simple string argument repeatedly in the code (and it doesn't solve the one line, no markdown problem either).