* Add tests where typeRef resolution is not in the cache
* Ensure that type ref reuse is actually handled since type ref resolution only sends containingSourceFileMode and not containingSourceFile
* Remove unnecessary redirection now that we are not in namespaces
* Move the tsc helpers in one place
* Move virtual file system with watch in unittests folder instead of harness since harness doesnt use it anyways
* Replace protocol and commandNames
* Revert incorrect pick
In namespaces, we'd have access to a variable named "ts" when debugging,
because that was just the ts namespace in the current file. But when
modules, that variable doesn't exist, either because we are pure modules
(so no ts variable), or named something else (when bundled, for export).
Tack a "ts" object onto the globals, which should make this easier. Of
course, someone may eventually declare a variable in the top level scope
named "ts" and break this, but we can cross that bridge when we come to
it.
This configures the existing build tasks to use esbuild by default. If
using the plain files is desired, passing `--bundle=false` will build
using plain files and still produce a runnable system.
This is only a basic build; a more efficient build is provided later
when gulp is replaced by hereby.
Although the existing require calls would work fine, it's more
consistent to make them actual imports and let them be converted at
compile/bundle time. It also lets us emit ESM if needed.
There are still conditional requires present for things like the node
System, but that's a more difficult problem to solve.
Now that we are modules, there's no reason to ban multiple namespaces
per file; each file is its own scope and declaring a namespace won't
merge it into any other files.
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.
* Test showing wrong resolution is returned because of incorrect mode calculation
Test for #48229
* Pass in information for the module name resolution when resolutions from file are partially used
Fixes#48229
* Make the resolution info complete
* Add different tests for baselining before behavior
* Fix assert for first project output
* Add ability to pass declaration, declarationMap, emitDeclarationOnly, sourceMap and inlineSourceMap on commandline of --build
* Store these options in --out scenario
* Store buildInfo program for --out even if not composite
* Changes to make these commanline options work
* Do not include sourceMapUrl text in the sourceFile version
* Emit complete program in --out scenario as well since we need to determine uptodate ness
* Copy js or dts bundle from old build if emitting only js or dts files
* Dont emit dts if we want to emit only js files even though options suggest emitting d.ts files as well
* Adding comments and refactoring some of the code
* Convert some of the tests to baselines
* There is no use of creating reference map with --out since its not used anyways.
The changes to affectedFileList returned should be intended since --out needs saving just one file for correct output and not both
* Add test that fails
* Handle impliedNodeFormat when handling sourceFileCache
Fixes#50872
* Revert the fix
* Make sure impliedNodeFormat is set for the sourceFile
* Revert "Make sure impliedNodeFormat is set for the sourceFile"
This reverts commit 651a47fdd6ea200e59fdf150dfa913230a86653a.
* Revert "Revert the fix"
This reverts commit 5c98b9cfc1f275877d8d57a60f8f28a5c8d08157.
* Swap the keys for map
* Add test where current plugins dont get reset when reloading config file
* Reset loaded plugins when reloading configured project and closing project
* Add test
* During uptodate ness check, with buildInfo, check if there are errors in the program to determine uptodateness
Fixes#50959
* Comment update
* WIP
* implement typequery contains reference check + tests
* add unit test
* fix unit test
* use symbols in scope to check type query type parameter references
* remove comment on unit test
* remove comment
* use isNodeDescendantOf implementation to check scoping
* CR: small fixes
* treat the different kinds of type parameter declarations
* undo test change
* Add test for node16 resolution with package json lookup making casing incorrect
* Handle more places where package direcroy is converted to canonical file path
* Some more formatting to have baselines similar to what we have in tsserver.log
* Some refactor
* Baselines
* Baseline host details on each request
* More formatting per tsserver log
* More baselining of host state
* Update Baselines and/or Applied Lint Fixes
* Use utc time in logger for baselines
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
* Remove unnecessary parameter
* Dont store name unnecessarily in the watchers
* Polled watches and not files
* Use fs events as default watching
* Some refactoring
* Make single per directory native watchers now that we are using it as default
* Rename
* Comment
* Add test to show how scope messes with casing
* Do not canonicalize the file names when getting absolute paths
Fixes#50544
* Unnecessary exports
* Add test for self referencing package
* Fix self reference package with casing
* 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>