Commit Graph
11214 Commits
Author SHA1 Message Date
Oleksandr T 5f372d9d7e fix(46606): show completion in jsdoc property tag (#46657) 2021-12-07 15:28:41 -08:00
Mateusz Burzyński 6722ef12d3 Add a test for a destructured union with tuple members (#46656) 2021-12-07 15:22:46 -08:00
Ron Buckton 67f84ef771 Fix Awaited<T> for onfulfilled callbacks with more than one argument (#46951) 2021-12-07 15:21:11 -08:00
7a12909ae3 fix(45713) Improve error report summaries (#45742)
* Improve error report summaries (#45713)

* fixup! Improve error report summaries (#45713)

* fixup! fixup! Improve error report summaries (#45713)

* Adds support for handling localization renaming the 'files' header due to localization

* fixup! Adds support for handling localization renaming the 'files' header due to localization

 - Fixed baseline error
 - Fixed linter error

Co-authored-by: Orta <git@orta.io>
Co-authored-by: Orta Therox <ortam@microsoft.com>
2021-12-07 10:50:44 +00:00
Jake Bailey 4013271cd8 Unwrap parens when checking for JSDocFunctionType in conditional expression (#46962) 2021-12-06 16:44:37 -08:00
Oleksandr T 4761ba6285 fix(46998): Hover on as const shows type const = /*unresolved*/ any (#47000) 2021-12-06 14:41:46 -08:00
Jay ClarkandNathan Shively-Sanders 1fe9bfdd0e Fix strict/es5+ octal literal 2x error #46810 (#46823)
* Fix strict/es5+ octal literal 2x error #46810

Signed-off-by: Jay Clark <jay@jayeclark.dev>

* Accept baseline test changes

Signed-off-by: Jay Clark <jay@jayeclark.dev>

* Add test case

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-12-06 12:46:08 -08:00
Anders Hejlsberg 2a7eb58589 Properly union inferred template literal string types (#46782)
* Template literals and string mappings have 'string' as base type

* Add regression test

* Add tests for generic template literals

* One more test
2021-12-06 10:51:50 -08:00
ZzzenandJake Bailey 7a1687de26 fix(42678): detect access to uninitialized variable in IIFE (#42776)
* fix(42678): detect access to uninitialized variable in IIFE

* improve performance

* Add missing space to match coding guidelines

* simplify the implementation

Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2021-12-06 10:42:20 -08:00
Yuki Osaki 1f275d705d "No repeated property names" error in object literals is duplicated in strict mode (#46929)
* "No repeated property names" error in object literals is duplicated in strict mode

* fix indent
2021-12-06 10:22:28 -08:00
Wesley Wigham 97a7901f26 Use features for selected module resolution rather than all features for type reference directives, since they can add restrictions to resolutions (#47007) 2021-12-04 04:24:28 -08:00
Anders Hejlsberg b2af6051ef Improve isValidSpreadType check (#47010)
* Fix getFalsyFlags for intersection types

* Fix and simplify isValidSpreadType

* Slight tweak

* Add tests
2021-12-03 16:11:01 -08:00
Andrew Branch 2ce05a8292 Completions sorting overhaul (#46703)
* Sort resolved auto-import completions by number of directory separators

* Sort completions in services layer

* Finish tests

* Fix more tests

* Respect SortText in completions

* Update tests to use `unsorted` assertion
2021-12-03 14:54:51 -08:00
Oleksandr T 407edc95c0 fix(46563): show completions at this type (#46581) 2021-12-03 14:29:45 -08:00
Oleksandr T c5d9200ec6 feat(46986): offer QF for using await outside of async context (#46994) 2021-12-03 12:36:19 -08:00
Oleksandr T 4b794fe1dd fix(46345): omit temp variable for computed property name in ambient context (#46446) 2021-12-02 16:04:11 -08:00
LowR bedc8d4124 fix(46195): handle numeric separators and larger integers correctly in codefix for large integers (#46389)
* fix(46195): handle numeric separators and larger integers correctly

* Use `indexOf()` instead of `includes()`
2021-12-02 16:01:43 -08:00
Jake Bailey cdf12f91c7 Fix parsing of parenthesized functions in conditional expressions (#46960) 2021-11-30 12:57:37 -08:00
Oleksandr TandRon Buckton d3d088fac5 fix(44639): Transpilation of optional chaining combined with type casting results in function call losing its context (#44666)
* fix(44639): Fix emit for optional chain with type assertions

* Move ASI-blocking parens out of ts transform

* Add missing comments from PartiallyEmittedExpression+minor cleanup

* Avoid comment duplication on copied receiver

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-11-29 13:22:53 -08:00
Andrew Branch 68bf5a519a Fix formatting the end of a selection (#46875)
* Fix formatting edits at end of range

* Adjust test

* Revert API baseline changes
2021-11-29 09:27:21 -08:00
Nathan Shively-Sanders 868c275fdf Plain JS binder errors (#46816)
* Plain JS binder errors

Issue select errors from the binder in JS files that do not have checkJS
explicitly turned on or off. These errors mirror runtime checks done by
Javascript.

* Rest of plain JS binder errors

* address PR comments

* Only issue binder errors in plain JS.

Checker errors require requesting diagnostics, which stll needs to be
peformance tested.

This commit removes one cross-file duplicate declaration error in the tests.

* fix const lint
2021-11-18 17:13:06 -08:00
Oleksandr T 6143237376 fix(46366): handle enum string access as enumMemberName (#46431) 2021-11-18 15:50:32 -08:00
ZzzenandNathan Shively-Sanders de4ba0f208 enable go-to-type-definition on type nodes (#46714)
* enable go-to-type-definition on type nodes

* only go when symbol has no value meaning

* Update formatting of src/services/goToDefinition.ts

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-11-18 08:55:54 -08:00
Oleksandr T a75f26e68b fix(42238): emit this parameter in function declaration (#46511) 2021-11-17 15:43:27 -08:00
Andrew Branch f11f14baba Fix broken module resolution after large/rapid edits in nodenext (#46818)
* Fix broken module resolution after edits in nodenext

* Move field copying to a better place I guess
2021-11-17 13:04:43 -08:00
Andrew Branch 009dd487a6 Update symlink cache from AutoImportProvider resolution even if host project already contains the file via its realpath (#46830) 2021-11-16 16:39:10 -08:00
fcdbc932bf implement code fix for override of js files (#45780)
* feat: code fix for override in js files

Co-Authored-By: Wenlu Wang <kingwenlu@gmail.com>

* fix comments

Co-Authored-By: Wenlu Wang <kingwenlu@gmail.com>

* remove tryMergeJsdocTags

* fix: bring the two methods back as functions

* revert emitter changes

* fix comments

* fix: test failures

Co-authored-by: Wenlu Wang <kingwenlu@gmail.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-11-16 08:01:43 -08:00
Oleksandr T 719ab0b477 fix(43359): emit default exports with named exports that have the same names with types (#44718) 2021-11-12 11:25:52 -08:00
Armando Aguirre 7b86a65f22 Removed replacement from jsx completions (#46767)
* Removed replacement from jsx completions

* Fixed tests
2021-11-10 18:18:15 -08:00
Oleksandr T b12d5c5dc5 fix(46605): show completions in object literal parameters (#46743) 2021-11-09 14:50:26 -08:00
Gabriela Araujo Britto e5a6ae397d Fix extra newline in class member snippet completions (#46737)
* fix extra newline

* fix test
2021-11-09 12:03:07 -08:00
Oleksandr T a05d851dc3 fix(45907): don't use static member name to inherit JSDocs from instance members (#46274) 2021-11-08 15:05:08 -08:00
Oleksandr T 3ef3cdddb3 fix(45692): merge non-primitive in spread-union (#45729) 2021-11-05 15:41:06 -07:00
Oleksandr T 0a628ff0c9 fix(44059): omit duplicate types (#45739) 2021-11-05 15:36:08 -07:00
Oleksandr T 2d4b243195 fix(33325): allow extract refactoring on selected statement without trailing semicolon (#45765) 2021-11-05 10:00:31 -07:00
Oleksandr T 4fca1e1fcd fix(46666): add outlining spans for comments preceding call expressions (#46682) 2021-11-04 12:43:01 -07:00
Kagami Sascha RosylightandOrta ae582a22ee Add target: "es2022" (#46291)
* Add `target: "es2022"`

* Add Object.hasOwn

* formatToParts is es2018

* ref update

* optional parameter

* Revert "optional parameter"

This reverts commit e67d6e5f60.

* undefined

* error cause

* Lint fix

Co-authored-by: Orta <git@orta.io>
2021-11-04 10:55:11 -07:00
Oleksandr T ff75b8a180 fix(46615): remove useless assertion. change error suggestion for rest params (#46628) 2021-11-03 14:11:39 -07:00
Wesley Wigham d53630fac3 Make specifier generation from export map information conditional on module resolution mode (#46670) 2021-11-03 13:10:44 -07:00
Oleksandr T 7264cf7db5 fix(46589): omit ? in method signature completion for optional methods (#46594) 2021-11-03 12:56:17 -07:00
Anders Hejlsberg 831b770b95 Control flow analysis for destructured discriminated unions (#46266)
* CFA for dependent variables destructured from discriminated union

* Accept new baselines

* Add tests

* Limit calls to isSymbolAssigned

* Fix wrong operator
2021-11-02 15:48:13 -07:00
Wesley WighamandAndrew Branch de23842e45 Allow import assertions on esm imports under module: nodenext (#46630)
* Allow import assertions on esm imports under module: nodenext

* Changes to copy

Co-authored-by: Andrew Branch <andrew@wheream.io>
2021-11-02 15:34:37 -07:00
Oleksandr T b8f8fd7a3e fix(46512): allow to use tag names containing keywords with - (#46546) 2021-11-02 15:12:10 -07:00
Anders Hejlsberg 33fe1b6ffc Fix contextual typing for symbol-named properties (#46558)
* Properly handle symbol-named properties in contextual types

* Update index signature in PropertyDescriptorMap

* Add regression tests
2021-11-02 14:05:41 -07:00
Anders Hejlsberg 56f81075f9 Properly check whether union type contains only primitive types (#46645)
* Properly check whether union type contains only primitive types

* Add regression test

* Remove 'export' modifier from test
2021-11-02 12:46:26 -07:00
Anders Hejlsberg 7cbcfeea99 Exclude identity relation from mapped type relation check (#46632)
* Exclude identity relation from mapped type relation check

* Add regression test
2021-11-02 06:54:35 -07:00
Oleksandr T 5142e37f2d fix(43292): forbid highlighting multiline template strings (#46531) 2021-11-01 14:21:38 -07:00
Daniel Rosenwasser 6d33d8797b Check for type parameters on original type when getting type argument completions (#46614)
* Add failing test.

* Check for type parameters on the original type when asking for the type argument constraint.

* Update tests/cases/fourslash/stringLiteralTypeCompletionsInTypeArgForNonGeneric1.ts
2021-11-01 11:41:43 -07:00
Gabriela Araujo Britto 6b1e8f7baf remove placeholders in class member snippets (#46598) 2021-10-29 16:55:59 -07:00
Andrew Branch 7742cf2180 Set hasAddedOrRemovedSymlinks when discovering an existing file by its link (#46569)
* Set hasAddedOrRemovedSymlinks when discovering an existing file by its link

* Make it optional
2021-10-29 15:47:48 -07:00