Commit graph

857 commits

Author SHA1 Message Date
Alexander T 33eeceec9e Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-06-19 18:48:52 +03:00
Alexander T 62119ec9cc @typescript-eslint/no-unnecessary-type-assertion 2019-06-19 18:45:02 +03:00
Nathan Shively-Sanders fce7f9f87b Move .test-cost.json
Also include parameter name in test output so that people will know what
to do to change the percent chance of failure.
2019-06-19 08:40:06 -07:00
Alexander T 5ce8c831b4 prefer-const 2019-06-19 17:58:49 +03:00
Alexander T 504b932f7b @typescript-eslint/camelcase 2019-06-19 17:30:28 +03:00
Alexander T 5902b327db no-unused-expressions 2019-06-19 17:01:53 +03:00
Alexander T fdfff3593e no-template-curly-in-string 2019-06-19 16:42:05 +03:00
Suhas Deshpande f8004a33dd semi-colon 2019-06-18 23:17:58 -07:00
Suhas Deshpande 8a11f15569 Add unit test 2019-06-18 22:50:48 -07:00
Sheetal Nandi 7ed3896a0a
Merge pull request #31587 from microsoft/definitionSpan
Include declarationSpan as relevant declaration span when defintion or other places are declaration name
2019-06-18 14:07:15 -07:00
Nathan Shively-Sanders b4b5bf04a1 Fix lint 2019-06-14 16:07:41 -07:00
Nathan Shively-Sanders 3ef953a819 Allow passing skipPercent
Currently, the default is 5%.

0 gives you 0% time savings
2.5 gives you 29%
5 gives you 38%
10 gives you 50%
20 gives you 65%
2019-06-14 15:59:39 -07:00
Nathan Shively-Sanders a852f2feea Skip costly tests
1. Add a script to generate a sorted list of most costly tests. A tests'
cost is roughly `runtime% / number of edits`. A slow test that's only
been updated once is much less valuable than a slow test that has
been updated 20 times: the latter test is catching more changes in the
type system.

2. Check in the results of running this script. I want to make the
skipping behaviour deterministic and the same for everybody, even though
you may get slightly better performance by examining only *your* test
changes.

3. Add code to skip tests until it reaches a 5% chance of missing an
edit. Right now this provides a 38% speedup.

Still not done:
4. Make this value configurable.
5. Make the CI configuration specify a 0% chance of missing an edit.
2019-06-14 13:35:41 -07:00
Alexander T a18aeee1eb @typescript-eslint/no-unnecessary-qualifier 2019-06-14 12:34:28 +03:00
Alexander T bea1bcb466 brace-style 2019-06-14 10:51:09 +03:00
Alexander T 123ca0d639 no-empty 2019-06-14 10:21:51 +03:00
Alexander T d8796d5eaf @typescript-eslint/no-this-alias 2019-06-14 10:16:19 +03:00
Alexander T f96fb53e4c no-restricted-globals 2019-06-14 10:12:06 +03:00
Sheetal Nandi 73bf2684ac Rename to use contextSpan 2019-06-13 12:41:21 -07:00
Sheetal Nandi da2aa9781e Revert to using spread instead of mutating value later 2019-06-12 15:25:16 -07:00
Sheetal Nandi a0d164f142
Merge pull request #31820 from microsoft/nodeModules
When resolving from typings cache, handle node code modules
2019-06-12 10:55:26 -07:00
Sheetal Nandi 520f7e8067
Merge pull request #31818 from microsoft/sharepointIssue
Do not watch tsconfig files from folders that we canot watch (because they are at roots we want to ignore)
2019-06-12 10:47:17 -07:00
Daniel Rosenwasser a7a0c3300d
Improve ts6307 error (#31706)
Improve ts6307 error
2019-06-10 15:17:49 -07:00
Sheetal Nandi 2fd80b3142 When resolving from typings cache, handle node code modules
Fixes #29865
2019-06-07 16:21:39 -07:00
Sheetal Nandi 6ed8aae683 Test when node typings dont get added on subsequent update graph because of invalid typing
Test for #29865
2019-06-07 16:19:56 -07:00
Sheetal Nandi a6c72a0cf3 Do not watch tsconfig files from folders that we canot watch
Fixes #30818
2019-06-07 12:10:21 -07:00
Sheetal Nandi a84ed93f72 Merge branch 'master' into definitionSpan 2019-06-06 14:13:09 -07:00
Sheetal Nandi a67b375d0e Handle module specifiers 2019-06-06 13:39:04 -07:00
Sheetal Nandi 5c21fad12f
Merge pull request #31432 from microsoft/builderAPI
Api for tsc --build and --incremental
2019-06-05 12:31:00 -07:00
Paul van Brenk c5578a2b43 Update error message as requested by @danielrosenwasser 2019-06-04 19:08:34 -04:00
Paul van Brenk a658f728a9 Include the project filepath in the error message for files not being
listed in the 'include' pattern. TS6307
2019-06-02 11:54:48 -04:00
Benjamin Lichtman eb81feaf04
Merge pull request #31685 from uniqueiniquity/stopInvalidatingOnOpenFileSave
Stop invalidating module resolution cache when saving an open file
2019-05-31 20:36:33 -04:00
Benjamin Lichtman d3b6ba557a Change test instead of behavior 2019-05-31 14:46:15 -07:00
Benjamin Lichtman 7ac5fa783b Refactor and add wildcard scenario 2019-05-31 11:24:54 -07:00
Benjamin Lichtman a30cacb562 Add test 2019-05-30 16:56:27 -07:00
Andrew Branch b8dcf27c3e
Merge pull request #31482 from andrewbranch/bug/31338
Organize imports: don’t delete import declarations used for module augmentation
2019-05-30 14:01:55 -07:00
Sheetal Nandi fd86f40d05 Include declarationSpan as relevant declaration span when defintion or other places are declaration name
Fixes #30849
2019-05-24 15:44:32 -07:00
Andrew Branch 60d0bb9b19
Don’t touch imports used for module augmentation in non-declaration files since it could change JS emit 2019-05-22 11:37:35 -07:00
Ron Buckton 3d2af9ff33
Relocate Debug namespace to reduce duplication (#31524) 2019-05-22 11:20:29 -07:00
Sheetal Nandi 1e7a77cf78
Merge pull request #31503 from microsoft/casing
Ignore drive letters when comparing casings of the files with forceConsistentCasingInFileNames
2019-05-22 09:25:34 -07:00
Sheetal Nandi 38f689d19e
Merge pull request #31484 from microsoft/completionsSorting
Add sortText depending scope of symbols
2019-05-21 12:59:01 -07:00
Sheetal Nandi 43c7eb77e1 Switch to using File not found message instead of trace message file does not exit
Fixes #30872
2019-05-21 09:43:40 -07:00
Sheetal Nandi db150517d7 Ignore drive letters when comparing casings of the files with forceConsistentCasingInFileNames
Fixes #31327
2019-05-21 09:32:17 -07:00
Sheetal Nandi 00cea41b65 Add sortText depending scope of symbols
Fixes #15024
2019-05-20 15:53:51 -07:00
Andrew Branch 6faeee449d
Don’t remove imports that are used for module augmentation, just remove their import clauses 2019-05-20 14:49:28 -07:00
Andrew Branch 0f15bda45f
Add failing test 2019-05-20 13:31:44 -07:00
Sheetal Nandi 138f757709 Fix the test since tsbuildinfo is now always emitted (629bc0c) 2019-05-16 12:50:17 -07:00
Sheetal Nandi ec4ea0e474 Watch only built projects 2019-05-16 11:21:09 -07:00
Andrew Branch 15daf42b2c
Merge pull request #31028 from andrewbranch/feature/smart-select
Smart Select language service API
2019-05-16 09:45:05 -07:00
Sheetal Nandi 0cb980dd6e Add api to build referenced projects 2019-05-15 15:28:13 -07:00
Sheetal Nandi 629bc0c04d Always emit tsbuild info if path says so (irrespecitive of if there exists bundle and project) 2019-05-15 11:54:17 -07:00
Sheetal Nandi b3dac18679 Merge branch 'master' into builderAPI 2019-05-09 16:07:47 -07:00
Sheetal Nandi 97fcea14d5 Api to get next invalidated project 2019-05-09 16:02:26 -07:00
Klaus Meinhardt 0c9db717ad fix parsing of leading union/intersection operator (#31265)
* fix parsing of leading union/intersection operator

Fixes: #30995

* test declaration emit
2019-05-08 14:09:11 -07:00
Ron Buckton 0c1a283bf9 Add opt-in behavior for custom transforms to support bundles 2019-05-07 17:29:02 -07:00
Sheetal Nandi 9f9ae000cb Enable getSemanticDiagnosticsOfNextAffectedFile for EmitAndSemanticDiagnosticsBuilder 2019-05-07 16:32:52 -07:00
Sheetal Nandi f017433857 Move everything into state so we can pass it around 2019-05-06 15:43:25 -07:00
Sheetal Nandi 71b190af61 Create api for buildNextProject 2019-05-02 16:15:40 -07:00
Sheetal Nandi 3da47963d5 Remove startWatching as explicit method from api 2019-05-02 15:22:07 -07:00
Sheetal Nandi e8074f7fdc Rename cleanAll to clean and take optional project as input 2019-05-02 15:00:53 -07:00
Sheetal Nandi 5b361c8497 Make API to build project and wire cancellation token 2019-05-02 14:16:06 -07:00
Sheetal Nandi 9ba4ab1eae Merge branch 'master' into builderAPI 2019-04-30 12:36:07 -07:00
Kagami Sascha Rosylight 49d6f61298 Add ES2019 Object.fromEntries function (#30934)
* add ES2019 Object.fromEntries function

* add some comments

* apply suggested changes

* add readonly and general any
2019-04-30 09:49:58 -07:00
Sheetal Nandi 1a75c62ceb Remove resetBuildContext 2019-04-29 13:27:53 -07:00
Sheetal Nandi ddee617e84 Make SolutionBuilder and SolutionBuilderWithWatch separate 2019-04-29 13:16:36 -07:00
Sheetal Nandi 92365027a1 Remove getUpToDateStatusOfFile from solution builder since that test anyways is tested with the --watch mode 2019-04-29 13:13:22 -07:00
Sheetal Nandi 845f67a394 Make api to return build order 2019-04-29 13:13:21 -07:00
Sheetal Nandi 3e77b96824 Fix the graph ordering test case to check actual order and not just members as set 2019-04-29 13:11:52 -07:00
Sheetal Nandi fb21e70d71 Target affects emit hence mark the option so that all files are reemitted when target changes
Fixes #31118
2019-04-29 13:05:31 -07:00
Kagami Sascha Rosylight 1a75d525fa add ES2020 matchAll APIs (#30936) 2019-04-25 14:11:50 -07:00
Andy Hanson dc7c9bad3d Avoid eagerly computing test payload (#27851) 2019-04-25 13:26:19 -07:00
Sheetal Nandi f27cf9b34e
Merge pull request #30971 from Microsoft/dtsSignatureChange
Handle when change in type of dts may result in only dts emit but not js emit
2019-04-24 11:16:22 -07:00
Andrew Branch 6608349ea2
Merge pull request #31008 from andrewbranch/bug/29358
Support binding patterns in Promise -> async/await refactor
2019-04-24 08:43:15 -07:00
Andrew Branch 3e30a7c2ad
Remove all but one server unit test 2019-04-23 16:45:08 -07:00
Ryan Cavanaugh 885d4d63c8
Remove "generate types" code (#31075) 2019-04-23 13:51:47 -07:00
Andrew Branch f0a3d2bf92
Filter out zero-width selections 2019-04-19 09:44:42 -07:00
Andrew Branch 95fb694eed
Consistify tabs/spaces in test and baselines 2019-04-19 08:58:29 -07:00
Peter Šándor 00279e9eca
Parse unexpected comments after email in author JSDoc tag (#17244) 2019-04-19 11:17:09 +02:00
Peter Šándor ea9d519424
Support email in author JSDoc tag
- fixes #17244
2019-04-19 11:15:39 +02:00
Andrew Branch 12492a369e
Rename test to match 2019-04-18 16:28:12 -07:00
Andrew Branch d8936fd290
Rename to be smarter 2019-04-18 16:23:06 -07:00
Andrew Branch 5479893f00
Skip lone variable declarations 2019-04-18 16:05:08 -07:00
Andrew Branch fed910fd0c
Add stop for JSDoc comments 2019-04-18 16:05:08 -07:00
Andrew Branch d73eabd35a
Special rules for binding elements, extend brace/whitespace logic to other kinds of bookended lists 2019-04-18 16:05:08 -07:00
Andrew Branch 74fc84ff84
Snap to nodes directly behind the cursor, create special rules for ParameterNodes 2019-04-18 16:05:07 -07:00
Andrew Branch 4ecdc82736
Solidify fake tree approach 2019-04-18 16:05:07 -07:00
Andrew Branch fcb7f0152f
Rethink sibling expansion by creating fake subtrees 2019-04-18 16:05:07 -07:00
Andrew Branch 70e2672ab3
Add rules for expanding selection to sibling nodes 2019-04-18 16:05:07 -07:00
Andrew Branch 61425cb304
Move most logic to separate file 2019-04-18 16:05:06 -07:00
Andrew Branch 0a4ef0f630
Distinguish between same-line and different-line braces 2019-04-18 16:05:06 -07:00
Andrew Branch 039487c84e
Also skip TemplateHeads 2019-04-18 16:05:06 -07:00
Andrew Branch fd88e52252
Start imports 2019-04-18 16:05:06 -07:00
Andrew Branch e62c2333eb
Add support for string literals 2019-04-18 16:05:06 -07:00
Andrew Branch f98c00ab9d
Add more tests, special handling for mapped types 2019-04-18 16:05:05 -07:00
Andrew Branch af3d0f0248
Start smart select API 2019-04-18 16:05:05 -07:00
Andrew Branch 680d18207c
Add tests for destructuring from variable with inferrable type 2019-04-18 12:01:11 -07:00
Andrew Branch e7fb18e395
Handle case where you have to add a destructuring after a try/catch block 2019-04-18 11:36:47 -07:00
Andrew Branch ef18453166
Add tests for binding elements that need to be renamed 2019-04-17 18:43:01 -07:00
Andrew Branch 4c73b2e7bd
Basic support for binding patterns in async/await code fix 2019-04-17 18:43:00 -07:00
Sheetal Nandi d5100bb95e Merge branch 'master' into dtsSignatureChange 2019-04-17 16:36:09 -07:00
Sheetal Nandi 4a55025f20 Code review feedback 2019-04-17 16:32:33 -07:00
Sheetal Nandi b337565747 Merge branch 'master' into tsbuildTestPerf 2019-04-17 16:05:00 -07:00
Sheetal Nandi 0c18d032e7 Merge branch 'master' into incrementalLateSymbol 2019-04-17 15:41:53 -07:00
Sheetal Nandi dc7d77f2c7 Make the tsbuild tests use simple libFile instead of bigger lib file set 2019-04-17 15:35:00 -07:00
Sheetal Nandi 15ae8a7273 Make sure to emit again if change in compiler option affects emit
Fixes #30736
2019-04-16 16:18:37 -07:00
Sheetal Nandi 707cb93891 Write test case that baselines the incremental build result
Testcase for #30780
2019-04-16 12:50:37 -07:00
Sheetal Nandi 9f5090cec7 Test case for #30891 2019-04-16 12:33:21 -07:00
Sheetal Nandi 8684c3bfb8
Merge pull request #30740 from Microsoft/moduleAndAmbientResolutionConflict
When old program resolved to module and that file is included, dont consider as ambient resolution.
2019-04-05 12:15:06 -07:00
Nathan Shively-Sanders 9e2446073d
Merge pull request #30773 from Microsoft/update-user-tests
Update TypeScript-React-Native-Starter
2019-04-05 11:18:27 -07:00
Nathan Shively-Sanders 762a557fcc Update TypeScript-React-Native-Starter
Add a 'path' field to test.json.
2019-04-04 11:37:15 -07:00
Sheetal Nandi 7ccd86bf52 When old program resolved to module and that file is included, dont consider as ambient resolution.
Fixes #30422
2019-04-03 14:05:49 -07:00
Andrew Branch 9475bf7d9e
Fall back from globalReadonlyArrayType to globalArrayType when transpiling 2019-04-03 11:27:53 -07:00
Sheetal Nandi 5869662c3f
Merge pull request #30721 from Microsoft/amdOut
Do not create multiple sourceFile to single outputFile with project redirect as the output file is included by default
2019-04-03 10:39:28 -07:00
Benjamin Lichtman 78b0956474
VS IntelliCode-related changes (#30731)
* ensure configurePlugin gives a response

* Update tests

* Update baseline

* Enable global plugin loading for external projects

* Fix lint errors
2019-04-03 10:36:04 -07:00
Sheetal Nandi 602aec2f7d Never create redirect for sourceFiles that get emitted to single output file
Fixes #30591
2019-04-02 14:55:48 -07:00
Sheetal Nandi b559e813f4 Add test when module resolution resolves to original file of referenced project with --out
Test for #30591
2019-04-02 14:23:28 -07:00
Sheetal Nandi 3fdd66bddf Report program's source files even when there are errors when building using --build mode 2019-04-02 13:22:22 -07:00
Sheetal Nandi cf8b308511 Add test for out file concat where command line --incremental flag changes between compilation 2019-03-29 14:42:02 -07:00
Sheetal Nandi a4091ae8e3 Merge branch 'master' into incrementalFromCommandLine 2019-03-26 14:57:18 -07:00
Sheetal Nandi 7457e5d9fe Pull out the incremental compilation into a function so we can test it 2019-03-26 14:28:05 -07:00
Sheetal Nandi 021444a248 Make it as api so we can test it 2019-03-26 14:25:56 -07:00
Sheetal Nandi 35470b3f3b Make tsbuildInfoFile as commandline option to tsc (and not tsc -b) 2019-03-25 14:47:36 -07:00
Sheetal Nandi 8da384d32a Report output file not built error for any module resolution that ends up to source file
Fixes #29918
2019-03-21 08:55:12 -07:00
Sheetal Nandi 34c3233d18 Allow --incremental to be command line option 2019-03-20 14:48:47 -07:00
Sheetal Nandi 09747e5c35 Add test for current --incremental behaviour 2019-03-20 13:59:12 -07:00
Sheetal Nandi e94b7d8b37 Check extended tsconfig time with oldest output time to report not upto date 2019-03-19 17:19:15 -07:00
Sheetal Nandi 8cef0c592a Merge branch 'master' into tsconfigChangeDetection 2019-03-19 16:54:25 -07:00
Sheetal Nandi 52641c531a Passing --force option to build, builds project from start 2019-03-15 16:04:10 -07:00
Sheetal Nandi cabf72b514 Revert "Passing --force option to build, builds project from start"
This reverts commit 434fa94bdc.
2019-03-15 16:03:36 -07:00
Sheetal Nandi 434fa94bdc Passing --force option to build, builds project from start 2019-03-15 16:02:00 -07:00
Sheetal Nandi ce490e1c77 Check oldest output time with tsconfig time to see if its out of date
Fixes #26503
2019-03-15 15:45:51 -07:00
Sheetal Nandi e78f52d246 Add more information when getValidSourceFile cant find the file in question.
Log for #30180
2019-03-15 15:03:45 -07:00
Sheetal Nandi b7c8e0951d Merge branch 'master' into resolveJsonModule 2019-03-14 15:13:39 -07:00
Sheetal Nandi 34ea77f674 Pass time to the vfs of resolveJsonModule 2019-03-14 14:02:53 -07:00
Sheetal Nandi bd229b5ed1 Exclude Json files from Project reference redirects from files to be emitted list
Fixes #30382
2019-03-14 11:22:26 -07:00
Sheetal Nandi a6f7ec3464 Handle outDir and declrationDir correctly to generate output file names for the tsbuild 2019-03-14 10:00:55 -07:00
Sheetal Nandi e42f37fccd
Merge pull request #30374 from Microsoft/jsonSourceFile
Correct the generation of output file names for tsc --b
2019-03-13 15:00:59 -07:00
Sheetal Nandi b6d520a7a5 Handle recursive symlinks when matching file names
Fixes #28842
2019-03-13 12:30:47 -07:00
Sheetal Nandi 812ff98f61 Correct the generation of output file names for tsc --b
Fixes #30356
2019-03-13 11:23:14 -07:00
Sheetal Nandi b762d6205e
Merge pull request #30344 from Microsoft/uptoDate
Set oldestOutputFileName in uptodate status when updating just timestamps of output
2019-03-13 10:54:59 -07:00
Sheetal Nandi 8800cc2d15
Merge pull request #30288 from Microsoft/nonModuleNonPrepend
Add output declaration files from referenced project into program if module: none
2019-03-13 10:54:35 -07:00
Sheetal Nandi 2477159782 Do not schedule updating bundle if the buildInfo file wont be generated for the project
Fixes #30346
2019-03-12 16:08:01 -07:00
Sheetal Nandi ffeb38456f Set oldestOutputFileName in uptodate status when updating just timestamps of output
Fixes #29875
2019-03-12 13:30:17 -07:00
Sheetal Nandi 927c10ae31 Add output declaration files from referenced project into program if module: none 2019-03-08 17:48:14 -08:00
Sheetal Nandi 0b202b2095 Fix tests after rebase 2019-03-08 16:33:53 -08:00
Sheetal Nandi 6c0b4568a0 Enable incremental program updates through tsbuildinfo in tsc --watch mode 2019-03-08 15:56:09 -08:00
Sheetal Nandi 68e28da141 Build project if existing project was built with different compiler version 2019-03-08 15:14:34 -08:00
Sheetal Nandi ecb2ce429d Add tests that will verify that all rebuilding with new compiler version builds again 2019-03-08 14:19:41 -08:00
Sheetal Nandi 990b199ebd Merge branch 'master' into incrementalBuildInfo 2019-03-08 11:42:19 -08:00
Wesley Wigham a887c6ba40
Remove unused (and sometimes broken) targets and scripts (#30054)
* Remove unused (and sometimes broken) targets and scripts

* Remove browser-specific harness code
2019-03-08 10:34:35 -08:00
Sheetal Nandi ec2ee9ff3a Ignore anything starting with ".git"
Fixes #29782
2019-03-06 15:00:26 -08:00
Sheetal Nandi 79a1f29727 In recursive directory watching ignore folders and files in node_modules starting with "."
Fixes #30004
2019-03-06 14:46:14 -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
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
Sheetal Nandi ac55310c48 Fix prologue emitting in case of modules with --out scenario 2019-03-05 11:48:09 -08:00
Sheetal Nandi b879b435ef Add tests to verify output of --out with modules as output 2019-03-05 11:08:44 -08:00
Sheetal Nandi 21ea0178c5 Refactor the tests 2019-03-01 13:25:16 -08:00
Sheetal Nandi 8e7db4d4b3 Because .tsbuildinfo is flag now, use .tsbuildinfo just like any other output to determine if project needs rebuild 2019-03-01 13:12:19 -08:00
Sheetal Nandi 026c1dd69c Fix the build error 2019-03-01 11:45:47 -08:00
Sheetal Nandi cd195c91c6 Add options tsBuildInfoFile to provide name for the buildinfo file 2019-03-01 10:28:57 -08:00
Sheetal Nandi df9da15abb Incremental false with composite not allowed 2019-03-01 09:39:58 -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
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
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
Gabriela Araujo Britto e3a465ffa3 change startPosition and endPosition to leadingTriviaOption and trailingTriviaOption 2019-02-26 09:43:35 -08:00
Sheetal Nandi 415a5db166 Add test when declarationMap and sourcemap are disabled in the referenced project 2019-02-22 14:07:13 -08:00
Sheetal Nandi 2b10b68d1c Test that shows stripInternal of enum member prints multiple blank lines for the enum members 2019-02-22 13:28:24 -08:00
Sheetal Nandi 23cd45bdef Test when internal and text region dont mix well together 2019-02-22 12:49:45 -08:00
Sheetal Nandi 22804c10ca Allow away to only test baselines excluding all other file read checks that are not going to change per scenario 2019-02-22 12:24:59 -08:00
Sheetal Nandi 494bd92f1b Report error if overwriting buildInfo of another project reference 2019-02-21 19:34:20 -08:00
Sheetal Nandi 89c4c4f684 Update the message to not just mean javascript since we might need to regenerate .d.ts as well 2019-02-21 17:52:15 -08:00
Sheetal Nandi 1e24cd19a8 Allow empty own source files 2019-02-21 17:36:20 -08:00
Sheetal Nandi 29862cecdf Refactoring for outFile tests 2019-02-21 15:18:01 -08:00
Sheetal Nandi e9fb843e56 Add test to verify incremental build is same as if its built clean 2019-02-21 12:46:04 -08:00
Sheetal Nandi 4bef3ac6a1 Because we already have texts for fixing the emits, write them only if changed 2019-02-20 15:45:12 -08:00
Sheetal Nandi 224f3ca975 Enable other stripinternal test cases 2019-02-20 15:01:48 -08:00
Gabriela Araujo Britto 6b53489a4a Merge branch 'master' into convert-to-named-parameters 2019-02-20 13:24:09 -08:00
Sheetal Nandi 0cd7074e1b Handle emit when using prepends and the referencing project has --stripInternal true 2019-02-20 10:41:28 -08:00
Sheetal Nandi a0f3420001 Add sections to the prepend (to be later used for stripInternal) 2019-02-20 10:41:26 -08:00
Sheetal Nandi 53704227d0 Add test for multi level prepend 2019-02-20 10:41:24 -08:00
Sheetal Nandi aa773e0705 Tests for strip internal 2019-02-20 10:41:21 -08:00
Sheetal Nandi a881391dc9 Merge branch 'master' into incrementalBuildInfo 2019-02-20 10:37:44 -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
Gabriela Araujo Britto eef3da5b6b create new ConfigurableStart and ConfigurableEnd options and rename them 2019-02-15 15:38:10 -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
Sheetal Nandi b958f1c8b5 Merge branch 'master' into incrementalBuildInfo 2019-02-14 12:19:10 -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
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 1d77008993 Handle when no .tsbuildinfo is to be generated 2019-02-07 16:27:45 -08:00
Sheetal Nandi 99df3230aa Merge branch 'master' into incrementalBuildInfo 2019-02-07 15:05:58 -08:00
Sheetal Nandi adcb79a111 Emit bundle information into bundle field of buildinfo and only if bundled emit 2019-02-07 14:32:52 -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
Sheetal Nandi 23b5b14565 Fix incremental build changes declaration dir 2019-02-07 12:10:15 -08:00
Sheetal Nandi e3f8c34bc9 Add mechanism to dump and read program to build info 2019-02-07 12:10:15 -08:00
Sheetal Nandi 212cd62f05 Generate buildInfo for non --out and prepend options as well 2019-02-07 12:10:14 -08:00
Sheetal Nandi 9794080ee7 Merge branch 'master' into usePrependToSkipBuild 2019-02-07 12:09:36 -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
Sheetal Nandi ada1c3ffd9 Fix missing comma 2019-02-07 11:11:14 -08:00
Sheetal Nandi ab7d65e01f Merge branch 'master' into usePrependToSkipBuild 2019-02-07 10:39:41 -08:00
Sheetal Nandi 3a28fb0786 Add another test to generate baseline when sample's logic config file changes declaration dir 2019-02-07 10:29:56 -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
Sheetal Nandi ee9d3439a1 Generate baselines for sample 2019-02-06 15:22:55 -08:00
Sheetal Nandi 057163142b Generate baseline of .tsbuildinfo sections 2019-02-06 15:20:48 -08:00
Nathan Shively-Sanders 33af4ea250
assertNever no longer crashes on string input (#29764) 2019-02-06 08:57:24 -08:00
Sheetal Nandi e6b74ef7f1 Factor out baseline generation into tsbuild helper so that sample can generate baselines as well 2019-02-05 15:13:13 -08:00
Sheetal Nandi a0a4e6b0c2 Update test baselines 2019-02-04 15:02:35 -08:00
Sheetal Nandi a64e5ad3f3 Even though .d.ts doesnt change, the map file most likely changes, so emit that 2019-02-04 15:02:06 -08:00
Sheetal Nandi aa5d62a72c Perform only emit on js file if no decl file change 2019-02-04 15:01:54 -08:00
Sheetal Nandi 66dab21565 More refactoring 2019-02-01 10:46:37 -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
Sheetal Nandi 03fa5bd90f Merge branch 'master' into usePrependToSkipBuild 2019-01-31 22:05:51 -08:00
Sheetal Nandi 79b5992247 Verify header updates 2019-01-31 22:01:54 -08:00
Sheetal Nandi 10f01318a3 Dont do base build again for each incremental scenario 2019-01-31 21:24:46 -08:00
Sheetal Nandi b7defb3cac Some more reorg in test 2019-01-31 20:06:52 -08:00
Sheetal Nandi 3cf46f16bf Dont diff with only sources in incremental compilation, diff with the base build 2019-01-31 19:43:30 -08:00
Sheetal Nandi 4205eaf021 Baseline incremental build baselines 2019-01-31 19:30:15 -08:00
Sheetal Nandi db3a4fe25d Separate out the tests for tsbuild into its own folder 2019-01-31 15:36:34 -08:00
Sheetal Nandi 39e37a2c57 Generate .tsbuildInfo if bundle uses references with prepend 2019-01-31 10:24:13 -08:00
Sheetal Nandi bd769406ca If the project only needs prepend output to be changed, prepare to just manipulate output
Step 1: Update the verbose log to reflect it
2019-01-31 10:24:12 -08: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 d1f3aca2d0 Test case when final project isnt composite project 2019-01-30 17:57:44 -08:00
Sheetal Nandi bb76259e7a More logs verification 2019-01-30 14:52:04 -08:00
Sheetal Nandi 315a4dd226 Merge branch 'master' into prependWithBundleInfo 2019-01-30 13:38:28 -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 0d9cf96e74 Make the bundle info into buildInfo 2019-01-30 10:07:29 -08:00
Sheetal Nandi 00873f66c8 Make file generic to be .tsbuildinfo 2019-01-30 09:41:43 -08:00
Sheetal Nandi c8ff9ace0e Merge branch 'master' into prependWithBundleInfo 2019-01-30 09:25:51 -08:00
Sheetal Nandi 717dad9ebf Dont use tsbundleInfo to determine if bundle needs to be rebuilt 2019-01-29 15:29:12 -08:00
Sheetal Nandi 36ae7be415 Create tests when bundleInfo file is not present 2019-01-29 15:13:26 -08:00
Sheetal Nandi d5b5f8d289 Handle --clean with .tsbuildinfo 2019-01-29 13:58:47 -08:00
Sheetal Nandi 0aaa880197 Use bundle info to store info about prologues, emit Helpers, references etc 2019-01-29 10:51:22 -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