Commit Graph

32018 Commits

Author SHA1 Message Date
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
Armando Aguirre 55a1b50e7a Revert "Removed public commands"
This reverts commit 40751ba89b.
2020-07-09 15:55:51 -07:00
Ron Buckton 3fdd2342e6 Merge branch 'master' into fix/helpers/use-hasownproperty-call
# Conflicts:
#	tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-esModuleInterop-option-changes.js
#	tests/baselines/reference/tsc/declarationEmit/initial-build/when-pkg-references-sibling-package-through-indirect-symlink.js
2020-07-09 14:57:20 -07:00
Sheetal Nandi b397d1fd4a Fixes searches for export * as 'identifier' (#39533)
* Fixes searches for export * as 'identifier'
Fixes #39006

* Fix the context span to export declaration (was incorrectly set to sourceFile in prev commit)
2020-07-09 13:45:43 -07:00
Ron Buckton ae2f0068e3 Fix default import/export helper usage 2020-07-09 13:13:48 -07:00
ShuiRuTian bf1ea6508b fix static method reference non-static (#38730)
* fix static method reference non-static

* fix contextRangeIndex

* fix lint.

* fix style.

* update according to suggestion.

* continue fix.

* use every rather than foreach

* format

* fix

* add comment.

* fix according to review suggestions.

* Update src/services/findAllReferences.ts

* Update src/services/findAllReferences.ts

* Update src/services/findAllReferences.ts

* Update src/services/findAllReferences.ts

* Update src/services/findAllReferences.ts

Co-authored-by: Song Gao <song.gao@laserfiche.com>
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2020-07-09 12:21:12 -07:00
Jesse Trinity 8e9de9bed2 Fix39458 (#39508)
* remove undefined from optional parameter

* accept baselines

* use getTypeWithFacts
2020-07-09 11:17:18 -07:00
Alexander T 7c99086eb8 fix(39524): convert access property suggestion to string (#39527) 2020-07-09 11:08:44 -07:00
Andrew Branch 03c79d7422 Insert auto-imports in sorted order (#39394)
* Sort auto-imports

* Avoid re-checking sort all the time

* Add comment
2020-07-08 15:25:04 -07:00
csigs 8e5d4956c4 LEGO: Merge pull request 39510
LEGO: Merge pull request 39510
2020-07-08 15:12:05 -07:00
csigs 468201a4a7 LEGO: check in for master to temporary branch. 2020-07-08 22:11:10 +00:00