22375 Commits

Author SHA1 Message Date
Nathan Shively-Sanders
70a5d27292 Move notation to es2020.intl.d.ts 2020-06-16 10:08:07 -07:00
Nathan Shively-Sanders
7f3499a334 Merge branch 'master' into NumberFormatOptions-notation 2020-06-16 10:05:16 -07:00
Wesley Wigham
4bda7ce8e5
Include reexported names in list of exported names (#38809) 2020-06-15 15:17:08 -07:00
Wesley Wigham
6a777ff6b3
Fix crash when serializing the return type of a generic call to Array.prototype.flat (#38904)
* Add declaration emit error and checking for circularly referential unions produced by recursive conditionals

* Allow indexed accesses to produce alias symbols on types

* Add test that still triggers the declaration emit error

* Fix spelling
2020-06-15 11:46:10 -07:00
Eli Barzilay
0432954f2d Small fix in getIsContextSensitiveAssignmentOrContextType
Test that `parentSymbol.valueDeclaration` exists.

Fixes #38532
2020-06-13 07:10:04 -04:00
Eli Barzilay
8231519b85 Simplify visitObjectLiteralExpression
I ran into it and the comment at the top tripped me, then I proceeded to
simplify the code.  Patched a bit more of the function to make sure that
the indentation doesn't change, and added tests.
2020-06-13 07:05:21 -04:00
Eli Barzilay
f447838f95 Fix handling of aruments in the emitter
Two problems are fixed:

* `isArgumentsLocalBinding` did only `PropertyAccessExpression`, now
  it's also doing `PropertyAssignment` (doesn't affect other files,
  since it's only used in the emitter).

* `visitShorthandPropertyAssignment` should call `visitIdentifier` on
  the synthesized id.  (For completion it might be better to make it
  visit the the original?)

Fixes #38594.
2020-06-13 07:05:21 -04:00
Andrew Branch
b63ea4b6df
Fix declaration emit for property references of imported object literal types (#39055)
* Fix declaration emit for property references of imported object literal types

* Add declaration file to test
2020-06-12 17:48:19 -07:00
Nathan Shively-Sanders
34c6b1a76b
Merge pull request #39052 from microsoft/dom-update-2020-06-12
DOM update 2020-06-12
2020-06-12 15:35:31 -07:00
Sheetal Nandi
f628bf8e24
Fix casing for wild card keys for implicit globs to get wild card directories to watch (#39049)
* Test showing how wild card directory is not watched because of mismatch in key case

* Fix casing for wild card keys for implicit globs
Fixes #36532
2020-06-12 14:21:51 -07:00
Nathan Shively-Sanders
4cf0afe266 DOM update 2020-06-12 2020-06-12 13:55:40 -07:00
Nathan Shively-Sanders
a26e60eb2c skip implements types with no symbols 2020-06-11 16:34:32 -07:00
Nathan Shively-Sanders
9f872c01e1 Merge branch 'master' into fix-implements-tag-emit 2020-06-11 16:05:21 -07:00
Nathan Shively-Sanders
a64166de14 isDynamicName skips parentheses for element access
Neither `x[0]` nor `x[(0)]` should be dynamic names. Previously, the
latter was because `isDynamicName` didn't skip parentheses.

Since the binder treats dynamic names in property assignments as
assignment declarations, this incorrectly tried to create a binding for
expressions like `x[(0)] = 1`.

This caused an assert because `x[(0)]` would not take the dynamic name
code path during binding (`hasDynamicName` returned false), but the
normal code path for static names.
2020-06-11 09:08:51 -07:00
Eli Barzilay
ffa35d3272 Allow e: unknown in catch arguments
In addition, allow an explicit `any`; anything else throws an error.

Also adjust and reorganize existing tests.

Fixes #36775.
2020-06-10 18:24:20 -04:00
Wesley Wigham
08cb0b23e8
Serialize (noncontextual) keyword named namespace members with export declarations in both declaration emitters (#38982)
* fix(38750): create unique names for keywords and re-export them with original names

* Serialize (noncontextual) keyword named namespace members with export declarations in both declaration emitters

* Add exhaustive keyword emit test for js declaration emitter and fix it up

Co-authored-by: Alexander T <alexander.tarasyuk@outlook.com>
2020-06-10 14:42:49 -07:00
Wesley Wigham
58330d05a1
Patch to use this.timeout() > 0 rather than this.enableTimeout() to work with mocha 8+ 2020-06-10 14:26:22 -07:00
Wesley Wigham
2287dbc7e2
Handle missing return type nodes and nested type references missing type arguments in existing jsdoc node serialization (#39011)
* Handle missing return type nodes and nested type references missing type arguments in existing jsdoc node serialization

* Accept updated baselines
2020-06-10 12:42:38 -07:00
Andrew Branch
852e7a0b60
Add containerName to CallHierarchyItem (#38997)
* Add containerName to CallHierarchyItem

* Update public APIs

* Update test to demonstrate nested namespace working
2020-06-10 11:56:03 -07:00
Andrew Branch
0d6ae004d7
Fix isSameEntityName (#38999)
* Fix isSameEntityName

* Add baseline

* Fix baseline
2020-06-10 10:53:02 -07:00
rockcs1992
74b4b5640a
Fix typo for 'blocklist' (#39001) 2020-06-10 08:27:16 -07:00
Daniel Rosenwasser
e832e04fa7
Merge pull request #37727 from Kingwl/logical_assignment
Add logical assignment operator
2020-06-09 14:44:08 -07:00
Wesley Wigham
f41398e100
Make isEntityNameVisible duplicate the node builder logic to always consider type parameters as visible if they are the resolution result (#38921) 2020-06-09 13:40:17 -07:00
Sheetal Nandi
a72ed0a2f5
Schedule failed lookup updates (#38560)
* Schedule failed lookup updates

* Tests
2020-06-09 12:00:37 -07:00
Sheetal Nandi
83f41deff2
Remove non null assertion on oldSourceFile.resolvedModules (#38984)
Fixes #37938
2020-06-09 11:52:39 -07:00
Nathan Shively-Sanders
d841971347
Merge pull request #38358 from a-tarasyuk/bug/38081
fix(38081): 'Debug Failure. Invalid cast.' for convert import quick fix
2020-06-09 08:50:56 -07:00
蜗牛老湿
3c49fb0d9f
use blocklist instead of blacklist (#38988) 2020-06-09 08:10:18 -07:00
csigs
9d8b61256f LEGO: check in for master to temporary branch. 2020-06-05 22:10:52 +00:00
Sheetal Nandi
0dc338281a
Deprecate reloadFs so the tests are more clear in what they are achieving and its easier to track changed behaviour (#38954) 2020-06-05 13:43:34 -07:00
csigs
9d4327f0f4 LEGO: check in for master to temporary branch. 2020-06-05 16:10:39 +00:00
csigs
4933bdb55e LEGO: check in for master to temporary branch. 2020-06-05 04:10:43 +00:00
Eli Barzilay
3151e2a365 Make hasCorrectArity handle tuples properly
This completes the work that started in PR #33069, and fixes #32835.

There are probably two additional related changes that are needed to
make this more complete:

* Fix the code that composes the error message (see the first two
  `FIXME`s in `callWithSpread3.ts`).

* Fix the code that checks the argument types (second two `FIXME`s).

* There is also an error in `genericRestParameters1.ts` which changed
  but should not be an error in the first place.  Added a `FIXME` there
  too.  (Probably will work if the previous iterm is done.)

In addition, `getEffectiveCallArguments` munges the arguments in case of
a spread in the last argument which might be better to avoid.  (I think
that there are cases where it wouldn't work anyway, such as a spread of
an array followed by a spread of an empty array.)
2020-06-04 23:46:56 -04:00
rchaser53
261386d48b fix error when use spread arguments twice 2020-06-04 23:46:56 -04:00
Eli Barzilay
4ee013d1a7 Fix merging of JS value & TS type decl
Fixes #38383
2020-06-04 19:28:33 -04:00
csigs
68315a0e29 LEGO: check in for master to temporary branch. 2020-06-04 22:10:50 +00:00
Eli Barzilay
a4c14a2cdc getSymbolDisplayPartsDocumentationAndSymbolKind: use actual symbol.flags for getAliasedSymbol
Fixes #35347.
2020-06-04 13:50:33 -04:00
csigs
3a55473eb1 LEGO: check in for master to temporary branch. 2020-06-04 16:10:54 +00:00
csigs
fdae7ee0ea LEGO: check in for master to temporary branch. 2020-06-04 04:10:42 +00:00
Jesse Trinity
3b15b35b37
Merge pull request #38378 from jessetrinity/refactorTriggerReason
Add RefactorTriggerReason
2020-06-03 11:18:08 -07:00
csigs
d8091de532 LEGO: check in for master to temporary branch. 2020-06-03 04:10:42 +00:00
Jesse Trinity
d88ea4e1f8 address PR comments 2020-06-02 19:06:12 -07:00
Jesse Trinity
463f8e10b9
Merge pull request #38734 from a-tarasyuk/bug/34934
fix(34934): Completions for private members appear in JavaScript files
2020-06-02 12:47:17 -07:00
Sheetal Nandi
9fbcb99a33
Emit build info even on noEmitOnError or tsc --build (#38853)
* Emit buildinfo when there are errors with noEmitOnError?
TODO: --build mode

* Always emit tsbuild info even if there are non syntax errors in tsc --build mode

* Sort affectedFilesPendingEmit for consistent build info text
2020-06-02 12:38:40 -07:00
Sheetal Nandi
f0da6d1203
Some changes to tsc baselines for clarity (#38850)
* Baseline programs in tsc -b and tsc -incremental mode as well

* Refactor outFile

* Tests

* Distinct input and output

* Add helper to baseline serialized invocations of tsc on incremental edits

* Input and output in watch mode

* Update src/testRunner/unittests/tsbuild/helpers.ts

Co-authored-by: Wesley Wigham <wewigham@microsoft.com>

Co-authored-by: Wesley Wigham <wewigham@microsoft.com>
2020-06-02 11:49:21 -07:00
csigs
eb01d0c701 LEGO: check in for master to temporary branch. 2020-06-02 16:10:34 +00:00
Alexander T
bc502c8c3c fix(38081): allow transforming object binding to named imports 2020-06-02 11:23:56 +03:00
Jesse Trinity
1d1c1673bf
add support to convert lambda to function and vice-versa (#28250)
* add skeleton

* add getAvailableActions

* add working getEditsForAction

* add multi vardecl

* fix multi decl bug

* change refactor name

* add tests for ToAnon, ToArrow and available arrow

* add tests for ToNamed and available anon

* add tests for ReturnType and available Arrow as FnParam

* fix bug modifiers by toNamed

* add tests for modifiers

* fix for tslint error

* adapt one test case

* refactor getInfo getAvailableActions

* refactor small progress

* extract creation of block

* extract creation of funcDeclaration

* make guideline compliant

* apply feedback from pr

* add testcase and apply feedback from pr

* apply feedback from pr

* add newline

* rename testcases

* Make conditions more expressive

* fix for unnecessary duplication of comment

* apply feedback from pr

* update getAvailableActions

* check if functionExpression name is used

* add more testcases

* do not provide refactoring when it contains this
because this behaves differently in arrow than in function

* exclude nested functions and classes at containingThis check

* fix linting error

* fix line endings

Co-authored-by: BigAru <arooran@indikon.ch>
Co-authored-by: bigaru <bigaru@users.noreply.github.com>
Co-authored-by: Jesse Trinity <42591254+jessetrinity@users.noreply.github.com>
Co-authored-by: Jesse Trinity <jetrinit@microsoft.com>
2020-06-01 15:26:45 -07:00
csigs
db85857d2b LEGO: check in for master to temporary branch. 2020-06-01 22:10:41 +00:00
Wesley Wigham
b36b803cdd
Skip default when initially iterating exports in __importStar, same as __exportStar (#38808)
* Skip default when iterating exports in __importStar, same as __exportStar

* Accept baselines
2020-06-01 14:52:24 -07:00
Jesse Trinity
fb3a84c4f1 fix line endings 2020-06-01 14:15:02 -07:00