Commit graph

4 commits

Author SHA1 Message Date
Nathan Shively-Sanders 1e48cbe2c9
Fix jsdoc comment parsing initial state (#36661)
* Fix jsdoc comment parsing initial state

Jsdoc comment parsing can be invoked in two modes:

1. top-level parsing, for comments not inside a tag.
2. tag parsing, for comment that occur after the semantic parts of a
tag.

Top-level parsing skips an initial * because it assumes that it is starting
at the very beginning of a JSDoc comment. Tag parsing does not.

The two modes are distinguished by an optional second parameter named
`margin`. When `margin` is provided, it provides an initial indent used
for comment alignment.

Previously, the check for `margin` was a truthy check `if (margin)`.
This check incorrectly treats `margin=""` the same as
`margin=undefined`.

This PR changes the check to `if (margin !== undefined)`, which
correctly treats `margin=""` the same as `margin="    "`.

* Fixes for broken tests

1. Use SawAsterisk start state.
2. @template needs to skip asterisk in addition to whitespace while
parsing type parameter names.

* undo code move
2020-02-07 08:35:40 -08:00
Mohamed Hegazy 069c10ca83 Use baselines for quick info tests to ease updates 2016-09-08 12:55:58 -07:00
Cyrus Najmabadi eed6f0deca Use an output format for quickinfo that more closely matches the original source.
i.e. use  "var v: string" instead of "(var) v: string".

The parens case should only be used when we're using an english description instead of
an actual language construct.
2015-03-24 00:16:49 -07:00
Sheetal Nandi 1d86376304 Test for parmaeters 2014-11-21 00:48:30 -08:00