Commit graph

30772 commits

Author SHA1 Message Date
kingwl
a593fd03fe Simplify code 2020-07-22 19:20:52 +08:00
kingwl
6e39ee706e fix typo 2020-07-22 19:14:39 +08:00
kingwl
cd5dde5d79 Improve deprecated suggestion node position 2020-07-22 19:07:12 +08:00
csigs
56865f722d
LEGO: Merge pull request 39682
LEGO: Merge pull request 39682
2020-07-20 21:11:42 -07:00
csigs
ea75b00c46 LEGO: check in for master to temporary branch. 2020-07-21 04:10:47 +00:00
Anders Hejlsberg
94d6b4507e
Consistent errors on circular base types (#39675)
* Properly track and report errors on circular base types

* Accept new baselines

* Add regression test
2020-07-20 20:35:47 -07:00
Anders Hejlsberg
5ae4b5d715
Properly preserve numeric string named properties in declaration files (#39658)
* Properly preserve names of properties with numeric literal strings

* Accept new baselines
2020-07-20 10:36:46 -07:00
Sheetal Nandi
3b22339df8
Triple slash references must resolve against the resolved file name (.d.ts and not original source file) since they are rewritten in the .d.ts emit (#39645)
* Add tests corresponding to repro from #37928

* Triple slash references must resolve against the resolved file name (.d.ts and not original source file) since they are rewritten in the .d.ts emit

* Remove the scenario not fixed in this PR
2020-07-17 16:25:32 -07:00
Alexander T
92f41c81fb
tests(39373): add addition tests (#39631) 2020-07-17 13:30:57 -07:00
Orta Therox
f19c610d91
Adds latest version of TypeScript to the repro code (#39641) 2020-07-17 15:15:49 -04:00
Wesley Wigham
191f4f63ab
Explicitly add dependency on node to compiler tsconfig, remove es6+ string method usage (#39636) 2020-07-17 07:02:05 -07:00
Wesley Wigham
5519027600
Minor fixes to consmetic build issues in user test PR script 2020-07-17 06:43:50 -07:00
Alexander T
4e24b1b00d
fix(39373): add diagnostic message about using a private name for class declarations without name (#39567) 2020-07-16 17:05:33 -07:00
Orta Therox
1d671c3588
Add twoslash repros to the compiler (#39628) 2020-07-16 18:39:49 -04:00
Sheetal Nandi
667ba74c93
Resolve only relative references in open files on syntax server (#39476)
* Resolve only relative references in open files on syntax server

* Support resolving tripleslash references only in the open file

* Apply suggestions from code review

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

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-07-16 14:31:24 -07:00
Alexander T
c07c885151
fix(39515): fix getting a position for an element before the line break CRLF/LF on the line that contains 'after' element (#39554) 2020-07-16 13:56:30 -07:00
Alexander T
6430211f8f
fix(38868): add separator for type parameters (#39621) 2020-07-16 10:58:16 -07:00
Anders Hejlsberg
db79030410
Support variadic tuple inference from trailing optional to non-optional (#39614)
* Permit variadic tuple inference from trailing optional to non-optional

* Add tests
2020-07-15 17:46:48 -07:00
uhyo
b6f09ccf06
Better error message for unparenthesized function/constructor type notation in union/intersection types (#39570)
* add graceful error message for unparenthesized function types in union and intersection

* add unparenthesizedFunctionTypeInUnionOrIntersection test

* add unparenthesizedConstructorTypeInUnionOrIntersection test

* Update src/compiler/parser.ts

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

* pass isInUnionType to parseFunctionOrConstructorTypeToError

* Apply suggestions from code review

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

* syntax fix

* refactor isStartOfFunctionType into isStartOfFunctionTypeOrConstructorType

* Update src/compiler/parser.ts

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

* hoist isUnionType

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-07-15 14:43:56 -07:00
Sheetal Nandi
37e6e2761c
Do not resolve require calls in typescript files even if it contains dynamic import (#39617)
* Existing tests showing require in ts file is not used for module resolution

* Do not resolve require calls in typescript files even if it contains dynamic import
Fixes #38611
2020-07-15 14:31:55 -07:00
Wesley Wigham
f2c5643056
Flag mapped types with circular property types and do not attempt to print them structurally (#39552) 2020-07-15 11:19:43 -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
Andrew Branch
dd2fc86f2b
Don’t give all instantiated signatures in JS strict arity (#39606) 2020-07-14 18:56:50 -07:00
Wesley Wigham
ef9affe2f6
Use jsxFragmentFactory entity name for factory name lookup from checking fragments (#39475) 2020-07-14 17:25:45 -07:00
Alexander T
ececf3b0a7
fix(33511): show jsx namespace default import quick fix if it does not exists in the current scope (#38419) 2020-07-14 15:43:18 -07:00
Andrew Branch
98ab3a788f
Fix tsc --watch crash on module augmentations when module resolution changes (#39604)
* Add failing test

* Ensure source files are bound before analyzing them
2020-07-14 15:05:10 -07:00
Michael Crane
f68a8393ef
Load ETW module from a specified path (#39599) 2020-07-14 11:52:55 -07:00
Jesse Trinity
17022388bd
Add refactor convertToOptionalChainExpression (#39135)
* add convertOptionalChain

* cover more cases

* expose containsMatchingReference

* clean up performing edits

* bound start position

* add tests

* refactor and handle edge cases

* update tests

* consider explicit requests for empty spans

* update fourslash to use trigger reason

* add tests cases for trigger reason

* fix errors

* remove type assertion

* fix non ampersand chains

* clean up some logic

* add ternary case

* add diagnostic message

* add nullish check for ternary expressions

* Update src/services/refactors/convertToOptionalChainExpression.ts

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

* Update src/services/refactors/convertToOptionalChainExpression.ts

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

* Update tests/cases/fourslash/refactorConvertToOptionalChainExpressionForTriggerReason3.ts

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

* Update tests/cases/fourslash/refactorConvertToOptionalChainExpressionForTriggerReason1.ts

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

* reformat and remove unused checks

* allow any for ternary refactor

* add tests

* add tests

* check return and variable statements

* use isMatchingReference instead of containsMatchingReference

* allow partial selections

* fine tune selection ranges

* recurse for call expressions

* fix spellings

* add recursive cases

* remove isOrContainsMatchingReference

* cleanup

* more refactoring

* cleanup

* rename tests

* address PR comments

* check match syntactically

* handle another call expression case

* some renames

* inline some checks

* add test

* address comments

* add refactorNotAvailableReason

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-07-13 19:33:33 -07:00
Armando Aguirre
6279f981b3
Merge pull request #37029 from armanio123/AddToggleCommentFeature
Add ToggleLineComment and ToggleMultilineComment service
2020-07-13 17:48:50 -07:00
Andrew Branch
3c91133f97
Fix find-all-references on undefined (#39591)
* Fix find-all-references on `undefined`

* Show references in input files in baseline

* Inline commentEachLine

* firstOrUndefined doesn’t take undefined
2020-07-13 17:21:16 -07:00
Armando Aguirre
635ee24a3c Merge remote-tracking branch 'upstream/master' into AddToggleCommentFeature 2020-07-13 16:58:19 -07:00
Ron Buckton
1e7d0891fc
Merge pull request #39490 from microsoft/fix37113
Fix namespace import/export helper usage under '--esModuleInterop'
2020-07-13 11:37:25 -07:00
Ron Buckton
5ad8532a11 Merge branch 'master' into fix37113
# Conflicts:
#	src/compiler/transformers/module/module.ts
2020-07-13 11:13:35 -07:00
Ron Buckton
2c08affa0d
Merge pull request #39264 from microsoft/migrateMapsAndSets
Migrate maps and sets
2020-07-13 10:38:30 -07:00
Norviah
bcb4a490b6
Fix typo (#39562) 2020-07-13 13:17:44 -04:00
Andrew Branch
583bd92bc4
Don’t create expando declarations on alias symbols (#39558)
* Don’t create expando declarations on alias symbols

* Update other baseline

* Fix brace nesting refactor mistake
2020-07-13 10:05:48 -07:00
Kenn Sarsaba
629dd6487b
Fix typo (#39585) 2020-07-13 07:43:53 -07:00
Alexander T
31f75fed09
fix(types/mocha): change deprecated Mocha types (#39573) 2020-07-12 21:21:07 -07:00
Armando Aguirre
0d38f09e36 PR comments and minor bugs 2020-07-10 17:44:02 -07:00
Ron Buckton
87fd1827f2
Merge pull request #39537 from microsoft/fix/helpers/use-hasownproperty-call
fix(helpers): Use `hasOwnProperty.call`
2020-07-10 16:54:02 -07:00
Sheetal Nandi
8002473ea6
Add ClassExpression, FunctionExpression and ArrowFunction to check for cancellation token from classifier (#39557)
Fixes #35364
2020-07-10 13:39:09 -07:00
Sheetal Nandi
294fcb537c
Handle typeAcquisition could be undefined (#39551)
Fixes #36834
2020-07-10 12:56:35 -07:00
Anders Hejlsberg
c335aad665
Remove object literal freshness in control flow based array types (#39518)
* Remove object literal freshness in control flow based array types

* Add regression test
2020-07-10 10:18:15 -07:00
谭九鼎
87a74aa9ce
CI: Use checkout@v2 (#38822) 2020-07-10 12:10:26 -04:00
Nathan Shively-Sanders
3b107fec3b
Fix @param type parameter lookup (#39532)
Previously, getObjectTypeInstantiation had special-case code to look up
type parameters for `@param` as if they were in the parameter location.

This should occur in the main lookup loop of `getOuterTypeParameters`,
however. The current code only runs once, which is not sufficient, and
it also jumps to the parameter for any type contained in a `@param`,
which skips type parameters that occur in the tag itself.
2020-07-10 08:42:25 -07:00
Armando Aguirre
a534f2aa97 Fixed syntax error 2020-07-09 22:15:02 -07:00
Armando Aguirre
ef81a0d0ee Merge remote-tracking branch 'upstream/master' into AddToggleCommentFeature 2020-07-09 21:55:36 -07:00
Armando Aguirre
6fd91ee59f Fixed baseline 2020-07-09 21:34:34 -07:00
Armando Aguirre
b81f240e96 PR comments 2020-07-09 18:35:54 -07:00