Commit Graph
435 Commits
Author SHA1 Message Date
Sheetal Nandi d62c8a403c Merge pull request #30107 from Microsoft/applyChangesToOpenFiles
Add UpdateOpen to request
2019-03-05 15:54:34 -08:00
Sheetal Nandi e55fbffed6 Rename the request as updateOpen 2019-03-05 14:34:08 -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
Sheetal Nandi 03377f70b7 Apply changes in reverse order even in new API to match behaviour with internal api 2019-02-27 14:07:15 -08:00
Sheetal Nandi fd10c12116 Revert "Use execFileSync in typing installer"
This reverts commit bc386c11fd.
2019-02-26 14:01:42 -08:00
Sheetal Nandi e6068f405b Make applyChangesToOpenFiles efficient to handle batch file opens, close and changes before updating projects
Fixes #29667
2019-02-26 11:54:29 -08:00
Sheetal Nandi 2258bb2fb7 Add request applyChangesToOpenFiles 2019-02-26 10:21:01 -08:00
Sheetal Nandi 6fd7011870 Add test that batches all the open files to update program only once 2019-02-26 10:21:01 -08:00
Wesley Wigham ee17915801 Fix build breaks (#29977)
* Some callbacks in watchUtilities werent being strictly checked due to the structural fallback

* Add direct dependeny on ms since mocha removed its impl

* Manually init stats collection on base runner like mocha.run now does
2019-02-19 14:30:58 -08:00
Sheetal Nandi b2b360a64f Merge pull request #29816 from Microsoft/ti
Use execFileSync in typing installer
2019-02-15 10:47:04 -08:00
Ryan Cavanaugh 02a5ef6a17 Add setInterval/setTimeout 2019-02-11 11:26:19 -08:00
Nathan Shively-Sanders 17d16d1bbb Disable checkJS survey (#29830)
* Disable checkJS survey

* Completely remove survey infrastructure

* Re-instate the protocol part of SurveyReady
2019-02-11 08:36:35 -08:00
Sheetal Nandi bc386c11fd Use execFileSync in typing installer 2019-02-07 14:20:20 -08:00
Kagami Sascha Rosylight 13c72b786e Merge remote-tracking branch 'upstream/master' into es2019 2019-02-08 06:55:56 +09:00
Ron Buckton b9ca653cf6 Merge branch 'async-es2018' of https://github.com/saschanaz/TypeScript into saschanaz-async-es2018 2019-02-07 13:27:25 -08:00
Ron Buckton a94c383b71 Merge pull request #27292 from kpreisser/fix26090
Align the ShimMap iterator behavior with native Maps
2019-02-07 11:17:22 -08:00
Kagami Sascha Rosylight b3c179540a String.prototype.{trimStart,trimEnd} hit stage 4 2019-02-08 00:51:23 +09:00
Kagami Sascha Rosylight f525a89e87 Array.prototype.{flat,flatMap} hit stage 4 2019-02-08 00:10:34 +09:00
Kagami Sascha Rosylight 40a4bd0a95 revive esnext.symbol 2019-02-07 10:45:44 +09:00
Kagami Sascha Rosylight a8823f5169 Merge branch 'master' into es2019 2019-02-07 10:08:26 +09:00
Kagami Sascha Rosylight 5a6dc081f6 revive esnext.asynciterable 2019-02-07 10:01:36 +09:00
Kagami Sascha Rosylight 2c4589d5a9 Merge remote-tracking branch 'upstream/master' into async-es2018 2019-02-07 09:51:26 +09:00
Nathan Shively-Sanders 33af4ea250 assertNever no longer crashes on string input (#29764) 2019-02-06 08:57:24 -08:00
kpreisser c4960d3c11 Adjust the unit test to spot a missed bug in the delete() implementation. 2019-02-01 11:59:26 +01:00
kpreisser b502ae98e1 Add a unit test for the shimMap (currently failing).
This will test that iteration is in insertion order, new entries added during iteration will be visited by the iterator, and values can be deleted while an iterator is running.
2019-02-01 11:59:22 +01:00
Ryan Cavanaugh 2f7627b363 Merge pull request #28190 from ispedals/bug/24709
Support synthesized SourceFile parent in getOrCreateEmitNode (#24709)
2019-01-30 19:12:11 -08:00
Benjamin Lichtman 62cf44cb9b Allow per-file setting for rename default behavior preferences (#29593)
<!--
Thank you for submitting a pull request!

Here's a checklist you might find useful.
* [ ] There is an associated issue that is labeled
  'Bug' or 'help wanted' or is in the Community milestone
* [ ] Code is up-to-date with the `master` branch
* [ ] You've successfully run `jake runtests` locally
* [ ] You've signed the CLA
* [ ] There are new or updated unit tests validating the change

Refer to CONTRIBUTING.MD for more details.
  https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md
-->

Fixes #29585.
#29314 and #29385 made it so their respective settings are only recognized when provided to the host as a whole.
This PR makes it so that the relevant settings for the preferences on the file override those of the preferences on the host.
2019-01-30 19:08:30 -08:00
Sheetal Nandi 26e546aeaa Merge pull request #29626 from Microsoft/toLowerCase
Handle get from readFileCache correctly.
2019-01-30 13:10:40 -08:00
Sheetal Nandi 604af5c621 Handle get from readFileCache correctly.
Fixes #29623
2019-01-28 12:30:05 -08:00
Klaus Meinhardt 451ff29263 revert change of trailing comment parsing 2019-01-27 17:41:20 +01:00
Klaus Meinhardt 68133e5fad Merge branch 'master' into shebang-comments 2019-01-27 17:37:10 +01:00
Sheetal Nandi e51a2fe80d Skip declaration emit for files that are just executables 2019-01-25 14:24:35 -08:00
Sheetal Nandi 1b12a855e8 Merge branch 'master' into inputFiles 2019-01-24 15:44:45 -08:00
Sheetal Nandi 216ed1b385 Get dts content from sourceFile if present 2019-01-24 13:47:27 -08:00
Sheetal Nandi 50d98aee0e Create getters for js sourcemap, dts and dts map text getters in prepend nodes 2019-01-24 13:38:25 -08:00
Sheetal Nandi 9acff37947 Add test to test the readFile called on prepend input file for emitting and verifying emit 2019-01-24 12:17:45 -08:00
Pete Bacon Darwin 331b9bcfde Use the correct source when skipping trivia
A custom `SourceMapSource` can optionally provide its own `skipTrivia`
function. If this is not provided then the compiler will use the default
function designed for TypeScript source files.

Previously, when calling this default function we were passing the current
`sourceMapSource` rather than the specified `source` whose trivia needs
to be skipped. This resulted in the `pos` being incorrectly calculated for
external source files that need mapping.

**Side note:**

There are actually two possible constructors available for creating
`SourceMapSource` objects. One of them defaults to an identity function
for the `skipTrivia` function if it is not provided (see
https://github.com/Microsoft/TypeScript/blob/49689894d747714d6b2b8461b9033020efec9625/src/compiler/utilities.ts#L6972-L6976)
and the other one leaves the `skipTrivia` field `undefined` (see
https://github.com/Microsoft/TypeScript/blob/5fc8f1dd801dbacfe7e2d624f80b7a6a3868d180/src/services/services.ts#L776-L797)

Unfortunately, it appears that the second of these two constructors is the
one available when importing the "typescript" module in node.js code.
2019-01-24 10:28:10 +00:00
Sheetal Nandi 9bd23652ef Merge pull request #29161 from Microsoft/incrementalBuild
Supports incremental build in tsc --b --w mode
2019-01-17 13:44:48 -08:00
Benjamin Lichtman 5fc8f1dd80 Add opt-in user preference for prefix and suffix text on renames (#29314)
* Add user preference to control renaming through exports

* Only impact renaming

* Update baselines

* Use flag to control all prefix and suffix text and imports

* [WIP] add tests

* Only skip export import specifier with flag

* [WIP] Update tests

* Update test

* Pick up preference from host and update test

* Shorten flag name

* Add missing utility function

* Update comment

* [WIP] rename flag and respond to cr

* [WIP] Add flag for forRelatedSymbol

* Use larger search symbol set for old-style rename

* Respond to CR

* Fix small error

* Fix type mismatch

* Update comment and remove unnecessary exprot

* Respond to CR
2019-01-16 10:58:07 -08:00
Kagami Sascha Rosylight d8ac9ba414 Merge branch 'master' into es2019 2019-01-16 10:54:46 +09:00
Kagami Sascha Rosylight 6cd531b3d7 Merge branch 'master' into async-es2018 2019-01-16 10:48:06 +09:00
Andrew Casey 35f64fa894 Merge pull request #29421 from amcasey/DisabledLSHardening
Harden telemetryOnOpenFile against disabled projects
2019-01-15 11:23:05 -08:00
Andrew Casey 3fb09630a8 Add regression test 2019-01-15 10:55:15 -08:00
Benjamin Lichtman c5948bf068 Merge pull request #29385 from uniqueiniquity/renameImportPref
Add user preference to opt-in to renaming import paths
2019-01-15 10:29:57 -08:00
Benjamin Lichtman d029fae35c Add user preference to opt-in to renaming import paths 2019-01-11 14:45:08 -08:00
Sheetal Nandi b23664adf7 Test to verify external source map range addition 2019-01-11 12:23:24 -08:00
Sheetal Nandi 1b37830615 Merge branch 'master' into incrementalBuild 2019-01-09 10:40:01 -08:00
Sheetal Nandi 76c9d9f717 Fix the failing test case 2019-01-08 16:08:43 -08:00
Sheetal Nandi 1870ee4099 Merge branch 'master' into tsconfig_canonicalpath 2019-01-08 16:04:22 -08:00
Kagami Sascha Rosylight 1d8a2ea38c Symbol.prototype.description hit stage 4 2019-01-06 11:42:55 +09:00