Commit Graph
100 Commits
Author SHA1 Message Date
Wenlu Wang 5f017df609 Fix top level logical assignment leak (#40536)
* Fix leaking top level logical assignment

* Fix leaking top level logical assignment
2022-03-14 10:48:31 -07:00
Wenlu WangandRon Buckton ec114b8931 Import assertion (#40698)
* Add parsing

* fix all api

* check gramma of import call

* Add more part of assertion

* Add some case

* Add baseline

* use module insted of target

* strip assertion in d.ts

* Update new baseline

* accept baseline

* Revert error number changes

* Update diagnostic message

* Accept baseline

* rename path

* Fix cr issues

* Accept baseline

* Accept baseline

* Error if assertion and typeonly import

* Accept baseline

* Make lint happy

* Add some comment

* Fix cr issues

* Fix more issue

* Incorporate PR feedback, fix module resolution for import()

* Add contextual type and completions for ImportCall options argument

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-09-20 14:15:22 -07:00
Wenlu Wang 8cdcec4454 Avoid provide hints for binding patterns (#44961)
* Avoid provide hints for binding patterns

* Rename as 56
2021-07-30 09:43:20 -07:00
Wenlu Wang 9665bc6199 Supress hints for access expr too (#45121) 2021-07-26 11:59:14 -07:00
Wenlu Wang fafe3ff0b4 Improve parsing in await and yield context (#44680)
* Improve parsing in await and yield context

* Avoid yield and await check in identifier

* Revert "Avoid yield and awaitt check in identifier"

This reverts commit 9644859f29.

* Add some comments
2021-06-21 17:30:55 -07:00
Wenlu Wang 8d3125b78a Allows plugin to register commands (#44291)
* Pass session into plugin

* Use unknown message type

* Add missing unknown

* use editor services insted of every project

* Fix baseline

* Add plugin test

* Avoid type parameter

* Accept baseline
2021-06-18 14:46:09 -07:00
Wenlu Wang 5b1e873b03 Update diagnostic message and quickfix for parameter property (#44010) 2021-05-08 23:22:20 -07:00
Wenlu Wang b0c2860a68 ignore static and declared member if checking override (#43569)
* ignore static member if checking override

* Ignore declared member when check override

* Check static override too

* Add more tests
2021-04-09 10:43:33 -07:00
Wenlu Wang f526a38856 Always grammar checker for override (#43544) 2021-04-06 07:29:57 -07:00
62f3ccd9c0 Error if assignment after block (#41115)
* Error if assignment after block

* Update src/compiler/diagnosticMessages.json

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Fix diags

* Error after block

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-31 15:57:25 -07:00
Wenlu WangandDaniel Rosenwasser 2f0c8b2bea --noImplicitOverride (#39669)
* wip: add types

* wip

* Add cases

* Add some case

* Add more check

* accept baseline

* add abstract abd declare method

* add override in declaration

* accept baseline

* add property override

* Fix decalre modifier

* update baseline

* Add more cases

* make lint happy

* make lint happy

* Update description

* Add codefix

* simplify code

* accept baseline

* Update desc

* Accept baseline

* Add override completions

* filter out implements field in override context

* fix tests

* Add parameter property check

* Accept baseline

* acept baseline

* Add parameter property to declaration code action

* Add quickfix for override parameter property

* fix code style

* Add override with interface tests

* Add more cases about modifier position

* rename flag

* rename flags

* Added tests.

* Accepted baselines.

* Always issue errors for unnecessary 'override' modifiers.

* Accepted baselines.

* Override perf (#4)

* try cache check result

* pre check for override

* Do not issue error if implement abstract

* Add abstract-spec check

* Avoid override dead lock

* Add more case

* Add codefix for new error

* Fix error message

* Add jsdoc override tag (#6)

* Override jsdoc tag (#7)

* accept baseline

* Disallow codefix in js

* update baseline

* Omit override in d.ts

* Add more case in js

* Accept baseline

* fix override js test

* fix crlf

* Revert merge conflict changes

* Accept baseline

* Avoid space

* Fix CR issues

* Accept baseline

* Fix typo and add more check

* Fix error name

Co-authored-by: Daniel Rosenwasser <Daniel.Rosenwasser@microsoft.com>
2021-03-26 16:29:22 -07:00
Wenlu Wang 41dc625b0a Add static index signature (#37797)
* Add static index

* fix lint

* make lint happy

* adjust test cases

* add more cases

* fix changes

* Add more case

* accept baseline

* fix error if extends others

* Update vfsUtil.ts

* use equal to empty array

* static signature of interface is an error

* Accept baseline

* Check index constraints for static signature

* Accpet baseline

* Fix crash

* fix crash

* Accept baseline

* Fix regression

* Fix crash

* always return new array
2021-03-26 15:30:09 -07:00
Wenlu WangandRon Buckton b20331a4db Fix missing func modifier (#40379)
* Fix missing function modifier

* Update src/services/refactors/convertArrowFunctionOrFunctionExpression.ts

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-03-10 09:34:31 -08:00
Wenlu Wang d6a32e31ae Fix import fix on react or react dev (#41950) 2021-02-16 10:28:48 -08:00
kingwl 870f5b613a Merge branch 'master' into noPropertyAccessFromIndexSignature_fix 2020-12-04 12:47:38 +08:00
Wenlu Wang 4f8fde38ca Rename codeFixNoPropertyAccessFromIndexSignature4.ts to codeFixNoPropertyAccessFromIndexSignature5.ts 2020-12-04 11:18:07 +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
Wenlu Wang 55810095f4 Allow qualified name for convert namespace import (#41592) 2020-12-01 15:23:57 -08:00
Wenlu WangandTypeScript Bot ca7510ea05 String literal rename support (#39298)
* add basicly support for rename string literal type

* fix merge conflict

* fix some behavior

* Update package-lock.json

* Update package-lock.json

* do not break old behavior if not type checked

* fix cr issue

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2020-11-06 09:58:34 -08:00
Wenlu WangandNathan Shively-Sanders ce8d702586 Add support for pedantic property access (#40171)
* Add support for pedantic property access

* accept baseline

* Update diag message

* Avoid pedantic

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-11-02 15:19:00 -08:00
Wenlu Wang fc03982b73 Add missing visitor of template literal type (#40738)
* Add missing visitor of template literal type

* make linter happy
2020-09-24 12:48:29 -07:00
Wenlu Wang f66c8e6a69 Fix missing renamed compiler flags (#40606) 2020-09-16 22:41:02 -07:00
ee5f51bc0f Add see tag support (#39760)
* Add see tag parser

* add baseline

* fix symbol resolve

* add more case

* fix unittests

* improve tests and parser

* accept baseline

* Adopt package-lock.json and npm ci

* Add a workflow to update package-lock.json daily

* Git ignore package-lock.json and forcibly update in workflow

* Update bot email address

* Delete extra npm update

* Update package-lock.json

* Add compactDisplay and signDisplay to NumberFormatOptions (#40039)

* Fix typo in (Readonly)Set.keys comment (fixes #40164) (#40176)

* fix(26325): use a unique name for reserved words in 'constructor like' function name (#39684)

* fix(25770): add diagnostic message for the possible mapped type used as an index (#39973)

* fix(31046): add new diagnostic message for incompatible constructor signature (#40073)

* Update package-lock.json

* Update package-lock.json

* Add rename support

* Accpet baseline

* wip

* fix anders

* Revert "fix anders"

This reverts commit b3178d4618.

* Fix call hierarchy item serialization and server tests (#40348)

* Avoid error

* accept baseline

* Add more tests

* Add signature name resolve

Co-authored-by: Andrew Casey <andrew.casey@microsoft.com>
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
Co-authored-by: Neil Kistner <neil.kistner@gmail.com>
Co-authored-by: cherryblossom000 <31467609+cherryblossom000@users.noreply.github.com>
Co-authored-by: Alexander T <alexander.tarasyuk@outlook.com>
Co-authored-by: Erich Gamma <egamma@microsoft.com>
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2020-09-09 10:45:09 -07:00
Wenlu Wang 57e2fe0462 Improve deprecated suggestion node position (#39702)
* Improve deprecated suggestion node position

* fix typo

* Simplify code

* merge helper function
2020-08-10 17:37:11 -07:00
Wenlu Wang a80f60c6d6 fix export * as default syntax (#39803)
* fix export * as default syntax

* update comments
2020-08-10 16:56:45 -07:00
Wenlu Wang fcd4fcb3d7 Use combined node flags (#39403) 2020-07-15 09:22:12 -07:00
Wenlu Wang 7b728754c0 Fix incorrect deprecated mark (#39611)
* Fix incorrect deprecated mark

* improve test
2020-07-15 08:47:25 -07:00
Wenlu Wang 453365284c Avoid check for union keys (#39314) 2020-07-06 15:01:05 -07:00
Wenlu Wang 6b4d0bff40 Avoid effect of element access expression (#39174)
* Avoid effect of element access expression

* Avoid unnecessary copy

* Add more tests
2020-06-25 17:38:05 -07:00
Wenlu WangandNathan Shively-Sanders 59ad375234 Add deprecated related feature (#38523)
* Add deprecated related feature

* Add more support

* fix navtree

* Add identifier check

* Add more deprecated

* fix crash

* fix more crash

* fix crash

* improve diagnostic

* avoid new tag

* avoid tags

* accept baseline

* Check deprecated in binder

* fix baseline

* fix jsdoc cache

* fix incorrect fix

* Avoid useless changes

* Accept baseline

* Add tests

* fix perf

* fix public api

* Adjust deprecated mark on qualifed name

* Revolve alias symbol

* Use modifier flags insted of symbol props

* Fix modifier flag resolve

* Make lint happy

* Fix crash

* fix crash

* Add cached utils function

* Accept baseline

* Add more tests

* try pinning octokit again

* Avoid tests

* Use utils some

* Deprecated perf test (#3)

* check valueDeclaration only

* check without modifierFlags

* donot check alias

* use cached tag

* remove call to jsdoc

* use deprecated tag

* revert changes

* Revert mission changes

* use node flags

* cache result

* cache

* avoid modifier flags

* Opts

* fix jsdoc include modifier

* fix tests

* fix again

* use symbol flag

* set @octokit/rest back to latest

* fix trailing spacel int

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-06-18 17:41:26 -07:00
kingwl 4d57d591d2 Avoid semi 2020-06-18 10:33:17 +08:00
kingwl 98a74ddfe8 Update baseline 2020-06-17 22:41:08 +08:00
kingwl 3b8ad5c870 Add outlining spans for call expression or arrow body 2020-06-17 20:50:19 +08:00
Wenlu WangandOrta Therox 6c11ceb8db Assignment operator is definite assignment (#39087)
Co-authored-by: Orta Therox <orta.therox@gmail.com>
2020-06-16 16:44:01 -04:00
kingwl fed922a5cb Accept baseline 2020-05-21 10:53:24 +08:00
kingwl 2997860c2e fix names 2020-05-21 10:23:00 +08:00
kingwl b73411c985 Fix type and simplify code 2020-05-21 10:19:36 +08:00
kingwl b59e4c51ae Merge branch 'master' into logical_assignment 2020-05-20 10:18:20 +08:00
kingwl 6f393e9196 accept new baseline 2020-05-16 08:16:45 +08:00
kingwl acc167dfc4 fix rebase conflict 2020-05-16 08:13:12 +08:00
kingwl 39ae072a1c add missing semi 2020-05-16 08:10:51 +08:00
kingwl f78a408ab5 Add more check 2020-05-16 08:10:51 +08:00
kingwl c0c60015c4 fix mission baseline 2020-05-16 08:09:46 +08:00
kingwl 11bed4456b avoid shouldCaptureInTempVariable 2020-05-16 08:09:46 +08:00
kingwl be708bbb0a fix assignment check of logical assignment 2020-05-16 08:09:45 +08:00
kingwl d2be8900dc Add type narrow 2020-05-16 08:09:45 +08:00
kingwl 67a4943e1f Add more case 2020-05-16 08:09:43 +08:00
kingwl 81ce254a73 Refactor logical assignment 2020-05-16 08:09:42 +08:00
kingwl cb2e71cdb9 fix operator 2020-05-16 08:09:41 +08:00
kingwl fafb82b01a make ci happy 2020-05-16 08:09:41 +08:00
kingwl ff4fca527d Fix cfa 2020-05-16 08:09:40 +08:00
Wenlu WangandDaniel Rosenwasser 944bcf8459 Update src/compiler/transformers/utilities.ts
Co-Authored-By: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-05-16 08:09:39 +08:00
kingwl ede6214157 Add more check 2020-05-16 08:09:39 +08:00
kingwl 82fe658a48 Add cfa 2020-05-16 08:09:38 +08:00
kingwl 9190a2c4e8 Add contextual types infer 2020-05-16 08:09:38 +08:00
kingwl f922427196 Add mission semi 2020-05-16 08:09:37 +08:00
kingwl da16b3e30b Add more case 2020-05-16 08:09:36 +08:00
kingwl 1d93db81cc Add logical assignment operator 2020-05-16 08:09:32 +08:00
Wenlu Wang 9725d623ce Fix build type error (#38525) 2020-05-13 07:44:49 -04:00
kingwl 6f4deaea78 Fix tranced es5 classes after new scope 2020-05-08 17:34:41 +08:00
Wenlu WangandNathan Shively-Sanders e66ce879a9 expose jsdoc factory (#29539)
* expose jsdoc factory

* refactor jsdoc factory

* correctly jsdoc factory types

* update jsdoc factory

* Add check for delete expression must be optional

* accept new basseline

* Revert "Add check for delete expression must be optional"

This reverts commit 76937c3b1a.

* remove newline

* make linter happy

* Add deprecated comment

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-05-06 15:06:12 -07:00
Wenlu WangandNathan Shively-Sanders 8d78984558 Add support of contextual quick info (#37451)
* Add support of contextual quick info

* Avoid document comment map

* Make lint happy

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-05-06 15:05:31 -07:00
Wenlu Wang 39beb1d011 Add check for delete expression must be optional (#37921)
* Add check for delete expression must be optional

* Add more tests
2020-04-22 03:12:01 -07:00
Wenlu Wang afc41f095d Quick fix for functions lacking return expressions (#26434)
* stash

* add surmise for return type

* add support for more case

* add more test case

* add more testcase and fix all test

* fix changed diagnosis

* fix broken test case

* add more case

* rename quickfix

* fix conflict

* fix fix desc

* fix semi

* Avoid replace brace with paren

* Split fix all action

* Add return work in same line

* fix test cases

* rename baseline

* refactor and handle comment

* Support semi

* make helper internal
2020-04-02 10:06:14 -07:00
Wenlu Wang 5596ed80d7 Add replacement span for string literal (#37490)
* Add replacement span for string literal

* fix change requests

* fix lint

* Avoid flag

* Fix baseline

* ADd misising baseline
2020-04-01 17:58:16 -07:00
Wenlu WangandNathan Shively-Sanders 20625a964b add promise.any (#33844)
* add promise.prototype.any

* add AggregateError

* Update src/lib/esnext.promise.d.ts

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

* update baseline again

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-03-11 08:36:00 -07:00
Wenlu WangandNathan Shively-Sanders 70399e146e add support for Lift Template Literal Restriction (#23801)
* add support for Lift Template Literal Restriction

* rename file and improve comment and tests

* fix NoSubstitutionTemplateLiteral support

* extract tagged template and add more test

* avoid useless parameter

* fix incorrect return node if cannot transform

* accept baseline

* correctly baseline

* accept baseline

* fix merge break

* fix merge break

* inline rescan template head or no subsititution template

* update scan error

* add comment and fix lint

* refactor and fix lint

* avoid blank

* fix merge conflict

* fix again

* fix again

* use multiple target

* fix space lint

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-02-05 08:59:51 -08:00
Wenlu Wang d2c5d54242 remove duplicate message (#36125) 2020-01-18 14:00:53 -08:00
Wenlu WangandDaniel Rosenwasser 4c7844be74 Implement export as namespace from (#34903)
* init export start as decl

* fix some broken

* fix more case

* fix more and more case

* make it work

* make lint happy and accept baseline

* add more tests

* fix system module

* add more case

* delete useless assert

* accept baseline

* make lint happy

* fix missing utils

* update api

* make lint happy

* add missing semi

* fix minor issue

* fix locally bound

* avoid useless check

* update public api

* add more case

* fix some case

* Use multi-module selection in test runner to cut down on duplication.

* Accepted baselines.

* remove superfluous tests.

* Remove baseline.

* Downlevel `export * as ns` in es2015.

* Accepted baselines.

* Update names of things.

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2019-12-20 16:00:20 -08:00
Wenlu Wang 234680851b add template literal spans (#34699) 2019-10-30 23:54:00 -07:00
Wenlu Wang 3d8252c70e avoid space before dot question (#33840) 2019-10-07 17:11:54 -07:00
Wenlu Wang 7c50bccec2 nullish coalescing commit (#32883)
* migrate nullish coalescing commit

* add more test case

* add branch type check test

* add more tests

* fix nullish precedence

* update public api

* add rescan question question token to fix regression

* update public api baseline

* Added tests that emit for nullish coalescing operator conforming with grammar restrictions when assertions are used.

* Fixed emit to hoist temporary variables (they previously went undeclared).
Added tests to ensure calls and property accesses are only called once.

* use not equal to null

* rename factory

* add grammar check

* fix more cases

* Fix handling of nullish coalescing oprator in expando objects.

* Fixed classifier to support ?? operator.

* update baseline

* accept baseline

* fix review

* update emitter and more testcase

* update control flow

* make linter happy

* update libs

* avoid unnecessary assert

* fix typooo

* Fixes for control-flow analysis
2019-09-30 15:33:50 -07:00
kingwl 93a250b9a6 fix duplicate async modifier codefix 2019-09-14 02:22:59 +08:00
Wenlu Wang af9ca21643 add support for extract as interface (#31644)
* add support for extract as interface

* fix action assert

* Donot provide convert to interface if duplicate member
2019-08-28 11:34:40 -07:00
Wenlu Wang 9942c6052f add completion for promise context (#32101)
* add completion for promise context

* check insert text inside add symbol helper

* fix incorrect branch

* avoid completions with includeCompletionsWithInsertText perferences

* avoid useless parameter
2019-08-26 15:26:25 -07:00
Wenlu Wang 714821fc97 add refactor of extract type (#30562)
* add basically implement

* add rename location and add testcase

* collection type arguments

* disallow infer type

* add support for typedef convert

* refactor info to make type safe

* disallow type pred

* avoid unnecessary branch

* disallow type query

* haha😂

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

* Update src/services/refactors/extractType.ts

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

* Update src/services/refactors/extractType.ts

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

* add more tests

* add template tag support in jsdoc

* add support of type parameters constraint

* add more tests

* merge branch

* add more tests

* refactor and update function name
2019-05-07 08:26:53 -07:00
Wenlu Wang 454b4280b1 check more case for empty binding patten (#25263)
* check more case for empty binding patten

* refactor binding pattern checking  getWidenedType

* fix spelling

* fix merge and rebase
2019-04-26 14:00:04 -07:00
Wenlu Wang b8e3c41ee1 fix jsdoc iterator on expression of export assignment (#30558) 2019-04-25 14:53:06 -07:00
Wenlu Wang 583edce6b0 fix compiler crash (#25925) 2019-04-25 10:51:36 -07:00
Wenlu Wang bc46c770bf allow literan enum const assertions (#30700)
* allow literan enum const assertions

* update desc
2019-04-25 10:09:21 -07:00
Wenlu Wang 27075555c8 fix generate typenode from negative numerical literal (#30610) 2019-04-23 14:20:53 -07:00
Wenlu Wang bd178746de improve error message when type have same name (#27065)
* improve error message when type have same name

* fix lint and function name

* update test case

* accept baseline
2019-04-23 12:56:03 -07:00
王文璐 9050d0fdf8 update external files api 2019-03-27 19:06:21 +08:00
王文璐 6bc5ef3474 Merge branch 'master' into avoid-quickfix-for-declaration-file 2019-03-27 18:36:56 +08:00
王文璐 e8b6615c2c update types 2019-03-22 18:13:18 +08:00
王文璐 35ded510bb Merge branch 'master' into attach_property_to_default_export 2019-03-22 17:40:37 +08:00
Wenlu Wang d2476759e2 add related error span for default exports (#25396)
* add related error span for default exports

* accept baseline

* stash

* accept baseline and fix lint

* update testcase

* Add missing semicolon
2019-03-12 13:15:14 -07:00
Wenlu Wang bd27296ba6 improve stripInternal with inline comments (#23611)
* improve stripInternal with inline comments

* fix lint

* stash

* simptify StripInternal

* fix internal type declaration

* fix internal type declaration again

* accept baseline

* refactor inline

* simply prev check

* remove getTrailingCommentRangesOfNode

* Merge implementation with new isInternalDeclaration method, accept lkg-based baseline
2019-03-12 13:14:47 -07:00
Wenlu Wang b97b1a8de6 add jsx factory and hold text in jsxtext node (#29439)
* add jsx factory and hold text in jsxtext node

* update jsxtext prop name and factory
2019-03-11 16:00:18 -07:00
王文璐 4d7ec380a9 check completions with assignable rather than identity 2019-02-26 10:54:01 +08:00
Wenlu Wang 592396d40a expose token flags and numeric flags (#29897)
* expose token flags and numeric flags

* hide hide useless token flags
2019-02-21 15:09:37 -08:00
kingwl bf42f5bd1c avoid add missing member in declaration file 2019-01-25 12:05:45 +08:00
kingwl b4b6e144ef Merge branch 'master' into PropertyDeclarationExclamationToken 2019-01-22 23:36:43 +08:00
kingwl e38ac0d5a4 fix api 2019-01-20 02:17:09 +08:00
kingwl e8497096d8 Merge branch 'master' into improve_type_arguments_parser_1 2019-01-20 01:54:49 +08:00
王文璐 9d16225bc2 emit jsx type arguments 2019-01-11 13:34:18 +08:00
王文璐 d8aa46224d save work and fix lint 2019-01-07 11:04:00 +08:00
王文璐 34b1384152 add transformer for emit add property to default export 2019-01-03 11:19:02 +08:00
王文璐 7c93affd7d fix typeof completions broken 2018-12-25 17:30:04 +08:00