* Refactoring so CacheWithRedirects has Key and Value type parameters
* ModuleResolutionCache or TypeRefDirectiveCache will look in directory before solving, so ResolutionCache doesnt need this check
* Test showing module resolution is not shared because resolution cache doesnt update own options
* Enable traceResolution on some of the project reference tests
* Simplify CacheWithRedirects and ensure the options are set in all common scenarios so cache can be shared between redirects
* Make failedlookup etc optional in ResolvedModule/TypeRefefWithFailedLookupLocations
Also make accidental public failed lookup internal
* Add new API for module and type ref resolution
* Store auto type reference resolutions
* Modify test to show how using program partially doesnt report resolution diagnostics
* Ensure that resolution diagnostics are reported in filePreocessingDiagnostics so they can be reused when program is reused
* Some cleanup
* Remove the newly added ReoslutionInfo in favor of new APIs
* update
* fix services' type's isLiteral
* update literal completions tests
* initial prototype
* use symbol to expression. TODO: filter existing, replace import nodes
* WIP
* WIP
* remove booleans from literals
* trigger at case keyword positions
* clean up tests
* fix element access expression case
* refactor dealing with existing values into a tracker
* fix merge errors
* cleanup and more tests
* fix lint errors
* more merge conflict fixes and cleanup
* use appropriate quotes
* small indentation fix
* refactor case clause tracker
* experiment: support tabstops after each case clause
* address small CR comments
* fix completion entry details; add test case
* fix lint errors
* remove space before tab stops; refactor
* Refactoring so CacheWithRedirects has Key and Value type parameters
* ModuleResolutionCache or TypeRefDirectiveCache will look in directory before solving, so ResolutionCache doesnt need this check
* Test showing module resolution is not shared because resolution cache doesnt update own options
* Enable traceResolution on some of the project reference tests
* Simplify CacheWithRedirects and ensure the options are set in all common scenarios so cache can be shared between redirects
* Modify all usages of file name lower casing to use custom lower casing method
* Baseline reuse program structure tests for easy update when making changes to module resolution
* Numeric literal assignable to enum literal only when values match
* Accept new baselines
* Update compiler sources
* Accept new baselines
* Fix test runner
* Any numeric literal type is assignable to a computed numeric enum type
Looking at github, sourcegraph, and internally, nobody appears to use
this factory at all.
It's still used within our testing framework, so I won't remove it, but
we shouldn't be polyfilling globalThis and sticking things onto it these
days.
When bundled, it's very likely that the function "require" will actually
exist at runtime, so we can't use this to determine if we are running in
Node. Consolidate that logic and use other things to check instead.
This is still not perfectly accurate, but I don't want to change this
_too_ much, lest someone downstream depend on our inconsistent logic.
There are yet other places this commit does not fix; search for "typeof
process" for more examples.
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.
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.
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.
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
* fix(51301): keep the line break after removing the unused identifier
* preserve line breaks in import specifiers
* preserve line breaks in parameters and destructuring elements
* remove preserveLineBreak option
* added test case to try to retrieve duplicate refactor as in #50416. 'verify.refactorAvailable' correctly retrieves nonduplicate refactors...
* optional arguments in refactorAvailable return `true` even if there is no single refactor that satisfies both
* it still passes :C
* Delete fixExtractToInnerFunctionDuplicaton.ts
* deleted extra test code
* fix 'verify.refactorAvailable' so that tests correctly check for multiple arguments
* fixes#50416
* refactor