Граф коммитов

34280 Коммитов

Автор SHA1 Сообщение Дата
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
Gabriela Araujo Britto ad354c2d75
Don't include already-covered cases in switch completions (#51790)
* WIP: filter existing values in case completions

* filter existing enum symbols

* add comment

* fix lint errors

* update baselines

* add comment
2022-12-13 13:01:52 -08:00
Jake Bailey 0c23344a1e
Update esbuild to v0.16.5 and use new --packages=external option (#51877) 2022-12-13 12:47:36 -08:00
Ron Buckton 6d41964fd0
Reduce polymorphism resulting from unstable Node shapes (#51682)
* 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
2022-12-13 15:11:10 -05:00
navya9singh 7267fcaeb9
Fix(29118): tsconfig.extends as array (#50403)
* tsconfig.extends as array

* Updated baselines

* Changes for pr

* Changes for pr comments

* Fixed formatting and edited a test

* Resolved errors after a merge conflict

* Added "string | list" type implentation

* Removed string | list type implementation

* Fixed formatting

* Added compiler test

* Resolving programUpdate errors

* Fixing commandLineParser error
2022-12-13 11:16:07 -08:00
Jake Bailey a3802c1e7b
Remove excluded CodeQL rules, fix reference to Gulpfile (#51878)
Fixes https://github.com/microsoft/TypeScript/issues/51401
2022-12-13 11:01:27 -08:00
TypeScript Bot 41fa4d7edd Update package-lock.json 2022-12-13 06:07:58 +00:00
Oleksandr T 790c03d7b0
fix(47954): Auto implementation of interface with a constructor prop causes error (#50709)
* fix(47954): convert constructor property to computed name

* handle more nodes with constructor name
2022-12-12 15:28:03 -08:00
Oleksandr T 8f2a38f44b
fix(50117): Using @extends in JavaScript + JSDoc removes method documentations (#50256)
* fix(50117): show jsdoc from an inherited members

* show jsdoc from inherited members from class expressions
2022-12-12 15:22:03 -08:00
Oleksandr T d54f52e0de
fix(50089): JSDoc/TSDoc @link with custom display text incorrectly shows vertical bar (#50106)
* fix(50089): omit | from jsdoc linkTag text

* change finding for the end pos of a link
2022-12-12 15:16:29 -08:00
Oleksandr T 708a522ddf
fix(49080): --exactOptionalPropertyTypes seems to be ignored for JSDoc types (#49910)
* fix(49080): handle JSDocPropertyTag as optional prop

* move condition to utility function isOptionalDeclaration

* add additional tests

* update baseline
2022-12-12 15:03:49 -08:00
Oleksandr T 355991c806
feat(49323): Render JSDoc @throws {type} as a link (#49891)
* 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
2022-12-12 14:44:38 -08:00
TypeScript Bot f1288c33a1 Update package-lock.json 2022-12-12 06:06:46 +00:00
TypeScript Bot 3be1a67f82 Update package-lock.json 2022-12-11 06:06:29 +00:00
TypeScript Bot d45527a215 Update package-lock.json 2022-12-10 06:07:06 +00:00
Sheetal Nandi 9d7df99414
Fix isExternalLibraryImport for classic resolution (#51840) 2022-12-09 14:44:35 -08:00
Ryan Cavanaugh 4978b3ebeb
Properly detect explicitly-set targets (#51834) 2022-12-09 10:31:51 -08:00
Sheetal Nandi 86e0fc92af
Fix the test (#51839) 2022-12-09 10:22:49 -08:00
Oleksandr T 1f32fef5a2
fix(51077): skip insertText for jsx attribute with existing initializer (#51093) 2022-12-09 08:38:08 -08:00
Josh Goldberg f3d55db45a
Fixed tuple types indexed by a type parameter (#51037)
* Fixed tuple types indexed by a type parameter

* If only there was a tool to add that missing semicolon for me

* Rename to baseConstraint

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-12-09 07:59:40 -08:00
TypeScript Bot 212d3864ef Update package-lock.json 2022-12-09 06:07:13 +00:00
George Manning 65bf850a20
Fix #51437 Duplicate "Duplicate identifier" errors (#51594)
* retroactive approach to remove duplicate diagnostics

* use code instead of messageText, update test

* use existing de-dupe function

* rename test and baselines

* add fourslash test for better assertion of fix

* review feedback: move deduplicate to getDiagnosticsHelper

* accept baseline with sorted diagnostics

* remove newline
2022-12-08 19:21:41 -08:00
Oleksandr T e087992134
feat(47977): show completion in jsdoc extends/implements tags (#51028) 2022-12-08 17:10:00 -08:00
Oleksandr T 8f2ee38b52
fix(50888): Organize Imports may delete preceding comments when all members of all import statements are unused (#50983)
* fix(50888): preserve preceding comments of the deleted import

* update tests
2022-12-08 17:05:12 -08:00
Gabriela Araujo Britto 6327931d4f
create special --no-typecheck script (#51830) 2022-12-08 17:04:58 -08:00
swandir f0f415b671
Add missing Intl.ListFormat.prototype.resolvedOptions() (#51024)
* Add missing Intl.ListFormat.prototype.resolvedOptions()

Fixes #51023

* lint
2022-12-08 16:45:17 -08:00
Ryan Cavanaugh a3dbe7dc70
Update default target from ES3 to ES5 (#51731)
* Change the default emit target to ES5

* Add baseline update

* Remove tests with a hardcoded sourcemap in it

* Update hardcoded tests

* Merge with main

* Restore tests
2022-12-08 16:43:47 -08:00
Sheetal Nandi 3716ffe748
Make getSupportedCodeFixes on LS so it can be proxied by plugins (#51769)
Fixes #28966
2022-12-08 09:52:25 -08:00
TypeScript Bot 52203dbc46 Update package-lock.json 2022-12-08 06:06:59 +00:00
Jake Bailey 4f951d72f0
Update to esbuild v0.16 (#51803) 2022-12-07 19:54:35 -08:00
Anders Hejlsberg b9d0e17298
Ignore switch statement bypass control flows that produce `never` (#51703)
* Ignore switch statement bypass control flows that produce 'never'

* Add regression test
2022-12-07 16:19:09 -08:00
Anders Hejlsberg d43112a75b
Use `missingType` in `--noUncheckedIndexedAccess` mode (#51653)
* Use missingType in noUncheckedIndexedAccess mode

* Accept new baselines

* Add tests

* Optimizing searching for undefinedType and missingType
2022-12-07 13:38:33 -08:00
Anders Hejlsberg 91f89b94e4
Visit child nodes in `checkExpressionWithTypeArguments` (#51804)
* Visit child nodes in checkExpressionWithTypeArguments

* Accept new baselines

* Add tests
2022-12-07 10:06:12 -08:00
Sheetal Nandi a77a79fe4b
Remove some unnecessary createGetCanonicalFileName by exposing one from program (#51796) 2022-12-07 09:17:52 -08:00
Mateusz Burzyński 6684e3d527
Fixed substition types for non-generic indexed accesses (#51621) 2022-12-07 07:47:32 -08:00
Sheetal Nandi 832a6e45a7
Unify verifyTsc and verifyTscWithEdits and make them look like verifyTscWatch for easy copy paste (#51798)
* Make edits optional in verifyTscWatch

* Unify verifyTsc and verifyTscWithEdits and make them look like verifyTscWatch
2022-12-06 17:18:31 -08:00
Sheetal Nandi e0293b5877
Instead of computing signatures during building, compute them afterwards for verification (#51718)
This helps with finding issues with d.ts emit because of caching.
2022-12-06 16:55:08 -08:00
Andrew Branch dc3daa6644
Fix namespace import update bug, simplify, comment, and rename (#51797) 2022-12-06 16:38:33 -08:00
Gabriela Araujo Britto a1536358f7
fix & test (#51792) 2022-12-06 16:18:01 -08:00
Jake Bailey 4ac75fa2b6
Remove emitDeclarationOnly hack now that build mode supports it as a flag (#51795) 2022-12-06 16:02:23 -08:00
Sheetal Nandi 84e475c105
Make resolution cache use sets instead of arrays for easier checking (#51735) 2022-12-06 14:25:19 -08:00
Sheetal Nandi 38f33ade06
Use non relative name cache for type reference resolutions and API updates (#51732)
* Make the non relative name resolution cache generic

* Add cache for non relative type reference resolution

* Add getter only methods so we can use these in future for sharing resolutions across the projects

* Mark existing non relative module name cache getOrCreate as deprecated

* Prefer getters for getting directory results
2022-12-06 14:22:03 -08:00
Jake Bailey 703652cebf
Remove some files from the repo root (#51446) 2022-12-06 13:42:54 -08:00
Daniel Rosenwasser 3c99d50da5
Replace a few type assertions with annotations and `satisfies`. (#51685) 2022-12-06 11:52:17 -08:00
Eric Ferreira af1d91d9d9
Fix missed errors in switch when using union of literal and non-literal types (#38686) (#51373)
* Fix missed errors in switch when using union of literal and non-literal types (#38686)

This commit makes it so we don’t use the base type of literals when checking comparability in switch. The comparability checks handle that case already, is my understanding, so we don’t need to clobber the type before actually doing the check, causing missed errors.

When comparing the types in switch, if a union with a literal and a non-literal was used, the compiler in `checker.ts` would automatically get the base type of all parts of the union, resulting in missed errors. For example, if the union of the non-literal `number` and literal `"hello"` was compared to the literal `"world"` in a switch case, the compiler would miss that they’re actually not comparable.

Maybe someone can tell me why we were getting the base type before checking comparability, rather than relying on the logic within the comparability checks to handle literal/base type comparability?

* Fix lint (whitespace) issue in checker.ts by running lint with fix flag.
2022-12-06 10:50:21 -08:00
Jake Bailey bb42b5c1a6
Unconditionally use WeakMap in debug (#51785) 2022-12-06 10:41:39 -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
Isabel Duan ae9c671d59
(fix #50725, #50710) add file extensions in import statements (#51702)
* fixes #50725

* fixed 50710

* fixed broken test

* clean up

* variable rename

* rename variable to newFileBaseName
2022-12-06 09:28:10 -08:00
Nathan Shively-Sanders 5bb204e321
Remove webServer (#51699)
* Remove webServer

First draft; I may move some things around to be more readable.

* Refactor moved code

1. Move StartSessionOptions to common next to where it's first used.
2. Inline single-use BaseLogger base class into its only child class,
Logger.
3. Start using direct imports, eg `import {} from './common'`. I hope
this is OK?!

* Fix lint

* move imports back to namespace import

* hereby tsserver: remove exportIsTsObject
2022-12-06 08:41:01 -08:00
TypeScript Bot c124d0e260 Update package-lock.json 2022-12-06 06:06:23 +00:00