Commit Graph

23089 Commits

Author SHA1 Message Date
Wesley Wigham
69143ecc5b Reuse input nodes where possible when serializing jsdoc implements clauses (#41783)
* Reuse input nodes where possible when serializing jsdoc implements clauses

* Whitespace changes, per PR feedback
2020-12-08 12:13:37 -08:00
csigs
7fafb31ea6 LEGO: check in for master to temporary branch. 2020-12-08 18:10:41 +00:00
Anders Hejlsberg
646f5b3c4e Preserve substitution types in check position of conditional types (#41841)
* Preserve substitution types in check types of conditional types

* Undo changes from #32093

* Add regression tests

* Accept new baselines
2020-12-07 16:38:00 -10:00
Oleksandr T
0fa41db6c6 fix(41827): allow infer parameters from method signature usage (#41836) 2020-12-07 14:00:46 -08:00
Orta Therox
71e881a7ee Undo #39258 (isArray changes) see overview at #41808 (#41851) 2020-12-07 21:59:26 +00:00
Sheetal Nandi
bfb259128b Handle output file names descripency between tsc --b and actual program emit file path calculation (#41811)
* Baseline showing #41801 and other issues with output path calculation

* Add a way to note descripencies between clean and incremental build

* Add descripency when no rootDir is specified but project is composite

* if rootDir is specified, irrespective of whether all files belong to rootDir, the paths should be calculated from rootDir

* Fix the output file names api to use the correct common source directory

* Tests for #41780

* Spelling
2020-12-07 11:53:22 -08:00
Song Gao
37e898cfd7 import statement from "node" in js source file could produce correct declaration path. (#41816)
* fix #41800

* add test

* fix test
2020-12-07 13:54:47 +00:00
Oleksandr T
2946318df0 fix(41526): add JSDoc type annotations before parameters (#41561) 2020-12-04 16:52:12 -08:00
Oleksandr T
f0340005a3 fix(41295): handle deprecated callbacks (#41310) 2020-12-04 16:37:25 -08:00
Oleksandr T
a5c3cb4194 Improve uncalled function checks with parenthesized expressions in condition (#41748) 2020-12-04 16:20:14 -08:00
Wesley Wigham
360958e04c JSDoc declaration emit should reuse input nodes where possible when serializing typedefs (#41760)
* JSDoc declaration emit should reuse input nodes where possible when serializing typedefs

* Style comments
2020-12-04 13:42:35 -08:00
kingwl
870f5b613a Merge branch 'master' into noPropertyAccessFromIndexSignature_fix 2020-12-04 12:47:38 +08:00
Anders Hejlsberg
cd37a327a7 Fix non-homomorphic mapped type constraint issues (#41807)
* Less aggressive wildcard check, 'keyof any' constraint for 'infer T' in mapped type constraint position

* Accept new baselines

* Add regression tests
2020-12-03 16:36:45 -10:00
Armando Aguirre
143d1104ab Merge pull request #41703 from a-tarasyuk/fix/41653
fix(41653): Enum Keys in Destructure Prevents ES6 Function Convert with --target ES5
2020-12-03 16:10:51 -08:00
Ron Buckton
324f0469c0 Merge pull request #41791 from microsoft/fix40643
Reuse temp variable scope for converted loop body
2020-12-03 13:33:09 -08:00
Andrew Branch
69bc3f3b0c Allow type-only imports on ImportEqualsDeclarations (#41573)
* Allow type-only ImportEqualsDeclarations

* Suppress CJS-in-ESM error when type-only

* Add grammar error on import type in import alias

* Update API baselines

* Fix importsNotUsedAsValues with ImportEqualsDeclarations

* Make bad error talk words more good for Daniel. Fixes #41603

* One more error message baseline update

* Update transformer and emitter
2020-12-03 13:27:15 -08:00
kingwl
501b69c61f respect quote Preference 2020-12-03 12:00:30 +08:00
kingwl
31e686b996 Fix codefix for noPropertyAccessFromIndexSignature 2020-12-03 11:51:41 +08:00
Ron Buckton
27dc177f29 Reuse temp variable scope for converted loop body 2020-12-02 18:11:45 -08:00
Jack Works
0b6c9254a8 Fix import tracker for dynamic import (#41473)
* chore: migrate findAllRefs_importType_js to baseline

* fix: reference for dynamic import

* fix: find all reference for typeof import()

* fix: test

* refactor: addIndirectUser

* refactor: isExported

* refactor: isExported

* resolve review
2020-12-02 14:46:20 -08:00
Wesley Wigham
9f9eed400c Read the base construct signature from the static base type, not the instance base (#41767) 2020-12-02 13:30:46 -08:00
Ryan Cavanaugh
9a957e7b9c Remove incorrect assert that triggers crash on completions of globalThis (#40278)
Fixes #39338
2020-12-02 11:47:32 -08:00
Armando Aguirre
fd50f1e3c9 Merge pull request #41543 from a-tarasyuk/fix/41534
fix(41534): Maximum call stack error while computing document symbol file
2020-12-01 18:03:11 -08:00
Josh Goldberg
943b350f8d Used String on base class per suggestion 2020-12-01 19:03:49 -05:00
Josh Goldberg
5bc0002450 ...except for the small master merge slipups 2020-12-01 18:53:54 -05:00
Josh Goldberg
f55ba77297 Merge branch 'master' 2020-12-01 18:51:46 -05:00
Wenlu Wang
55810095f4 Allow qualified name for convert namespace import (#41592) 2020-12-01 15:23:57 -08:00
Wesley Wigham
0da5a7e4ba Add missing BinaryExpression source side cases to isMatchingReference (#41765) 2020-12-01 14:47:14 -08:00
Anders Hejlsberg
4d6947ae14 Check nested conditional types for non-distributiveness in mapped types with 'as' clauses (#41713)
* Check nested conditional types for non-distributiveness

* Rename to maybeNonDistributiveNameType

* Add regression test
2020-12-01 12:07:47 -10:00
Anders Hejlsberg
4782c74b75 Propagate wildcard types in non-homomorphic mapped types (#41622)
* Propagate wildcard types in non-homomorphic mapped types

* Add regression test

* Accept new baselines

* Accept new baselines
2020-12-01 11:57:00 -10:00
inokawa
d57954345b Fix typos (#41723) 2020-12-01 13:46:41 -08:00
Wesley Wigham
2a3f5508ec addImplementationSuccessElaboration admits declarations with no symbol (#41758) 2020-12-01 12:19:12 -08:00
Keen Yee Liau
cf4df4e472 fix(41736): tsserver should not crash if external file does not exist (#41737)
If a file does not exist, `projectService.getOrCreateScriptInfoNotOpenedByClient()`
will return `undefined`, but tsserver does not handle this case.

Fix https://github.com/microsoft/TypeScript/issues/41736
2020-11-30 16:37:40 -08:00
Andrew Branch
5a8186f86d Produce source maps for local typescriptServices build (#41589)
* Enable source maps for typescriptServices local builds

* Alias gulp lkg -> gulp LKG
2020-11-30 14:28:13 -08:00
Nathan Shively-Sanders
06fb724cd1 Improve uncalled function checks (#41599)
Fixes #41586
Fixes #41588

1. For binary expressions, if the immediate parent is an IfStatement,
then check the body of the if statement. I didn't walk upward to find an
IfStatement because in my experimentation I found that binary expression
uncalled-function errors are only issued when the expression is on the left of the
top-most binary expression.

2. For property accesses with interspersed calls, I added a
CallExpression case. In fact, any expression could appear here, but I
only want to fix calls for now since that's all we've observed in
Definitely Typed, and we didn't see anything else in the user tests or RWC
tests. I also didn't examine parameters of the intermediate call
expressions, but I don't think it's needed since the intent is to avoid
false positives.
2020-11-30 14:27:19 -08:00
Oleksandr T
23b3eb685f fix(41621): fixUnusedIdentifier - allow deleting prefix/postfix unary operators (#41624) 2020-11-30 13:58:47 -08:00
Oleksandr T
1bd8e388ae fix(41688): completions with infer keyword (#41704) 2020-11-30 11:56:12 -08:00
Oleksandr T
3a903b8a28 fix(41653): convert arrow function to function expression that used as destructure initializer 2020-11-26 21:19:15 +02:00
Anders Hejlsberg
411c6d04c6 Fix getTypeFacts for pattern template literal types (#41693)
* Normalize `${string}` to just string, fix getTypeFacts

* Add tests

* Accept new baselines
2020-11-26 06:55:01 -10:00
Anders Hejlsberg
ec1490fb44 Properly cache types for shared control flow nodes (#41665)
* Properly cache shared flow node types

* Add test
2020-11-25 14:51:38 -10:00
Song Gao
d5779c75d3 replace whole path if directory separator appears for import completion. (#41412)
* replace whole path if directory separator appears.

* Fix.

* revert change.

* Fix test case.

* add test.

* fix as suggested.

* revert useless change

* adapt to code change.

* fix baseline for test file.
2020-11-25 09:37:08 -08:00
Andrew Branch
3fa30f4826 Remove obsolete go-to-definition code after CommonJS alias changes (#41522)
* Remove obsolete code

* Revert package-lock change
2020-11-25 09:01:56 -08:00
csigs
dbcbe9369d LEGO: check in for master to temporary branch. 2020-11-25 00:11:00 +00:00
Oleksandr T
5adb55eb18 feat(41216): show JSDoc for aliases (#41452) 2020-11-24 14:40:51 -08:00
Andrew Casey
a6ebf5d79a Trace checkDeferredNode to cover JSX elements (#41572) 2020-11-24 14:33:15 -08:00
Andrew Casey
4c8418ee19 Use stricter types for tracing event arguments (#41217)
* Use stricter types for tracing event arguments

In local development, I've routinely passed the wrong local and ended up
having JSON.stringify throw.

* Make the type recursive

Courtesy of @rbuckton

* Fix lint error
2020-11-24 14:33:00 -08:00
Oleksandr T
03877260f8 fix(41194): ignore jsxFrag identifier in import declarations (#41441) 2020-11-24 14:29:47 -08:00
csigs
64702dee11 LEGO: check in for master to temporary branch. 2020-11-24 18:10:46 +00:00
csigs
0e2d8b4a5a LEGO: check in for master to temporary branch. 2020-11-24 12:10:42 +00:00
Guerric Phalippou
d338c20c15 Add a comment to clarify the #private field (#41547)
* add a comment to clarify the #private field

* small fix
2020-11-23 22:34:27 -08:00