30873 Commits

Author SHA1 Message Date
Nathan Shively-Sanders
6fea7ff536
Add unit tests for VersionRange (#40114)
* Add unit tests for VersionRange

Make it easier to understand the intended semantics next time I have to
read this code.

* I miss prettier
2020-08-18 13:06:17 -07:00
Andrew Branch
dbab46c363
The falsy part of any/unknown is any/unknown (#39529) 2020-08-18 11:06:44 -07:00
csigs
24832e8100
LEGO: Merge pull request 40112
LEGO: Merge pull request 40112
2020-08-18 09:11:35 -07:00
csigs
c191f10ed6 LEGO: check in for master to temporary branch. 2020-08-18 16:10:44 +00:00
csigs
a2d20a2f4d
LEGO: Merge pull request 40108
LEGO: Merge pull request 40108
2020-08-18 03:11:43 -07:00
csigs
9bf6b7bf53 LEGO: check in for master to temporary branch. 2020-08-18 10:10:53 +00:00
Alexander T
9f3af67929
fix(10019): allow renaming labels (#40064) 2020-08-18 01:04:49 -07:00
Wesley Wigham
f9cca25cd7
Fix lack of error on default export of nonexistant name (#40094)
* Modify test harness so it can report underlying issue, fix small parent pointer issue

* Fix underlying export asignment check issue and fix lints

* Ensure class/function duplicate declaration errors are reported regarless of which is encountered first

* Ensure flag conflict errors are reported regardless of which declaration is encountered first
2020-08-17 15:30:19 -07:00
csigs
156a6e2713
LEGO: Merge pull request 40099
LEGO: Merge pull request 40099
2020-08-17 15:12:25 -07:00
csigs
e0b494b34a LEGO: check in for master to temporary branch. 2020-08-17 22:11:16 +00:00
Nathan Shively-Sanders
c3d41bbb73
Alias for commonjs require in JS (#39770)
* First attempt at aliases for require

* test+initial support for const x=require

* 1st round of baseline improvements

* 2nd round of baseline updates

* support property access after require

* check @type tag on require

* forbid expando missing namespaces on aliases

taken from #39558 as soon as it was created

* accept error baselines that are good, actually

* Scribbling on d.ts emit code

* use getSpecifierForModuleSymbol

* hideous hack for module.exports of aliases

* Fix module.exports.x --> export list emit

* fix isLocalImport predicate

* require only creates aliases in JS

* re-handle json imports

* update fourslash baseline

* Cleanup in the checker

1. Simplify alias resolution.
2. Simplify variable-like checking.
3. Make binding skip require calls with type tags -- they fall back to
the old require-call code and then check from there.

I haven't started on the declaration emit code since I don't know what
is going on there nearly as well.

* Function for getting module name from require call

* First round of cleanup plus a new test

Found one missing feature, not sure it's worth adding.

* more small cleanup

* more cleanup, including lint

* use trackSymbol, not serializeTypeForDeclaration

* Code review comments, plus remove unneeded code

Ad-hoc type reference resolution for `require` isn't needed anymore.

* find all refs works

* remove old ad-hoc code

* make it clear that old behaviour is not that correct

* update api baselines

* remove outdated comment

* PR feedback

1. Fix indentation
2. Add comment for exported JSON emit
3. Add test case for nested-namespace exports.

* add a fail-case test (which passes!)
2020-08-17 14:00:37 -07:00
Daniel Rosenwasser
97a072926f
Revert "Add '(approximate)' to the beginning of quick info requests in PartialSemantic mode (#40061)" (#40072)
This reverts commit 2426eb4980d34c762e745cdb5062ca211e65f25e.
2020-08-17 11:45:39 -07:00
Anders Hejlsberg
cd30534327
Recursive conditional types (#40002)
* Support recursive conditional types

* Accept new API baselines

* Accept new baselines

* Simplify recursive type tracking in type inference

* Accept new baselines

* Add tests

* Accept new baselines

* Revise recursion tracking in type inference

* Revise tests

* Accept new baselines

* Add more tests

* Accept new baselines
2020-08-15 18:22:30 -07:00
Daniel Rosenwasser
2426eb4980
Add '(approximate)' to the beginning of quick info requests in PartialSemantic mode (#40061)
* Add '(approximate)' to the beginning of quick info requests.

* Use 'approximation' instead of 'approximate'.
2020-08-14 17:54:10 -07:00
Sheetal Nandi
c95cffe111
Ensure file, include and exclude specs used are strings (#40041)
* Test displaying failure when specs used are not strings

* Ensure specs used are strings
Fixes #38164, #39856

* Feedback
2020-08-13 17:08:20 -07:00
Zen
0ed523bb60
fix jsx completions after attributes (#39859)
closes #39530
2020-08-13 16:14:12 -07:00
Alexander T
edc88c51ca
fix(15230): change the diagnostic message about a non-module file in an --isolatedModules project (#40032) 2020-08-13 14:03:17 -07:00
Wesley Wigham
44d9ceaf14
Small branch sync script change 2020-08-13 13:17:05 -07:00
Alexander T
610fa28de5
feat(40004): make isNamedTupleMember public (#40005) 2020-08-12 20:46:40 -07:00
Sheetal Nandi
03d946d145
Revert to including only open files in partial semantic server mode (#40026) 2020-08-12 20:45:59 -07:00
Eli Barzilay
620e260576 Avoid the double-symbol trick for enums
Nameless jsdoc typedefs have their exportedness controlled by the
exportedness of the location they pull their name from.

Fixes #33575.
2020-08-12 18:40:57 -04:00
Alexander T
1f5caf554c
fix(13503): fix crash on calling getTypeAtLocation with the SourceFile nodes (#39994) 2020-08-12 00:11:25 -07:00
Nathan Shively-Sanders
d371ae770d
No this-property assignments in TS (#40009)
* No this-property assignments in TS

Even when `this` is aliased, which I mistakenly allowed in #39908.

* remove errant file
2020-08-11 15:46:49 -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
Nathan Shively-Sanders
1ec71f0e0c
Bind alias ThisProperty assignment declarations (#39908)
* Bind alias ThisProperty assignment declarations

This is a quick prototype that does the wrong thing at the wrong time
with the wrong technique.

* Preliminary checker handling for aliases

Duplicative and untested, but I think I updated all the places that need
updating.

* new is error; old one should not have been removed

* I don't even know what's happening with this test

* cleanup and testing in the checker

* binder: use lookupSymbolForNameWorker instead of mutable

This should have about the same behaviour and is much easier to
understand.

Also refactor common code a bit.

* Shorter name of lookupSymbolForName

Once upon a time there was a parent/worker function, but now it's just a
single function again. No need for the -Worker suffix.

* remove oodate comment

* fix switch-case-break lint

* Refactor and move functions

* Rename and improve type of getContextualTypeForAssignmentDeclaration
2020-08-10 16:45:55 -07:00
Josejulio Martínez
668bbc64ff
Export anonymous functions in 2 steps, declare as variable and then assign to exports. (#39820)
* Preserve the variable name when exporting an arrow or anonymous function
 This allows the browser or node to properly name the (arrow) function

* Updated tests to reflect previous change

* Remove duplicated comment

* Transforms variable.initializer using moduleExpressionElementVisitor

* PR feedback: rbuckton
 - Use isArrowFunction and isFunctionExpression

* PR feedback: rbuckton
- Consider ClassExpresion, they can also be named based on the
  variable.
2020-08-07 17:16:03 -07:00
Nathan Shively-Sanders
3328fdb2d8
Use isUncalledFunctionReference for aliases too (#39950)
* Use isUncalledFunctionReference for aliases too

Fixes bogus deprecated notices on imports of functions with deprecated
overloads, but with some non-deprecated overloads.

Fixes microsoft/vscode#104238

* Just check all declarations, don't call isUncalledFunction
2020-08-07 10:07:55 -07:00
Nathan Shively-Sanders
dd09e8799c
Update CI node versions (#39940)
Drop 8, add 14
2020-08-06 14:14:21 -07:00
Jesse Trinity
91a7c359b3
Insert auto imports after header comment (#39924)
* place first import after header

* don't insert before non-header
2020-08-06 13:33:29 -07:00
Ron Buckton
fca9f451d8
Add missing 'importName' for private field helpers (#39932) 2020-08-06 13:27:19 -07:00
Andrew Branch
87a3b42d72
Handle empty package.json files (#39937) 2020-08-06 11:04:21 -07:00
csigs
e9f82e4aa2
LEGO: Merge pull request 39927
LEGO: Merge pull request 39927
2020-08-05 15:12:12 -07:00
csigs
9ad3b47e60 LEGO: check in for master to temporary branch. 2020-08-05 22:11:17 +00:00
Sheetal Nandi
da5ff57608
Renames in servermode per feedback (#39883)
* Server mode renames as per feedback

* More renames
2020-08-05 12:19:15 -07:00
Andrew Branch
7f4e1b699a
Find tagless JSDoc as preceding token (#39912) 2020-08-05 10:09:45 -07:00
csigs
2ebdf9fdce
LEGO: Merge pull request 39921
LEGO: Merge pull request 39921
2020-08-05 09:11:30 -07:00
csigs
a548e4f363 LEGO: check in for master to temporary branch. 2020-08-05 16:10:40 +00:00
csigs
58438519f9
LEGO: Merge pull request 39917
LEGO: Merge pull request 39917
2020-08-05 03:11:38 -07:00
csigs
7d11da17c0 LEGO: check in for master to temporary branch. 2020-08-05 10:10:46 +00:00
Nathan Shively-Sanders
c9f05af2c8
Merge pull request #37891 from Neonit/jsDocIndentationPreservation
Fix indentation preservation in JSDoc (#37717)
2020-08-04 16:09:50 -07:00
csigs
4c7ea8ed4a
LEGO: Merge pull request 39913
LEGO: Merge pull request 39913
2020-08-04 15:12:00 -07:00
csigs
c96bad261a LEGO: check in for master to temporary branch. 2020-08-04 22:11:06 +00:00
Sheetal Nandi
bcccae2fd4
Handle the fact that noResolveResolution resolution is reused (#39889)
Fixes #39795
2020-08-04 13:33:27 -07:00
csigs
6247364181
LEGO: Merge pull request 39904
LEGO: Merge pull request 39904
2020-08-04 09:11:33 -07:00
csigs
3d9eb73db2 LEGO: check in for master to temporary branch. 2020-08-04 16:10:42 +00:00
Daniel Rosenwasser
2106b07f22
Rename and use the default ref instead of having a workflow_dispatch option 2020-08-04 00:14:24 -07:00
Daniel Rosenwasser
817dc52fd3
Add an 'Update LKG' action (#39897) 2020-08-04 00:05:24 -07:00
Daniel Rosenwasser
d985e68ffa
Bump version to 4.1. (#39894)
* Bump version to 4.1.

* Update baselines.
2020-08-03 23:38:55 -07:00
csigs
ed55e0c0d1
LEGO: Merge pull request 39896
LEGO: Merge pull request 39896
2020-08-03 21:11:30 -07:00