* `const` modifier on type parameters + revised contextual type logic
* Accept new baselines
* Fix modifier checking
* Add tests
* Cache isConstTypeVariable check
* Revert "Cache isConstTypeVariable check"
This reverts commit f8fd1fd29f7975fcc3aeac8675c2cb107da33065.
* Fewer isConstTypeParameterContext checks
* Pay attention to cached `undefined` contextual type
* Allow `const` modifier in more places + properly print back
* Also permit `const` in method signature type parameters
* Fix parsing of `const` modifier in array expression type parameters
* Accept new baselines
* Remove unused properties from NodeLinks
* Rename `permitInvalidConstAsModifier` to `permitConstAsModifier`
* Add support for JSDocOverloadTag
* Use overload tag to determine function type
* Update baselines
* Add new tests along with baselines
* Add tests for all @overload tags in one comment
* Add tests for find-all-ref and rename operations
* Add tests for alternative uses of @overload tag
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Move .symbol to Declaration
* simplify some factories
* Move localSymbol to Declaration
* Ensure JSDocContainer types are properly initialized
* Move contextualType from Node to NodeLinks
* Move 'locals' and 'nextContainer' out of Node
* Move 'flowNode' out of 'Node'
* Pre-define endFlowNode/returnFlowNode
* Pre-define some SourceFile properties and a more stable cloneNode
* Don't add excess properties to type nodes in typeToTypeNode
* Refactor wrapSymbolTrackerToReportForContext to improve perf
* feat(49323): add support throws jsdoc tag
* change "name" to "typeExpression". parse "exception" as a synonym for "throws"
* include typeExpression from the throws tag in the quick info
* add JSDocThrowsTag to ForEachChildNodes
This adds a "small" d.ts bundler script. This script is very basic,
using Node printing to produce its output. Generally speaking, this is
inadvisable as it completely disregards name shadowing, globals, etc.
However, in our case, we don't care about the globals, and we can opt to
restructure our codebase in order to avoid conflict, which we largely
had to do anyway when we were namespaces and everything was in scope.
If these are regular comments, then they won't appear in our d.ts files.
But, now we are relying on an external d.ts bundler to produce our final
merged, so they need to be present in the "input" d.ts files, meaning
they have to be JSDoc comments.
These comments only work today because all of our builds load their TS
files from scratch, so they see the actual source files and their
non-JSDoc comments.
The comments also need to be attached to a declaration, not floating,
otherwise they won't be used by api-extractor, so move them if needed.
This step converts as many explicit accesses as possible in favor of direct imports from the modules in which things were declared. This restores the code (as much as possible) back to how it looked originally before the explicitify step, e.g. instead of "ts.Node" and "ts.Symbol", we have just "Node" and "Symbol".
This step converts each file into an exported module by hoisting the namespace bodies into the global scope and transferring internal markers down onto declarations as needed.
The namespaces are reconstructed as "barrel"-style modules, which are identical to the old namespace objects in structure. These reconstructed namespaces are then imported in the newly module-ified files, making existing expressions like "ts." valid.
* Remove language version check for extended escapes.
* Accepted baselines.
* Record whether nodes have extended Unicode escapes. Replace them in the es2015 transform.
* Accepted baselines.
* Move file to better-reflect generality of tests.
* Added tests for variables at the top level.
* Accepted baselines.
* Added test for extended astral character.
* Accepted baseline.
* Enable sourcemaps in tests.
* Accepted baselines.
* Call `setOriginalNode` on identifiers with extended escapes.
* Add tests for identifiers and private identifiers with escape sequences.
* Accepted baselines.
* Store the tokenValue instead of tokenText on PrivateIdentifiers, since the latter can contain escapes and lead to semantic discrepancies.
* Accepted baselines.
* Check for leading escape sequences in PrivateIdentifiers.
* Accepted baselines.
* Fix lints.
* feat(7481): add explicit type compatibility check with 'satisfies' expression
* Add failing test for lack of intersectioned contextual type
* Implement the behavior
* Add test corresponding to the 'if'
* Add test based on defined scenarios
* remove isExpression in favor of using type casting
* move tests from compiler to conformance folder
* update baseline
* add missing contextFlags argument
* use asserted type
* accept baseline
Co-authored-by: Ryan Cavanaugh <ryanca@microsoft.com>
* Swap `forEachChild` to use an array of functions instead of a `switch` statement.
* Let's see if 'new' changes anything.
* Co-locate each assignment into `forEachChildTable`.
* Try `push`ing undefined to create a packed Array.
* Try using an unconditional no-op function.
* `forEach` -> `forEachChildIn`
* Remove the optional chain if we are pre-filling with no-ops.
* Grab function directly to avoid possible `.call` overhead from downlevel emit.
* Swap to object literal.
* Lints and formatting.
* Change type of deprecated 'decorators' property
* fix 'Invalid Arguments' error for create/update constructor in factory
* Update deprecation comments
* Make 'decorators' optional and 'undefined'
* Rename '_decorators' to 'illegalDecorators'
* Update baselines
* Add test where module resolution cache is not local and hence doesnt report errors in watch mode
* Ensure module resolution cache is passed through in watch mode
* Remove unnecessary setting of impliedFormat which should anyways be done as part of create source file
* Add test for packge.json changing and modifying implied format
* Distinguish between package.json watch and affecting file location watch
* Pass in failed lookup and affected file locations for source file's implied format
Also stop creating options if we already have them
* Add diagnostic for explaining file's implied format if based on package.json
* Watch implied format dependencies for modules and schedule update on change
* For program if implied node format doesnt match create new source file. Handle implied node format in document registry
Fixes#50086
* Modify tests to show package.json being watched irrespective of folder its in
* Check file path if it can be watched before watching package.json file
* Because we are watching package.json files and failed lookups its safe to invalidate package json entries instead of clearing them out everytime program is created
* Remove todos
* Fix the incorrect merge
* Pickup PackageJsonInfo renames from #50088
* Rename
* Allow instantiation expression to be followed by let or interface on new line
* Add tests
* Update src/compiler/parser.ts
* Instantiation expressions followed by line breaks or binary operators
* Add more tests
* Accept new baselines
* Fix lint error
* Update fourslash test
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Merge 'decorators' into 'modifiers' on various Nodes
* Drop RESERVED argument in favor of removing parameter
* Ignore grammar error nodes when asserting invariants
* Revert 'illegalX' property renames
* PR Feedback