Commit Graph
5064 Commits
Author SHA1 Message Date
Sheetal Nandi 12d736f0a4 Fix completions when writing spread expression
Fixes #29234
2019-03-13 14:25:43 -07:00
Wenlu Wang b97b1a8de6 add jsx factory and hold text in jsxtext node (#29439)
* add jsx factory and hold text in jsxtext node

* update jsxtext prop name and factory
2019-03-11 16:00:18 -07:00
Anders Hejlsberg 79813b8ece Show expanded parameter lists in signature help 2019-03-09 12:23:57 -08:00
Sheetal Nandi 990b199ebd Merge branch 'master' into incrementalBuildInfo 2019-03-08 11:42:19 -08:00
Anders Hejlsberg d59e51b063 Merge pull request #30215 from Microsoft/higherOrderFunctionTypeInference
Higher order function type inference
2019-03-08 10:41:32 -08:00
Gabriela Britto d2364f555f Merge pull request #30089 from Microsoft/convert-to-named-parameters
Convert to named parameters
2019-03-06 09:33:01 -08:00
Anders Hejlsberg b34fe67ac5 Fix issue of more inferences leading to worse results 2019-03-05 17:49:58 -08:00
Gabriela Araujo Britto 60b2d6a2f5 remove unnecessary closures 2019-03-05 16:56:30 -08:00
Gabriela Araujo Britto 98a146dcfc use getTouchingToken 2019-03-01 13:23:59 -08:00
Gabriela Araujo Britto cd060e75fe use interface for ValidVariableDeclaration 2019-03-01 09:17:44 -08:00
Gabriela Araujo Britto 1f91aa1c9b remove inlineable 2019-02-28 16:55:40 -08:00
Sheetal Nandi 46ddbff7b1 Fix test by reverting change in textChanges that occured by mistake in 499bc70056 2019-02-28 14:28:27 -08:00
Sheetal Nandi 5fd745d834 Update the tsconfigs 2019-02-28 14:01:40 -08:00
Sheetal Nandi d53efdf380 Changes to generation of .tsbuildinfo:
- If composite or incremental then only the .tsbuildinfo will be generated
- if --out or --outFile the file is outputFile.tsbuildinfo
- if rootDir and outDir then outdir/relativePathOfConfigFromRootDir/configname.tsbuildinfo
- if just outDir then outDir/configname.tsbuild
- otherwise config.tsbuildinfo next to configFile
2019-02-28 13:46:26 -08:00
Gabriela Araujo Britto 617d5af67e add diagnostics message for refactor description 2019-02-28 11:22:05 -08:00
Gabriela Araujo Britto 51616a4043 use sortAndDeduplicate instead of deduplicate 2019-02-28 09:50:57 -08:00
Gabriela Araujo Britto 7fd6868f8b minor refactors to convertToNamedParameters 2019-02-27 16:42:54 -08:00
Gabriela Araujo Britto 54c7996ff5 refactor getGroupReferences 2019-02-27 16:19:01 -08:00
Sheetal Nandi ed35741b5f Merge branch 'master' into incrementalBuildInfo 2019-02-27 15:45:59 -08:00
Nathan Shively-Sanders 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
Gabriela Araujo Britto 006fe14bcc refactor utilities 2019-02-26 16:22:08 -08:00
Gabriela Araujo Britto 970ec62364 remove unused LeadingTriviaOption and TrailingTriviaOption options 2019-02-26 10:02:57 -08:00
Gabriela Araujo Britto bf5123de6a don't export useNonAjustedPositions 2019-02-26 09:49:10 -08:00
Gabriela Araujo Britto e3a465ffa3 change startPosition and endPosition to leadingTriviaOption and trailingTriviaOption 2019-02-26 09:43:35 -08:00
Gabriela Araujo Britto 365967d484 Merge branch 'master' into convert-to-named-parameters 2019-02-25 10:54:58 -08:00
Sheetal Nandi 9fa28158bb Enable building typescript.d.ts with current source 2019-02-22 18:11:27 -08:00
Joseph Wunderlich d87e67df58 clarify intent in returnType creation 2019-02-22 18:00:21 -08:00
Joseph Wunderlich 21ab39649c remove any annotation from declare method quickfix 2019-02-22 17:24:21 -08:00
Gabriela Araujo Britto ce42aa43a8 check usages of class if refactoring a constructor 2019-02-22 16:31:40 -08:00
Sheetal Nandi 86b610df4b Merge branch 'master' into incrementalBuildInfo 2019-02-21 10:32:09 -08:00
Gabriela Araujo Britto 6b53489a4a Merge branch 'master' into convert-to-named-parameters 2019-02-20 13:24:09 -08:00
Gabriela Araujo Britto e40442d46a minor refactors 2019-02-20 11:13:04 -08:00
xiaofa 7c8c6cf4d0 fix no space before equal operator in type parameter 2019-02-20 18:12:09 +08:00
Gabriela Araujo Britto 17b89653c2 include trailing trivia after expression in getAdjustedEndPosition if endPosition is include 2019-02-19 14:20:37 -08:00
Gabriela Araujo Britto 78968b1281 don't provide refactor in js file 2019-02-19 09:10:27 -08:00
Gabriela Araujo Britto a773046181 copy argument comments to property 2019-02-15 16:48:54 -08:00
Gabriela Araujo Britto b6c8382c78 replace argument list instead of whole call when refactoring 2019-02-15 15:51:20 -08:00
Gabriela Araujo Britto eef3da5b6b create new ConfigurableStart and ConfigurableEnd options and rename them 2019-02-15 15:38:10 -08:00
Gabriela Araujo Britto 05e9d6c9de fix reference checking 2019-02-13 15:34:18 -08:00
Gabriela Araujo Britto ec0e734708 return function expression name in getFunctionDeclarationNames 2019-02-13 11:36:59 -08:00
Gabriela Araujo Britto ef4db31e84 don't apply changes when unexpected reference is found 2019-02-13 11:35:44 -08:00
Gabriela Araujo Britto dbd84996aa don't apply refactor when parameter has decorators 2019-02-11 14:24:05 -08:00
Sheetal Nandi 499bc70056 Make printer option to be writing bunfle file info and use the result instead 2019-02-11 13:47:24 -08:00
Gabriela Araujo Britto dba631de80 copy comments when refactoring 2019-02-11 12:02:51 -08:00
Gabriela Araujo Britto 26f8ddd46a create functions for copying trailing comments and rename previous copyComment function 2019-02-11 12:01:02 -08:00
Ron Buckton 61d13b740e Merge pull request #29726 from bmeurer/modifierFlagsCache
Make modifierFlagsCache mandatory for Node objects
2019-02-07 12:13:46 -08:00
Gabriela Britto 7d86fda151 fix hasThisParameter to check for parameters length 2019-02-06 16:06:46 -08:00
Gabriela Britto 9270e58eaf Merge branch 'master' into convert-to-named-parameters 2019-02-06 15:41:16 -08:00
Gabriela Britto b87392c22c fix duplication of leading and trailing comments on refactored function 2019-02-06 15:40:58 -08:00
Gabriela Britto 18b2b55387 add option to suppressLeadingAndTrailingTrivia non recursively 2019-02-06 15:38:59 -08:00