34040 Commits

Author SHA1 Message Date
Jake Bailey
2d2a4343b8
Reformat imports to be one identifier per line (#51565) 2022-11-17 13:42:18 -08:00
Jake Bailey
8eed2ca2dd
Consistently respect --no-typecheck flag in build (#51575) 2022-11-17 12:44:39 -08:00
Anders Hejlsberg
7b85cd6b72
Numeric literals assignable to enum literals only when values match (#51561)
* 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
2022-11-16 18:56:01 -08:00
TypeScript Bot
e99c935927 Update package-lock.json 2022-11-16 06:06:49 +00:00
Sheetal Nandi
2f2a17ad0b
Removing some unnecessary methods from host and function parameters (#51499) 2022-11-15 17:34:58 -08:00
Jake Bailey
4d53a1f8f1
Move deprecate from Debug to deprecatedCompat (#51522) 2022-11-15 16:00:33 -08:00
Simon Tretter
f4ddc1a09b
visitEachChild not traversing all nodes (#51543)
fixes https://github.com/microsoft/TypeScript/issues/51542
2022-11-15 18:18:17 -05:00
Tomasz Lenarcik
dfc1242aaf
Fix asyncDelegator reporting "done" too early (#51274)
* Fix asyncDelegator reporting done too early

* Add unit test for yields inside finally block

See #45400
2022-11-15 18:12:26 -05:00
Andrew Branch
89ce16ccfd
Fix auto-import when paths points to project reference redirect (#51492)
* Fix auto-import when `paths` points to project reference redirect

* Put paths specifiers to redirects in lower priority bucket
2022-11-15 14:19:15 -08:00
Andrew Branch
3fcd1b51a1
Refactor module resolution Extensions, fix lookup priorities (#51471)
* Refactor `Extensions`, fix lookup priorities

* Update baselines

* Clean up

* Temporarily apply same fix to `node` for testing

* Revert ancestor node_modules lookups back to two passes

* Revert "Temporarily apply same fix to `node` for testing"

This reverts commit 4014f3005a2a01a5c71a88e6418cc635498a83bc.

* Update baselines

* Add new test for node_modules searching behavior

* Update new baseline
2022-11-15 14:18:11 -08:00
Charlie Fish
53ef2fc90d
Improving Date.getTime documentation (#51365) 2022-11-15 08:48:20 -08:00
TypeScript Bot
3431912175 Update package-lock.json 2022-11-15 06:06:44 +00:00
Jonathan Kingston
c0f8d1cf75
fix(51277): Array find thisArg fix from being void (#51278) 2022-11-14 16:49:11 -08:00
Oleksandr T
5016d13f8d
fix(51112): skip checking binding parameters for functions that contains arguments (#51258) 2022-11-14 16:32:36 -08:00
Jake Bailey
fbdf00ce12
Undo accidental style changes from Map/Set PR (#51529) 2022-11-14 14:52:00 -08:00
Jake Bailey
b553affd5c
Fix smoke test substitution (#51494) 2022-11-11 16:29:42 -08:00
Jake Bailey
021fd20aac
Add smoke tests to CI (#51464) 2022-11-11 14:07:37 -08:00
TypeScript Bot
2d5e37272d Update package-lock.json 2022-11-11 06:07:05 +00:00
Sheetal Nandi
9ede7ce006
Fix incorrect spelling of packageId (#51483) 2022-11-10 16:55:49 -08:00
Sheetal Nandi
c5aea89230
Add alias ResolutionMode for ModuleKind.ESNext | ModuleKind.CommonJs | undefined (#51482)
* Add alias ResolutionMode for ModuleKind.ESNext | ModuleKind.CommonJs | undefined

* ResolutionMode | undefined = ResolutionMode

* More
2022-11-10 16:47:46 -08:00
Sheetal Nandi
3eafb64faf
Handle reusing type reference resolution in resolution cache correctly (#51475)
* 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
2022-11-10 16:03:25 -08:00
Jake Bailey
10125e48c0
Fix __importDefault when used on typescript libraries (#51474) 2022-11-10 13:57:57 -08:00
TypeScript Bot
9eb8bd6c5b Update package-lock.json 2022-11-10 06:07:04 +00:00
Sheetal Nandi
57a916c455
Emit buildinfo if file deleted isnt global (#51472)
* Add test for when file is deleted

* Emit buildinfo if file deleted isnt global
2022-11-09 18:07:17 -08:00
Jake Bailey
9f64a3a58c
Remove ts.{Map,Set,ESMap,Iterator} and associated types (#51439) 2022-11-09 15:06:31 -08:00
Jake Bailey
d798493647
Remove no-unnecessary-qualifier from eslintrc (#51456) 2022-11-09 15:02:29 -08:00
Jake Bailey
2ade485685
Make lkg task depend on local task instead (#51468) 2022-11-09 13:46:28 -08:00
Ron Buckton
e67b06e909
Simplistic watch mode for runtests (#51461)
* Simplistic watch mode for runtests

* Use esbuild WatchMode object for testRunner updates

* switch AbortController to CancelToken
2022-11-09 15:07:08 -05:00
Sheetal Nandi
6e0a62e8dd
Detangle unittests to reference helpers directly (#51450)
* 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
2022-11-09 10:02:40 -08:00
Jake Bailey
19091abda1
Fix missing awaits in Herebyfile (#51465) 2022-11-09 08:00:58 -08:00
Jake Bailey
0993c017ba
Fix JSDoc eslint rule for properties and methods (#51462) 2022-11-08 16:35:10 -08:00
Jake Bailey
d237468cda
Add --no-typecheck option for runtests/runtests-parallel/min/local (#51460) 2022-11-08 15:39:04 -08:00
Jake Bailey
1b35985f4f
Fix --bundle=false on Windows (#51459) 2022-11-08 15:20:22 -08:00
Jake Bailey
b4715d3891
Replace eslint-plugin-jsdoc by extending local jsdoc-format rule, saving ~20% of our linting time (#51438) 2022-11-08 13:59:48 -08:00
Jake Bailey
6a3b4991f0
Remove leftover todo from mjs/cjs transition (#51453) 2022-11-08 12:23:30 -08:00
Jake Bailey
555d174c46
Bump volta/packageManager in package.json (#51445) 2022-11-08 07:50:27 -08:00
TypeScript Bot
437b2690ed Update package-lock.json 2022-11-08 06:07:08 +00:00
Jake Bailey
20a04633f6
Depend on build-src in runtests (#51436) 2022-11-07 17:19:15 -08:00
Mateusz Burzyński
39ccac654c
Add known keys of the mapped type constraint to its members (#50081)
* Add known keys of the mapped type constraint to its members

* Avoid second pass of adding known members by instead passing `noReductions` to `mapType`
2022-11-07 16:22:27 -08:00
Sheetal Nandi
48aebcdcdb
TypeReference directive reuse (#49750) 2022-11-07 15:15:11 -08:00
Jake Bailey
1d96eb489e
Merge pull request #51387 from jakebailey/typeformer-2
Closes https://github.com/microsoft/TypeScript/issues/35210
Closes https://github.com/microsoft/TypeScript/issues/39247
Closes https://github.com/microsoft/TypeScript/issues/49037
Closes https://github.com/microsoft/TypeScript/issues/49332
Closes https://github.com/microsoft/TypeScript/issues/50758
2022-11-07 13:57:46 -08:00
Jake Bailey
da6f0671ae Remove dynamicImport and setDynamicImport
It turns out that the import expression won't actally be rewritten by
esbuild, so we can just write it directly.

While this won't help CJS emit, that already didn't work anyway, and
it's likely that this code is going to be moved outside of the codebase
into VS Code or a shared package elsewhere anyway.
2022-11-07 13:36:22 -08:00
Jake Bailey
7988e40590 Remove outFiles from launch.json
The troubleshooting wizard for the debugger actually says that this
option is no longer recommended; removing it enables us to use source
maps if we happen to be debugging while in --bundle=false mode.
2022-11-07 13:36:22 -08:00
Jake Bailey
8edbf8d46c Disable slow CodeQL queries
See issue 10937 on github.com/github/codeql.
2022-11-07 13:36:22 -08:00
Jake Bailey
b9e24eed8f Remove globalThisShim and globalThis modification for TypeScriptServicesFactory
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.
2022-11-07 13:36:22 -08:00
Jake Bailey
43cf7875b3 Remove Promise redeclaration
Now that we target ES2018, we don't need to declare this ourselves.
2022-11-07 13:36:22 -08:00
Jake Bailey
25a85d1faa Move compiler-debug into Debug namespace, which allows the compiler to be tree shaken
This debug code was added quite a while ago, constructed such that we
wouldn't have to ship this code to our users.

However, this is the sole place in the compiler project where the ts
namespace "escapes" the bundle. By moving this debug code into the
compiler itself, we no longer have any references to the ts namespace
itself for our bundles that don't export anything (tsc,
typingsInstaller). This lets bundlers tree shake the compiler, reducing
the size of our output by _5.7 MB_ (a ridiculous improvement for
_adding_ code).
2022-11-07 13:36:22 -08:00
Jake Bailey
c5a9573787 Ensure ts object passed to plugins contains deprecatedCompat declarations
We pass the entire "ts" object into plugins. However, we need to make
sure that that object contains the debug compat helpers.

In the old codebase, the deprecated compat code would tack things onto
the actual ts object, after the server code was executed, and later that
same object would be given to plugins.

But in modules, each TS project only sees the view of the "ts" namespace
that their references implied, not the ts object as some sort of
singleton. To ensure that plugins get the debug compat code, we have to
bring that into each project's view of the ts namespace, and not add it
on later in the executable projects.
2022-11-07 13:36:08 -08:00
Jake Bailey
db440d8468 Directly import namespaces for improved esbuild output
I should report this upstream, if I can manage to minimize this.
2022-11-07 13:36:08 -08:00
Jake Bailey
8486229625 Export ts namespace from tsserver for hacky-post patching
Unlike our other exectuables, tsserver is used in web, which means that
there actually would have been a "ts" variable declared for those users
(e.g. in a web worker). It looks like VS Code needs this variable to be
declared, so change this bundle to look the same as other libraries.

Note that in Node, the IIFE will never actually return, so this can have
no effect. On web, it will return in order to yield control back to the
event loop (as on web, postMessage is used to communicate).
2022-11-07 13:35:48 -08:00