You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The services part of the Typescript API is not intended for semantic analysis, but for display. Parameter optionality is displayed on signature help, not on the parameter tag.
I'd recommend using the compiler part of the Typescript API, like so:
// existing code ..constsymbol=exports[0]constparams=ts.getALLJSDocTagsOfKind(symbol.valueDeclaration,ts.SyntaxKind.JSDocParameterTag)asts.JSDocParameterTag[]for(constpofparams){p.isBracketed// inspect other properties of the tag here...}
The compiler API exposes the parse tree and is intended to answer syntactic and semantic questions. It's more appropriate if you're not building an editor.
thank you very much, the compiler API it seems much more appropriate for what I am building. Will try to switch and will close all my jsdoc-related suggestions.
Any pointers for docs on the jsdoc compiler API?
Our documentation isn't very good, but the API isn't too complicated? The main wrinkle is that, say, getJSDocTags takes a node that you're interested in and the API provides you with all related tags, even those that aren't directly attached to that node.
Suggestion
Optional jsdoc parameters are currently lost on
@param
: https://jsdoc.app/tags-param.html🔍 Search Terms
jsdoc optional params
⭐ Suggestion
Please allow for optional params parsing
currently parses to tags:
Possible suggestions:
optional
,📃 Motivating Example
example test to reproduce https://github.com/atanasster/ts-issues/blob/master/tests/optional-param.test.ts
The text was updated successfully, but these errors were encountered: