Commit Graph
3238 Commits
Author SHA1 Message Date
BigAru cba0ddcbde only show toString if expression is not binary 2019-03-24 16:52:24 +01:00
BigAru 1594468250 add possibility to invoke from parentheses 2019-03-24 16:52:24 +01:00
BigAru 74e3cd758e remove parentheses also when expression at ending 2019-03-24 16:52:24 +01:00
BigAru 7d9e8f4e21 treat corner cases 2019-03-24 16:52:24 +01:00
BigAru 6de23d766a do not offer refactoring for tagged templates 2019-03-24 16:52:24 +01:00
BigAru 76ce1c67ac fix test case 2019-03-24 16:52:24 +01:00
BigAru 3b284886b1 add toString visibility from expression and from middle part 2019-03-24 16:52:23 +01:00
BigAru 576271ef55 catch empty head of template literal 2019-03-24 16:52:23 +01:00
BigAru 2b299943f9 complete toString 2019-03-24 16:52:23 +01:00
BigAru 3d2b552fd3 complete toTemplate 2019-03-24 16:52:23 +01:00
BigAru fc13b2b43a add test cases 2019-03-24 16:52:23 +01:00
BigAru 6952b1f9a7 add visibility tests 2019-03-24 16:51:22 +01:00
BigAru 2bb2a8246a add test cases 2019-03-24 16:51:22 +01:00
BigAru 7620615212 add test cases 2019-03-24 16:51:22 +01:00
Gabriela Araujo BrittoandGitHub 0f6f3b79b5 Fix find all references of inherited constructor (#30514)
* recursively look for inherited constructor references

* add test

* remove outdated comment

* add tests

* move function

* improve tests

* minor refactor

* fix convert params refactoring to deal with inherited constructor calls

* simplify refactor test
2019-03-22 15:17:50 -07:00
Sheetal NandiandGitHub 800f7a3447 Merge pull request #30414 from Microsoft/jsSyntaxCompletions
Filter ts only keywords from js file completion
2019-03-20 10:38:11 -07:00
Gabriela Araujo BrittoandGitHub 84087d0e0a Use shorthand property assignment in convert parameters to object (#30468)
* create shorthand property assignment in argument object when possible

* add shorthand property assignment test

* don't offer refactor on jsdoc comment

* add jsdoc test

* improve jsdoc test

* use crlf
2019-03-19 09:28:09 -07:00
Gabriela BrittoandGitHub 10b9051624 Fix convert to named parameters rest parameter tuple (#30286)
* check if rest parameter is of tuple type in isOptionalParameter

* expose isArrayType and isTupleType in checker

* don't offer refactor if rest parameter type is neither array nor tuple type

* add tests for rest parameters

* fix tests for renamed refactor

* remove unnecessary conditional operator
2019-03-18 10:31:38 -07:00
Anders HejlsbergandGitHub d0646a629a Merge pull request #30084 from dragomirtitian/GH-26563
Improved argument description for parameters originating from tuples
2019-03-18 06:14:52 -10:00
Nathan Shively-SandersandGitHub 658798032b Fix globalThis completions (#30441)
* Fix, but with test not quite right

* Add missing completions to test

* Remove out-of-date comment
2019-03-15 19:10:39 -07:00
Sheetal Nandi f829f958a2 Filter ts only keywords from js file completion
Fixes #29212
2019-03-14 15:52:50 -07:00
Gabriela BrittoandGitHub 1c8a359914 rename convert to named parameters (#30401) 2019-03-14 13:41:29 -07:00
Gabriela BrittoandGitHub 7824fbc395 Merge pull request #30383 from Microsoft/fixFindAllRefsOfDefaultExport
Fix find all refs of default export
2019-03-14 09:39:06 -07:00
Sheetal NandiandGitHub 8b04143675 Merge pull request #30380 from Microsoft/completionsWhileWritingSpread
Fix completions when writing spread expression
2019-03-14 09:38:50 -07:00
Sheetal Nandi 526eda8f18 Add extends of type parameter as type only location for completions
Fixes #28511
2019-03-13 15:22:33 -07:00
Gabriela Araujo Britto 66e2c54fe5 add tests for finding references of named and default exports 2019-03-13 15:11:33 -07:00
Sheetal Nandi 12d736f0a4 Fix completions when writing spread expression
Fixes #29234
2019-03-13 14:25:43 -07:00
Collins AbitekanizaandWesley Wigham 7b55d1846b Giving too many arguments should error on the first argument that exceeds arity (#27982)
* span on first arg that exceeds arity

* refactor baseline

* handle cases for spread arguments

* refactor + add coverage for tuple spread cases

* create diagnostic on NodeArray of exceeding args

* test function overloading
2019-03-12 15:57:12 -07:00
Titian Cernicova-Dragomir 88babf2a90 Merge remote-tracking branch 'remotes/origin/master' into GH-26563 2019-03-11 02:31:07 +02:00
Gabriela BrittoandGitHub d2364f555f Merge pull request #30089 from Microsoft/convert-to-named-parameters
Convert to named parameters
2019-03-06 09:33:01 -08:00
Gabriela Araujo Britto 8c4ab69d09 add test for non-transient symbol 2019-03-04 09:34:04 -08:00
Nathan Shively-SandersandGitHub be2db9db12 Add globalThis (#29332)
* Restore original code from bind-toplevel-this

With one or two additional comments

* Working in JS, but the symbol is not right.

Still need to

1. Make it work in Typescript.
2. Add test (and make them work) for the other uses of GlobalThis:
window, globalThis, etc.

* Check in TS also; update some tests

Lots of tests still fail, but all but 1 change so far has been correct.

* Update baselines

A couple of tests still fail and need to be fixed.

* Handle type references to globalThis

The type reference must be `typeof globalThis`. Just `globalThis` will
be treated as a value reference in type position -- an error.

* Restore former behaviour of implicitThis errors

I left the noImplicitThis rule for captured use of global this in an
arrow function, even though technically it isn't `any` any more --
it's typeof globalThis.  However, you should still use some other method
to access globals inside an arrow, because captured-global-this is super
confusing there.

* Test values with type globalThis

I ran into a problem with intersecting `Window & typeof globalThis`:

1. This adds a new index signature to Window, which is probably not
desired. In fact, with noImplicitAny, it's not desired on globalThis
either I think.
2. Adding this type requires editing TSJS-lib-generator, not this repo.

So I added the test cases and will probably update them later, when
those two problems are fixed.

* Add esnext declaration for globalThis

* Switch to symbol-based approach

I decided I didn't like the import-type-based approach.

Update baselines to reflect the difference.

* Do not suggest globals for completions at toplevel

* Add tests of element and property access

* Look up globalThis using normal resolution

globalThis is no longer constructed lazily. Its synthetic Identifier
node is also now more realistic.

* Update fourslash tests

* Add missed fourslash test update

* Remove esnext.globalthis.d.ts too

* Add chained globalThis self-lookup test

* Attempt at making globalThis readonly

In progress, had to interrupt for other work.

* Add/update tests

* Addres PR comments:

1. Add parameter to tryGetThisTypeAt to exclude globalThis.
2. Use combined Module flag instead combining them in-place.
3. SymbolDisplay doesn't print 'module globalThis' for this expressions
anymore.
2019-02-27 14:14:34 -08:00
王文璐 4d7ec380a9 check completions with assignable rather than identity 2019-02-26 10:54:01 +08:00
Gabriela Araujo Britto a5153a94ab add tests 2019-02-25 14:14:28 -08:00
Gabriela Araujo Britto 365967d484 Merge branch 'master' into convert-to-named-parameters 2019-02-25 10:54:58 -08:00
Gabriela Araujo Britto f571866f47 add new tests for bad class references 2019-02-25 10:32:56 -08:00
Gabriela Araujo Britto bc3611d1dd update failing tests 2019-02-25 10:32:28 -08:00
Titian Cernicova-Dragomir 8d66d55de1 Improved argument description for parameters originating from tuples that were extracted from functions. (ie mapped functions) 2019-02-25 18:18:00 +02:00
Joseph Wunderlich 21ab39649c remove any annotation from declare method quickfix 2019-02-22 17:24:21 -08:00
Gabriela Araujo Britto 6b53489a4a Merge branch 'master' into convert-to-named-parameters 2019-02-20 13:24:09 -08:00
xiaofa 7c8c6cf4d0 fix no space before equal operator in type parameter 2019-02-20 18:12:09 +08:00
Gabriela Araujo Britto 754f4a45b6 refactor expected test output 2019-02-19 14:23:26 -08:00
Gabriela Araujo Britto edf0cec3dd add tests for inherited constructor and method 2019-02-19 14:22:59 -08:00
Gabriela Araujo Britto a773046181 copy argument comments to property 2019-02-15 16:48:54 -08:00
Gabriela Araujo Britto b93afffaf7 rename refactor tests 2019-02-15 15:36:11 -08:00
Gabriela Araujo Britto dbd84996aa don't apply refactor when parameter has decorators 2019-02-11 14:24:05 -08:00
Gabriela Araujo Britto 4e135f13b5 add tests for comments 2019-02-11 12:03:09 -08:00
Gabriela Britto 9270e58eaf Merge branch 'master' into convert-to-named-parameters 2019-02-06 15:41:16 -08:00
Gabriela Britto 1d1c82095c add tests for rest parameters 2019-02-04 12:53:02 -08:00
Gabriela Britto abb11550d3 add more tests 2019-02-01 16:44:22 -08:00