Commit Graph

7483 Commits

Author SHA1 Message Date
Andy
6286c7577d Allow rest parameter trailing commas in ambient contexts (#23139) 2018-04-04 11:33:29 -07:00
Nathan Shively-Sanders
c4a504b3ce Prototype assignments count as method-like (#23137)
* Prototype assignments count as method-like

For the purposes of reporting prototype/instance property conflicts

* Fix lint
2018-04-04 11:03:31 -07:00
Nathan Shively-Sanders
eb3a9d05df Fix factorial jsdoc search:chained assignments (#23115) 2018-04-04 08:57:13 -07:00
Andy
4aeb295e3a completions: Properly handle preferences.includeCompletionsWithInsertText (#23092) 2018-04-04 08:36:48 -07:00
Mohamed Hegazy
db74229a89 Merge pull request #19317 from igelbox/fix-insert-space-after-function-generic
Fixed incorrect insertSpaceBeforeFunctionParenthesis behavior on funtions with type-arguments
2018-04-03 16:11:30 -07:00
Nathan Shively-Sanders
6b158de866 No error referring to UMD symbol in CommonJS modules (#23129) 2018-04-03 16:10:09 -07:00
Wesley Wigham
78ba32a110 Allow multiple class base types; intersect them, as with interfaces (#23123) 2018-04-03 16:08:52 -07:00
Wesley Wigham
343bb5ac70 Actuallt preserve nonblock for of statements in forofs with object rest (#23122) 2018-04-03 13:32:42 -07:00
Mohamed Hegazy
84548d5c9b Merge pull request #22049 from Kingwl/spelling-fix
replace element access if suggession is not a valid identifier
2018-04-03 13:29:43 -07:00
Anders Hejlsberg
6646717ce7 Merge pull request #23112 from Microsoft/fixTPReferenceLookups
Fix type parameter reference lookups
2018-04-03 12:32:05 -07:00
Wesley Wigham
cbce76ed13 Consider jscontainer aliases as referencible even if they have other local meanings (#23119) 2018-04-03 12:27:16 -07:00
Wesley Wigham
a81a645128 Enable member completions for import types (#23085)
* Enable member completions for import types

* Add missing semicolon

* Compact statements

* Ye doth compacteth too much

* Handle class accesibility
2018-04-03 11:53:01 -07:00
Anders Hejlsberg
cdf155e980 Add regression test 2018-04-03 09:04:36 -07:00
Nathan Shively-Sanders
11eabc0946 Skip parens and non-null assertions when looking for this-context (#23097)
* Skip parens and ! for getting this-context of call

* Add test and improve code a bit

* Use skipOuterExpressions instead
2018-04-03 06:23:59 -07:00
王文璐
414266cc32 Merge branch 'master' into spelling-fix 2018-04-03 10:51:40 +08:00
Andy
1e04bd4168 Support completions for members with symbol names (#23091) 2018-04-02 18:08:00 -07:00
Anders Hejlsberg
751eab9eed Merge pull request #23067 from Microsoft/fixTPReferenceInConditional
Fix type parameter reference checks in conditional types
2018-04-02 17:30:32 -07:00
Wesley Wigham
fd553df3a6 Path completions for import types (#23082)
* Path completions

* Add missing flag to test

* Minify test, fix lint
2018-04-02 16:15:50 -07:00
Andy
8e14ac7d51 Improve string literal completions from a signature (#23062) 2018-04-02 13:01:31 -07:00
Nathan Shively-Sanders
d3e0929b14 Mark js-assignment functions' symbols as methods (#23078)
This make display more accurate:
1. The functions now print as methods
2. When the type of the function references the class, the type of the
function itself is now printed correctly instead of as `any`.
2018-04-02 12:17:35 -07:00
Andy
d5142a7f45 Don't offer import completions in non-module files unless "--module" is set (#22951)
* Don't offer import completions in non-module files unless "--module" is set

* Even smarter shouldOfferImportCompletions
2018-04-02 10:21:14 -07:00
Wesley Wigham
414bc49cc4 Module or import types (#22592)
* Type side of import types

* Value side of import types

* Accept library changes

* Refined implementation, more tests

* Allow resolutions to be performed late if the resolution still results in a file already in the build

* Add another test case

* Add some jsdoc usages

* Allow nodebuilder to use import types where appropriate

* Parse & check generic instantiations

* use import types in nodebuilder for typeof module symbols

* Wire up go to definition for import types

* Accept updated type/symbol baselines now that symbols are wired in

* PR feedback

* Fix changes from merge

* Walk back late import handling

* Remove unused diagnostic

* Remove unrelated changes

* Use recursive function over loop

* Emit type arguments

* undo unrelated change

* Test for and support import type nodes in bundled declaration emit
2018-04-02 10:18:23 -07:00
Nathan Shively-Sanders
5c442419dc Include arrow functions as javascript initializers (#23068)
This means that they are treated as valid js containers, methods, etc.
2018-04-02 10:11:39 -07:00
Nathan Shively-Sanders
6d9a8250bd Improve binding and jsdoc of chained special js assignments (#23038)
* Search for jsdoc on chained assignments

* Fix binding of chained binary expression js-assignments

* Test:chained jsdoc+chained prototype assignment

* Improve naming
2018-04-02 09:47:01 -07:00
Anders Hejlsberg
ec02ccd575 Add regression test 2018-04-02 09:23:00 -07:00
Andy
ea65f21677 textChanges: Don't crash when inserting type annotation on function with no parens (#23034) 2018-04-02 08:41:22 -07:00
Andy
86a8e269fa Add 'getNameFromPropertyName' helper (#23036) 2018-04-02 08:14:15 -07:00
Anders Hejlsberg
b3829523b2 Merge pull request #23039 from Microsoft/fixConditionalConstraints
Improve conditional type constraints
2018-03-31 11:56:05 -07:00
Wesley Wigham
9b558f9535 Remove _this, _super, and _newTarget name conflict errors (#22890)
* Add new generated name kind for reused transpiler variables

* Remove error on _super or _newTarget conflict

* Add test with super helper conflict

* Remove error on _this conflict

* Fix lint

* Use flags instead of generated kinds, inline some things

* Accept rename

* Remove trailing whitespace

* Move helper emit into printer, rather than emitter"

* passthru module and target

* New test, accept baselines

* Make members private
2018-03-30 17:43:37 -07:00
Wesley Wigham
8543d30372 Add union check to improved error message (#23027) 2018-03-30 16:23:24 -07:00
Anders Hejlsberg
b84e05e669 Add tests 2018-03-30 16:21:16 -07:00
Wesley Wigham
a53f9e8ec3 Call ensureModifiers on private property modifiers (#23026) 2018-03-30 16:07:09 -07:00
Arthur Ozga
9dd3ef4205 Merge pull request #22849 from aozgaa/dev/aozgaa/cSharpObjLiteralFormatting
CSharp Style Object Literal Formatting
2018-03-30 15:45:46 -07:00
Mohamed Hegazy
31c3ef51d3 Merge pull request #22251 from jack-williams/jack-williams/no-implicit-symbol-to-string
Fix #19666: Check for symbol types in template expressions
2018-03-30 09:32:11 -07:00
Anders Hejlsberg
7714a2bb5b Merge pull request #22989 from Microsoft/fixImpliedConstraint
Fix implied constraints in conditional types
2018-03-29 17:06:16 -07:00
Mohamed Hegazy
b47c1fd5a1 Merge pull request #22593 from Kingwl/module-spelling-fix
add spelling suggestion support for module
2018-03-29 16:56:43 -07:00
Wesley Wigham
6b7bf5e22c Do not rely on ElementAttributeProperty if it is not present (#22936)
* Do not rely on ElementAttributeProperty if it is not present

* Fix bug

* Fix nits and lint
2018-03-29 16:19:55 -07:00
Wesley Wigham
1ed30c6d4d Elide type reference comments which are also imported (#22752)
* Elide type reference comments which are also imported

* Explicit undefined

* Accept reordered symbols
2018-03-29 16:15:55 -07:00
Arthur Ozga
95a69cbeb4 Merge branch 'master' into dev/aozgaa/cSharpObjLiteralFormatting 2018-03-29 16:10:33 -07:00
Mohamed Hegazy
e3f02b5608 Merge pull request #22275 from delftswa2018/21617-detailed-error-forof-iterators
Fix #21617: Give detailed message on `for-of` of iterators without downlevelIteration
2018-03-29 15:43:00 -07:00
Arthur Ozga
5fb5ff7bf3 add option for object literal indent 2018-03-29 15:40:23 -07:00
Wesley Wigham
ea8904e33d Propagate noDefaultLib comment into emitted declaration files (#23003) 2018-03-29 15:38:29 -07:00
Ryan Cavanaugh
5af72b5f02 Merge pull request #22993 from dhruvrajvanshi/issue-22785
Issue 22785
2018-03-29 15:10:04 -07:00
Andy
4309c0e7f8 Fix bug: ClassDeclaration not guaranteed to be first declaration of a class (#22983)
* Fix bug: ClassDeclaration not guaranteed to be first declaration of a class

* fix test
2018-03-29 14:55:22 -07:00
Wesley Wigham
793f4696a4 Fall back to check expression if resolving an export assigned entity name fails (#22928)
* Fall back to check expression if resolving an export assigned entity name fails

* Comments from code review

* Add back in assertion

* Remove nameNotFoundMessage check from resolveName isReferenced check (rely on just isUse instead)
2018-03-29 13:54:12 -07:00
Wesley Wigham
3acafe5f42 Consider property accesses in heritage clauses as type-space references for calculating type reference directives (#22746) 2018-03-29 13:51:52 -07:00
Wesley Wigham
43a482f03f Emit amd-module and amd-dependency comments in emitter if printing declaration comments (#22740)
* Emit amd-module and amd-dependency comments in emitter if printing declaration comments

* Move code a bit

* Move again
2018-03-29 13:43:31 -07:00
Wesley Wigham
509a53fea7 Propagate CheckFlags.Late through instantiateSymbol (#22749) 2018-03-29 13:42:26 -07:00
Wesley Wigham
411c59a8ef Copy comments from inferred types to generated nodes (#22730) 2018-03-29 13:38:36 -07:00
Wesley Wigham
64ee623fd6 NodeBuilder only preserves parameter modifiers for constructors (#22706) 2018-03-29 13:34:07 -07:00