-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
Description
Input Code
For example, if you want to output usable JSDoc to integrate with TypeScript:
###*
# @param a {string}
###
method1 = (a) ->
###*
# @param b {string}
###
method2 = (b) ->
Expected Behavior
var method1, method2;
/**
* @param a {string}
*/
method1 = function(a) {};
/**
* @param b {string}
*/
method2 = function(b) {};
Current Behavior
/**
* @param a {string}
*/
/**
* @param b {string}
*/
var method1, method2;
method1 = function(a) {};
method2 = function(b) {};
Possible Solution
Possible current workaround (pretty ugly):
method1 = method2 = null
#
###*
# @param a {string}
###
method1 = (a) ->
#
###*
# @param b {string}
###
method2 = (b) ->
Alternatively, you can of course do inline typed params
method1 = (###* @type string ### b) ->
but this is not always a feasible solution of course
Context
Besides, should we maybe update the docs to state the possiblity of type-checking via JSDoc+TS? I know there is a TypeScript discussion issue going on in #5307 but this jsdoc thing is already possible.
- How has this issue affected you? What are you trying to accomplish? *
I am currently exploring building a basic CS LSP implementation based on piping CS compiler output to TSC, bundled in a VSCode extension. It works pretty well so far, I'll post in the other thread soon (edit: POC / WIP here
Kristinita