Commit Graph
100 Commits
Author SHA1 Message Date
Andrew Branch 5b7b011518 Fix export path patterns with .d.ts target extensions in AutoImportProvider (#55815) 2023-09-21 15:03:11 -07:00
Andrew Branch 07bca994fa Avoid unnecessary resolution-mode assertion in declaration emit (#55727) 2023-09-13 13:31:19 -07:00
Andrew Branch 36ac4eb700 Fix reference marking of values merged with unresolvable type-only imports (#54799) 2023-08-03 11:09:50 -07:00
Andrew Branch 2170e6c6cc Proposal: Always allow type-only imports to reference .ts extensions (#54746) 2023-07-24 16:12:38 -07:00
Andrew Branch fac24ae4f7 Export declarations exporting aliases make the namespace instantiated (#54816) 2023-07-24 12:00:06 -07:00
Andrew Branch 69d4d57b61 Add test for const enum usage with verbatimModuleSyntax (#54920) 2023-07-10 16:22:30 -05:00
Andrew Branch 22a9ae9eed Offer auto-imports from wildcard exports with AutoImportProvider (#54831) 2023-07-07 12:50:38 -05:00
Andrew Branch f4d372aef4 Fix auto import path mapping when first pattern fails (#54868) 2023-07-03 15:02:13 -07:00
Andrew Branch 88d59e40e4 Fix path completions with sibling dts lookup in exports (#54869) 2023-07-03 14:16:16 -07:00
Andrew BranchandJake Bailey 5932420b0f Fix self-name input linking for --allowJs --declaration projects (#54819)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2023-07-03 11:17:07 -07:00
Andrew Branch 76869eeda1 Fix relative path completions when self package.json has typesVersions (#54842) 2023-06-30 10:13:22 -07:00
Andrew Branch c97e4b64a0 Fix auto imports in JS files in nodenext (#54817) 2023-06-28 15:03:14 -07:00
Andrew Branch d90eb0d731 Require module/moduleResolution to match when either is node16/nodenext (#54567) 2023-06-22 13:35:52 -07:00
Andrew Branch 2f4962a89f Remove implicit tests/cases/compiler path prefix from VFS test files (#54557) 2023-06-09 09:23:21 -07:00
Andrew Branch d5a6c8edc6 Test harness fixes (#54556) 2023-06-06 17:22:33 -07:00
Andrew Branch 160d1b7d0a Process only tsconfig-referenced files in compiler tests with tsconfig files (#54506) 2023-06-05 15:05:50 -07:00
Andrew Branch 23d48364e4 Add to module resolution tracing (#54478) 2023-06-01 10:03:40 -07:00
Andrew Branch 1e0b2f4912 Code fix should prefer import type (#54255) 2023-06-01 09:57:08 -07:00
Andrew Branch fec0bd3275 Resolve tslib re-exports before checking arity (#54450) 2023-05-30 13:47:06 -07:00
Andrew Branch 2b7d517907 Resolve re-exports when looking for tslib helpers (#54317) 2023-05-19 10:13:53 -07:00
Andrew Branch f0ff97611f isolatedModules does not imply every file is a module (#54218) 2023-05-12 15:14:49 -07:00
Andrew Branch 818c9806d4 Ensure paths-based resolution does not generate module specifiers with .. in the middle (#53957) 2023-04-21 15:04:16 -07:00
Andrew Branch 7bf0337428 Interactive refactor actions (#53915) 2023-04-19 13:01:28 -07:00
Andrew Branch 287ee41cf2 Fix two module specifier ending preference detection issues (#53691) 2023-04-06 13:06:58 -07:00
Andrew Branch f4be5b1321 Remove error on redundant isolatedModules/verbatimModuleSyntax combination (#53611) 2023-04-05 15:08:28 -07:00
Andrew Branch 9052ef895a Fix Go To Source Definition in --moduleResolution bundler (#53613) 2023-03-31 15:50:11 -07:00
Andrew Branch b29ed18466 Ignore allowImportingTsExtensions in transpileModule to suppress option validation error with noEmit (#53599) 2023-03-31 09:10:49 -07:00
Andrew Branch 52a8061e11 Type-only auto-import improvements (#53590) 2023-03-30 12:01:40 -07:00
Andrew Branch 5586727193 Allow getter and setter types to be unrelated (#53417) 2023-03-30 08:51:01 -07:00
Andrew Branch 3a3146e25f Add tests for completions crash (#53472) 2023-03-23 15:59:43 -07:00
Andrew Branch 7009c76d00 Support wildcard exports in tsconfig lookup (#53443) 2023-03-22 15:21:50 -07:00
Andrew Branch f43a4fe401 Fix resolving entity name of namespace member after alias is merged with type (#53387) 2023-03-20 15:16:08 -07:00
Andrew Branch af00915d71 Add missing ambient check to verbatimModuleSyntax export = error (#53385) 2023-03-20 12:05:20 -07:00
Andrew Branch 8458a61007 Make ModuleResolutionKind.Node10 change backward-compatible (#53139) 2023-03-07 11:20:53 -08:00
Andrew Branch e9868e96e8 --moduleResolution bundler: Require ESM for module and remove node from hard-coded conditions (#52940) 2023-02-24 15:49:08 -08:00
Andrew Branch 48e812aa07 Prefer top-level type-only imports in verbatimModuleSyntax (#52747) 2023-02-14 10:23:08 -08:00
Andrew Branch 99927cad95 Replace all instances of compilerOptions.isolatedModules with function considering verbatimModuleSyntax (#52746) 2023-02-13 16:03:02 -08:00
Andrew Branch aa658257c9 Fix completion details auto-imports crashes (#52686) 2023-02-10 15:26:09 -08:00
Andrew Branch a0afacd262 Avoid caching duplicate export info from AutoImportProvider (#52683) 2023-02-08 12:36:12 -08:00
Andrew Branch 7d8f6eec46 Add cache to auto-import package.json filter (#52422) 2023-02-06 11:33:04 -08:00
Andrew Branch 7bfe6ac49a Make traces where #50762 happens machine analyzable (#52602) 2023-02-06 11:31:07 -08:00
Andrew Branch 0bf99914e7 Make emitModuleKindIsNonNodeESM internal (#52599) 2023-02-06 08:44:58 -08:00
Andrew Branch 2e9da1e5a1 Remove always-incorrect error message about importing .ts extensions (#52595) 2023-02-03 15:02:57 -08:00
Andrew Branch ea47fb1405 Fix false verbatimModuleSyntax error on export namespace in ESM (#52555) 2023-02-03 12:32:01 -08:00
Andrew Branch 4ec9b2f8d7 Fix crash when looking for __esModule during symbol table merging (#52554) 2023-02-02 09:27:10 -08:00
Andrew Branch 1da47255fa Fix auto-imports of aliased packages with exports (#52538) 2023-02-01 09:49:38 -08:00
Andrew Branch 60edd0685f Reject auto-imports of relative paths through node_modules in bundler resolution (#52536) 2023-01-31 13:02:59 -08:00
Andrew Branch 5e8bf480e4 Fix auto-imports with --moduleResolution bundler and customConditions (#52423) 2023-01-26 09:44:07 -08:00
Andrew Branch 022516e24d Suppress verbatimModuleSyntax error on ambient export default (#52414) 2023-01-25 10:22:56 -08:00
Andrew Branch f576398194 Support export type * (#52217) 2023-01-20 14:24:48 -08:00
Andrew Branch 19d2d9ec01 Don’t let unsorted import groups eagerly derail sort detection (#52332) 2023-01-20 11:10:41 -08:00
Andrew Branch cfe1842adf Add verbatimModuleSyntax, deprecate importsNotUsedAsValues and preserveValueImports (#52203) 2023-01-19 16:56:30 -08:00
Andrew Branch 436833aba1 Allow allowImportingTsExtensions to be set in any module resolution mode (#52230) 2023-01-17 15:13:17 -08:00
Andrew Branch 3e9703f126 Add additional diagnostic for packages that only resolve under non-exports-respecting modes (#52173) 2023-01-12 16:30:35 -08:00
Andrew Branch 14b0d6d4bf Fix nested package json lookup in modes that respect package.json exports (#51995) 2023-01-10 16:18:26 -08:00
Andrew Branch ec9f6a428b Ensure self-name resolution uses same extension priorities as external imports (#52185) 2023-01-10 13:57:50 -08:00
Andrew Branch 714d7341cf --moduleResoltuion bunlder: Allow import assignment in ambient contexts (#51971) 2022-12-19 17:03:50 -08:00
Andrew Branch e0bfac531b Rename module resolution option node to node10 (preserving backward-compatible alias) (#51901)
* Rename `node` to `node10` (preserving alias)

* Revert dogfooding change because of LKG

* Update baselines
2022-12-15 10:07:33 -08:00
Andrew Branch 4076ff8fd6 Add option for organize imports case sensitivity (#51733)
* Add ignore case option to organizeImports

* Adopt in auto-imports, use same case-insensitive comparison as eslint

* Fix build/lint

* Mark functions internal

* Update affected auto import test

* Update API baseline

* Update protocol

* Update API baseline

* Short-circuit comparisons that have already failed
2022-12-13 14:37:29 -08:00
Andrew Branch a5dde88dce --moduleResolution bundler (formerly known as hybrid) (#51669)
* WIP

* Add extension error back unless noEmit is set

* Add non-relative tests

* Add error for importing from declaration file

* Update unit test

* Add explicit flag for importing from .ts extensions

* Add module specifier resolution changes

* Add auto-import tests

* Disallow relative imports into node_modules

* Ensure auto-imports don’t suggest ./node_modules;

* Test a non-portable declaration emit issue

* Test auto-importing TSX file

* Update path completions

* Fix lint due to merge

* Remove minimal-specific stuff

* Remove minimal tests

* Update unit tests

* Add options

* Add customConditions option

* Add first tests

* CJS constructs are not allowed

* Add another test

* Fix extension adding/replacing priority

* Update test to reflect the choice not to block on unrecognized extensions

* Add auto-imports and string completions tests

* Revamp string completions ending preferences

* Comment test

* Auto-imports of declaration files cannot use .ts extension

* Have declaration file auto imports default to extensionless instead

* Add test for custom conditions

* Fix indentation

* Add baseline showing resolvePackageJsonImports/Exports compatibility

* Fix test and prevent CJS require from resolving

* Update unit test baselines

* Fix bad merge conflict resolution

* Make resolvedUsingTsExtension optional

* Update missed baselines

* Revert now-unnecessary API implementation changes

* Clean up

* Update baselines to es5 emit

* Rename to `bundler`
2022-12-13 13:35:16 -08:00
Andrew Branch dc3daa6644 Fix namespace import update bug, simplify, comment, and rename (#51797) 2022-12-06 16:38:33 -08:00
Andrew Branch c2fa967bff Add FabricBot config, removing @amcasey pings (#51775)
* Add FabricBot config

* Remove other @amcasey ping

* Delete stray comma

* Why is GH editing UI so difficult
2022-12-06 09:47:11 -08:00
Andrew Branch e6d7b526c8 Fix multiline import specifier sorting (#51634)
* Fix multiline import specifier sorting

* Update baselines

* Switch to EmitFlag, set hasTrailingComma on original node array

* Update API baseline

* Update baselines
2022-11-28 15:35:32 -08: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 4014f3005a.

* Update baselines

* Add new test for node_modules searching behavior

* Update new baseline
2022-11-15 14:18:11 -08:00
Andrew Branch 9c4e14d751 Remove "No type information for this code" from baseline (#51311)
* Fix "No type information for this code" in baseline

* Just remove the message
2022-10-25 15:11:27 -07:00
Andrew Branch ef69116c41 Generate shortest rootDirs module specifier instead of first possible (#51244)
* Generate shortest rootDirs module specifier instead of first possible

* Simplify `min`
2022-10-21 16:05:58 -07:00
Andrew Branch f6cf51053e Add more tracing to node16/nodenext resolution (#51168)
* Add more tracing to node16/nodenext resolution

* Update baselines after diagnostic change

* Trace non-matching conditions
2022-10-14 09:42:06 -07:00
Andrew Branch 0ce72ef6c8 Add option to OrganizeImports for removal only (#50931)
* Remove unused imports

* Lint

* Update baselines

* Make mode paramter required

* Clean up
2022-09-29 16:30:02 -07:00
Andrew Branch d1586de043 Fully resolve aliases when checking symbol flags (#50853)
* Resolve aliases past first merge in `resolveName`

* WIP

* Fix when a namespace merges with an alias that resolves to a type merged with an alias that resolves to a value 😵

* Audit all resolveSymbol and resolveName calls

* Fix qualification in re-exporting global cases

* Fix infinite loop detection

* Update baselines

* Just make getAllSymbolFlags default to All
2022-09-29 14:00:43 -07:00
Andrew Branch fbfe9340a9 Fix comparability between type parameters related by a union constraint (#50978) 2022-09-28 10:06:13 -07:00
Andrew Branch 221cf55a21 package.json exports should have priority over typesVersions (#50890)
* package.json `exports` should have priority over `typesVersions`

* Test some versioned conditions too
2022-09-21 17:21:51 -07:00
Andrew Branch 938a69a526 Fix import statement completions followed by interface declaration (#50350)
* Fix import statement completions followed by interface declaration

* Fix stuff

* Linty

* Fix when named imports is missing closing brace
2022-09-20 13:29:06 -07:00
Andrew Branch 168186f93d Allow a union property of a private/protected member and an intersection property including that same member (#50328) 2022-09-20 10:28:48 -07:00
Andrew Branch 6d384876e5 Fix workflow typo (#50746) 2022-09-12 15:41:30 -07:00
Andrew Branch 7120b520cf Update twoslash workflow (#50738)
* Update twoslash workflow

* Split conditional checkout
2022-09-12 13:35:36 -07:00
Andrew Branch bb6f36f7c8 Forward intersection state flag to conditional type target check (#50620) 2022-09-07 10:07:24 -07:00
Andrew Branch 856c7c5fdd Allow {} to narrow in same special cases as unknown (#50601) 2022-09-02 09:47:27 -07:00
Andrew Branch 5df09a514c Use bidirectional comparability in narrowing (#50592)
* Use bidirectional comparability (aka comparability) in narrowing

* Rename test, check other CFA branch, test without strictNullChecks
2022-09-01 14:26:48 -07:00
Andrew Branch 38076df346 Fix auto import crash due to difference in paths handling (#50419) 2022-08-25 13:02:48 -07:00
Andrew Branch 330e33cdda Ignore related info in diagnostic deduplication (#50309)
* Ignore related info in diagnostic deduplication

* Add another test
2022-08-16 09:28:59 -07:00
Andrew Branch 90fa1c70c1 Update baseline after out-of-order merge (#50320) 2022-08-16 08:54:55 -07:00
Andrew Branch 4e33e0eb6c Make literal types not comparable to weak object types without property overlap (#49865) 2022-08-15 17:10:11 -07:00
Andrew Branch 64ee1e88e0 Strip literal freshness of contextually typed literals (#49884)
* Strip literal freshness of contextually typed literals

* Add more tests
2022-08-15 17:04:09 -07:00
Andrew Branch bc52ff6f4b Make React import fix not block component import fix (#50307)
* Stop React import fix from blocking component import fixes

* Add additional promote-type-only test
2022-08-15 13:13:41 -07:00
Andrew Branch 7afd14f263 Update error messages for CJS imports resolving to ES modules (#50088)
* Update error messages for CJS imports resolving to ES modules

* Update error message

* Use package scope from source file

* Update baselines

* Issue error for JSX/TSX files

* Switch from related info to message chain
2022-08-04 16:58:13 -07:00
Andrew Branch c82c9a9744 Fix bugs in module specifier generation with paths/typesVersions (#49792)
* Write a test and a huge comment

* Finish fixing everything

* Clean up comment

* Remove obsolete comment

* Fix comment trailing off

* Optimize to hit the file system much less
2022-08-03 13:58:15 -07:00
Andrew Branch b7355e30af Fix trailing formatting edit when range ends mid-token (#50082) 2022-07-28 12:11:22 -07:00
Andrew Branch 6aefc1dcea More fixes to uncalled function checks in && expressions (#49868) 2022-07-22 16:06:16 -07:00
Andrew Branch 695b24d187 Move DebugTypeMapper to debug.ts (#49864)
* Move DebugTypeMapper to debug.ts

* export `DebugType`
2022-07-11 13:25:33 -07:00
Andrew Branch 9dde56c6fc Add path completions for package.json exports with wildcards (#49644)
* Support path completions for exports wildcards

* Break up results by directory

* Share code between typesVersions and exports processing

* Revert completion kind change

* Add kinds to tests

* Update existing test

* Support nested conditions, improve recursive globbing
2022-07-07 12:26:18 -07:00
Andrew Branch 8002369871 Protect against a language service host mutating its underlying source for getScriptFileNames (#49813)
* Protect against a language service host mutating its underlying source for `getScriptFileNames`

* Add comment
2022-07-06 10:49:01 -07:00
Andrew Branch f8aa570b23 Get type arguments lazily for instantiating inferred type parameter constraint (#49744)
* Get type arguments lazily for instantiating inferred constraint

* Use new deferred type mapper
2022-06-30 16:23:07 -07:00
Andrew Branch 93f2d2b9a1 Add variance results to tracing, capture variance verification on annotated type params (#49712)
* Add variance results to tracing

* Tweak format, prohibit `results` on `E` events
2022-06-29 16:30:57 -07:00
Andrew Branch 2bc91a6b46 Fix parser TODO (#49679) 2022-06-27 09:05:41 -07:00
Andrew Branch 7e7c53961a Add TS Server option to exclude files from auto-imports (#49578)
* Basic functionality

* Add tests

* Add test for ambient modules

* Add to protocol
2022-06-17 14:39:51 -07:00
Andrew Branch 1213c35d57 Add error when importing/exporting types in JS files (#49580)
* Add error when importing/exporting types in JS files

* Ignore type-only imports, update other baselines

* Clean up
2022-06-17 14:39:24 -07:00
Andrew Branch 00c7c476dc Avoid repeating codefix work when resolving auto-import specifiers for completions (#49442) 2022-06-09 10:37:16 -07:00
Andrew Branch f483ab5c2f Explicit types should prevent ATA from doing package.json discovery (#49380) 2022-06-03 15:21:21 -07:00
Andrew Branch 34fe835f33 Add nightly-only error on ImportType resolution mode assertion (#49356)
* Add nightly-only error on ImportType resolution mode assertion

* Temporarily change version to demonstrate errors

* Revert "Temporarily change version to demonstrate errors"

This reverts commit 40c2469647.

* "Resolution mode" -> "resolution-mode"
2022-06-02 15:50:44 -07:00