* Import of Intl.Locale from #39664
* Handle updating es2020.intl and add es2021 for new DateTimeFormatOptions options - re: #39664
* Extends DateTimeFormatOptions for new Intl APIs - re: #45420
* Handle migrating Intl.NumberFormat.formatToParts to es2018 (keeping esnext.intl around)
* Adds Intl.DisplayNames to es2020 - re: #44022
* Remove attributes added in es2021 from es2020 - re: #42944
* Add a reference to es2021 in the command line parser
* Adds some docs about the lib files
* Baselines
* Allow undefined in Intl inputs to allow for ergonomic usage of exactOptionalPropertyTypes - see #45652
* Adds some tests covering the APIs
* Apply suggestions from code review
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Handle PR feedback
* More review improvements
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Add support for raising if you set a tsconfig entry of target/module with the right setting in the root
* Switch to check for any compiler option in the root which doesn't include compilerOptions
* Get green
* Apply suggestions from code review
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
* Update src/compiler/commandLineParser.ts
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Minor fixes to convertToAsync
* Back out on nested return in inner continuation
* Baseline update
* Verify type argument for call can be used, add a few more early exit shortcuts
* Make getSourceOfProjectReferenceRedirect take a Path
* Add useCaseSensitiveFileNames to ModuleResolutionHost
...so that path comparisons can use it during module resolution.
* Re-enable realpathSync.native for case-insensitive file systems
* fix for 45006
* treat setters like getters in preceding commit; move test accordingly
* fix test baselines
* changes per code review
in `getContainerFlags`, move cases for get/set accessors
to fallthrough into the block that currently handles MethodDeclaration;
so get/set accessors and method declarations all get the same container flags,
such that during `bindContainer`, `startFlow.node` is assigned to
getters/accessors
(this changes a public api in tsserverlibrary.d.ts and typescript.d.ts
by adding `GetAccessorDeclaration` and `SetAccessorDeclaration` to the type
of `FlowStart.node`)
consolidate predicates checking whether a node is either a get or set
accessor, into `isObjectLiteralOrClassExpressionMethodOrAccessor`
(formerly `isObjectLiteralOrClassExpressionMethod`)
annotate updated test with `@target: es2020`
* fix `isObjectLiteralOrClassExpressionMethodOrAccessor`
require that Getter/Setters are parented by an ObjectLiteralExpression or ClassExpression
* 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>
* 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.
* 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
* Add id and version to ManyToManyPathMap
...so that unchanged maps can be recognized without having to examine
their contents.
* Track cache version on BuilderState
In practice, `updateExportedFilesMapFromCache` is called repeatedly
without the cache changing in between. When this occurs, there's no
need to update the `BuilderState` (this was already the net effect, but
it took a long time to determine that no work was required).
* Fix typo in comment
* don't track computed name if symbol has no declaration
* add compiler test
* add non serializable property declaration emit error
* don't track computed name if symbol has no declaration
* fix small stuff
* rebase: add non serializable property declaration emit error
* use symbolToString instead of symbolName
Instead of letting `createTemplate*` generate a broken raw string from
the cooked one, grab the source code for it.
Also, add a missing bit to `\`-quote `$`s. As the comment in the code
says, it could just `\`-quote `${` since other `$`s are valid, but I
think that it's less confusing to always quote $s (but the change is in
the comment if minimalism is preferred).
Also, a small-but-confusing bug in `getCookedText()`.
Many tests for all of this.
Fixes#40625