* 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.
Make it backslash-escape backticks too. While I was there, remove the
use of this function for the text (which was the earlier confused
version that used only `text`), and rename it as
`escapeRawStringForTemplate` to clarify.
Added a test to the preivious pile of tests.
Fixes#45278.
* Fix getting completion details for meta properties.
* Move inside the worker.
* Move ImportMeta handling to completions.ts
* Fix property type name for new.target.
* Use symbols for ImportMeta completions.
* Accept baselines.
* Revert lib change.
* Revert needless parser change.
* Missed these reverts.
* Remove now unused `isMetaPropertyExpression`
* Move up meta property keyword check to be done in `getSymbolAtLocation` and `getTypeOfNode`
* Call `checkNewTargetMetaProperty` directly and handle when it's an error type.
* Make meta property expression types synthetic.
* Make event.target and import.meta properties readonly
* Add a test for go to definition (I think?)
* Copy built-in types/values test for go to definition.
* Add tests for go to definition when not a module.
* Fix "go to definition" for new.target
* Visit children of jsdoc type aliases in the binder
This sets up parent pointers.
Fixes#45254 and almost certainly #45248, though I haven't figured out
to repro the second case.
* move incorrect parenthesis
* manually set comment parent instead
* Bind children of typedef where possible
* add explanatory comment to binding
* Do not classify Infinity and NaN. Fixes#42022
* Internally expose so that the classifier can use it
* Increase the test complexity, and revert the type-checker
* Drop the -Infinity
Co-authored-by: Orta <git@orta.io>