Description
Not parsing JSDoc seems to unlock significant parsing wins.
Surprisingly, we parse JSDoc unconditionally, even in .ts
files for batch compilation.
So there are a few things I want to investigate here:
-
Can we optimize JSDoc parsing itself? Why is JSDoc parsing so slow in the first place? Even if we decided to always parse JSDoc comments, it should be fast because full time-to-interactivity in the language service is bottle-necked on parse time.
My naive theory is that JSDoc scanning today is "chatty", returning uninteresting tokens, making every request for the next token unnecessarily slow. But of course, this is without benchmarking. I would love to understand what exactly is the issue here.
-
If it's not strictly required, can we make JSDoc parse in a lazier or optional fashion? It seems unavoidable in JavaScript files; but maybe in TypeScript files, JSDoc is only attempted to be attached in cases where we detect that trivia intersects with tag names we're interested in (e.g.
@deprecated
,@see
,@link
, maybe more). Maybe we only do this for the language service.