Closed iscekic closed 8 years ago
Yeah, currently I'm working to support TypeScript.
@Torwori Could you try https://github.com/heavenshell/vim-jsdoc/tree/feature_typescript branch?
I'll check it out tomorrow after work, sorry for the delay.
On Tue, Aug 30, 2016, 16:39 Shinya Ohyanagi notifications@github.com wrote:
@Torwori https://github.com/Torwori Could you try https://github.com/heavenshell/vim-jsdoc/tree/feature_typescript branch?
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/heavenshell/vim-jsdoc/issues/60#issuecomment-243461968, or mute the thread https://github.com/notifications/unsubscribe-auth/AD38HFJeNxiNzw2vzrOaHbK64KzkZQ-Yks5qlEC7gaJpZM4Ju7d5 .
Hey, just tried it out, seems to be working ok. :+1:
It would be even better if it automatically read types from the function signature, but if that's too much of a hassle then this is good enough.
@Torwori Thx for your feedback!
It would be even better if it automatically read types from the function signature,
Could you explain me more?
function foo(foo: string): string {
return 'foo'
}
This would be like following.
/**
* foo
*
* @param {string} foo
* @returns {string}
*/
function foo(foo: string): string {
return 'foo'
}
{string}
are read from signature.
let g:jsdoc_allow_input_prompt = 1
let g:jsdoc_input_description = 1
let g:jsdoc_additional_descriptions = 1
let g:jsdoc_access_descriptions = 2
let g:jsdoc_underscore_private = 1
let g:jsdoc_enable_es6 = 1
These are the settings I used, I had to enter the types manually.
@Torwori Thx. I'll start investigation.
@Torwori
let g:jsdoc_enable_es6 = 1
let g:jsdoc_allow_input_prompt = 1
let g:jscoc_return = 1
let g:jsdoc_input_description = 1
let g:jsdoc_access_descriptions = 2
let g:jsdoc_underscore_private = 1
function foo(foo: string = 'foo', bar: number = 1): string {
return 'foo'
}
/**
* Foo
*
* @public
* @param {string} foo foo description
* @param {number} bar bar description
* @returns {string} foo string
*/
function foo(foo: string = 'foo', bar: number = 1): string {
return 'foo'
}
Looks good to me.
Hit tab key when Argument "foo" type:
shows then output typed candidates.
Ah, I didn't know you could press tab. :+1:
@Torwori Thx. Merged to master.
JsDoc doesn't appear if cursor on line like public someFunc() : void
@xahon
https://github.com/heavenshell/vim-jsdoc/blob/master/test/test.ts#L36
open above file and execute :JsDoc
.
/**
* baz
*
* @param {string} [arg1='foo']
* @param {number} [arg2=100]
* @returns {void}
*/
public baz(arg1: string = 'foo', arg2: number = 100): void {
}
It seems works fine.
It'd be nice if the plugin had typescript support (automatically detect types for parameter and return value, if specified).