* Simple first version
Doesn't cover or test any complicated variations.
* Lots of cases work
Destructuring does not. But
- skipping node_modules and lib.* does.
- call expressions does
- property access, including with private identifiers, does
* Support variable declarations, property assignments, destructuring
As long as it's not nested
* More cleanup
* skip all d.ts, not just node_modules/lib
* Offer a codefix for a lot more cases
* remove incorrect tuple check
* Use getSymbolId instead of converting to string
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
* add test + switch to tracking number symbol ids
* Address PR comments
* Exclude tuples from suggestion
* Better way to get error node
Plus add a check that errorNode is an argument to the call, not the
call's expression.
* fix semicolon lint
* fix another crash
* Simplify: add undefined to all optional propertie
whether or not somebody tried to assign undefined to them in the
erroneous assignment
* remove fix-all
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
* Update tsc-instrumented for project build
loggedIO has a weird build that never got updated for the project build
system. This PR just adds a project for it in a straightforward way. It
might be less efficient than the old way, but that's not a big concern
for recording RWC test cases.
However, I may have done things wrong. If anybody knows
tsc-instrumented, please comment.
* Create a second loggedIO tsconfig for tsc-instrumented
The normal tsconfig should not have `prepend`; the standalone one for
tsc-instrumented should.
* fix semicolon lint
When a class declaration lacks a name, don't throw an exception when
producing the display parts (e.g. for QuickInfo).
Remaining issues:
1. The name shows as "__missing", the name of the underlying symbol,
rather than "(Missing)", as it is for the corresponding function
declaration case (because the parse constructs a missing identifier
node for the function declaration).
2. "(Missing)" is hard-coded, rather than being a localizable resource
string.
3. When an anonymous class declaration is a default export, the
corresponding symbol is named "default", resulting in the confusing
display string "class default".
Since display parts are built using existing `symbolToString`
functionality, it wasn't clear whether detecting special symbol names
and replacing them with user-friendly strings could be done without
breaking other functionality.
Similarly, changing the shape of the parse tree seemed riskier than the
problem justified (the user experience is just not getting QuickInfo for
the incomplete declaration, which seems acceptable).
* Fix check in hasNonBindingPatternContextualTypeWithNoGenericTypes
* Add regression tests
* Accept new baselines
* Compute both ObjectFlags.IsGenericXXXType flags in one go
* WIP on refining the new --help
* Fix types in the boolean trivial lint rule
* Update baselines
* More work
* Updates the color logic
* Simplifies the CLI color code
* Use cyan instead of blue for win powershell/command prompt
* Use bright white when blue is probably going to look off
* Fix NO_COLOR
* Adds a test to cover NO_COLOR
* Update src/compiler/diagnosticMessages.json
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Update compiler diagnostic text
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
1. `getRawLiteral()`: barf if `currentSourceFile` is missing, since if
it is, then the following `getSourceTextOfNodeFromSourceFile` will
return a bogus `""`.
2. One `||` -> `??` change.
3. `backtickQuoteEscapedCharsRegExp`: escape the usual control
characters except for a simple LF. This code does get used to
generate backtick strings when `rawText` is not given, and not
escaping things like TAB characters can get mangled by editor
settings. Worse, not escaping a CRLF and putting it verbatim in sthe
string source will interpret it as LF, so add a special case for
escaping these as `\r\n`.
Added test.
Related to #44313 and #40625.