Commit graph

130 commits

Author SHA1 Message Date
Wesley Wigham 6936ac24fd
Move executeCommandLine.ts into its own project (#35595)
* Move executeCommandLine.ts into its own project

* Remove incorrect prepend
2019-12-09 16:33:24 -08:00
Wesley Wigham a78342a160
Move most harness globals into namespaces (#35530)
* Move most harness globals into namespaces

* Remove forward declaration from `createMapShim` and move all `Map` declarations into one file

* A small pile of more changes to get the harness transforming
2019-12-06 15:20:49 -08:00
Andrew Casey 8927aaabb5 Rewrite tests 2019-10-17 16:50:22 -07:00
Sheetal Nandi 25db0b0bf0 Merge baselining and tsc logic into one 2019-10-16 11:39:40 -07:00
Eli Barzilay 22c15a2e6e
Merge pull request #34365 from elibarzilay/fix-exit-code-on-bogus-build-file
Fix exit code on bogus build file
2019-10-15 15:09:45 -07:00
Eli Barzilay 730a52bf82 Better format for the exit code test 2019-10-15 15:35:08 -04:00
Sheetal Nandi 827427f35b Add test for --tsbuildinfo not as absolute or relative path 2019-10-14 14:29:14 -07:00
Ron Buckton 01b3d41124
Add external mapShim/debug modules (#33712)
* Add external mapShim/debug modules

* rename test file
2019-10-07 13:31:07 -07:00
Ron Buckton fcd9334f57
Add support for Optional Chaining (#33294)
* Add support for Optional Chaining

* Add grammar error for invalid tagged template, more tests

* Prototype

* PR feedback

* Add errors for invalid assignments and a trailing '?.'

* Add additional signature help test, fix lint warnings

* Fix to insert text for completions

* Add initial control-flow analysis for optional chains

* PR Feedback and more tests

* Update to control flow

* Remove mangled smart quotes in comments

* Fix lint, PR feedback

* Updates to control flow

* Switch to FlowCondition for CFA of optional chains

* Fix ?. insertion for completions on type variables

* Accept API baseline change

* Clean up types

* improve control-flow debug output

* Revert Debug.formatControlFlowGraph helper
2019-09-30 12:33:28 -07:00
Andrew Branch 304fcee09b
Updated: Only auto-import from package.json (#32517)
* Move package.json related utils to utilities

* Add failing test

* Make first test pass

* Don’t filter when there’s no package.json, fix scoped package imports

* Use type acquisition as a heuristic for whether a JS project is using node core

* Make same fix in getCompletionDetails

* Fix re-exporting

* Change JS node core module heuristic to same-file utilization

* Remove unused method

* Remove other unused method

* Remove unused triple-slash ref

* Update comment

* Refactor findAlias to forEachAlias to reduce iterations

* Really fix re-exporting

* Use getModuleSpecifier instead of custom hack

* Fix offering auto imports to paths within node modules

* Rename things and make comments better

* Add another reexport test

* Inline `symbolHasBeenSeen`

* Simplify forEachAlias to findAlias

* Add note that symbols is mutated

* Symbol order doesn’t matter here

* Style nits

* Add test with nested package.jsons

* Fix and add tests for export * re-exports

* Don’t fail when alias isn’t found

* Make some easy optimizations

* Clean up memoization when done

* Remove unnecessary semicolon

* Make getSymbolsFromOtherSourceFileExports pure

* Cache auto imports

* Revert "Cache auto imports"

This reverts commit 8ea4829587.

* Handle merged symbols through cache

* Be safer with symbol declarations, add logging

* Improve cache invalidation for imports and exports

* Check symbol presence first

* Only run cache invalidation logic if there’s something to clear

* Consolidate cache invalidation logic

* Fix reuseProgramStructure test

* Add more logging

* Only clear cache if symbols are different

* Refactor ambient module handling

* Start caching package.json stuff

* Support package.json searching in fourslash

* Move import suggestions cache to Project

* Start making more module specifier work available without having the importing file

* Going to backtrack some from here

* Get rid of dumb cache, fix node core modules stuff

* Start determining changes to a file have invalidated its own auto imports

* Move package.json related utils to utilities

* Add failing test

* Make first test pass

* Don’t filter when there’s no package.json, fix scoped package imports

* Use type acquisition as a heuristic for whether a JS project is using node core

* Make same fix in getCompletionDetails

* Fix re-exporting

* Change JS node core module heuristic to same-file utilization

* Remove unused method

* Remove other unused method

* Remove unused triple-slash ref

* Update comment

* Refactor findAlias to forEachAlias to reduce iterations

* Really fix re-exporting

* Use getModuleSpecifier instead of custom hack

* Fix offering auto imports to paths within node modules

* Rename things and make comments better

* Add another reexport test

* Inline `symbolHasBeenSeen`

* Simplify forEachAlias to findAlias

* Add note that symbols is mutated

* Symbol order doesn’t matter here

* Style nits

* Add test with nested package.jsons

* Fix and add tests for export * re-exports

* Don’t fail when alias isn’t found

* Make some easy optimizations

* Clean up memoization when done

* Remove unnecessary semicolon

* Make getSymbolsFromOtherSourceFileExports pure

* Cache auto imports

* Revert "Cache auto imports"

This reverts commit 8ea4829587.

* Handle merged symbols through cache

* Be safer with symbol declarations, add logging

* Improve cache invalidation for imports and exports

* Check symbol presence first

* Only run cache invalidation logic if there’s something to clear

* Consolidate cache invalidation logic

* Fix reuseProgramStructure test

* Add more logging

* Only clear cache if symbols are different

* Refactor ambient module handling

* Finish(?) sourceFileHasChangedOwnImportSuggestions

* Make package.json info model better

* Fix misplaced paren

* Use file structure cache for package.json detection when possible

* Revert unnecessary changes in moduleSpecifiers

* Revert more unnecessary changes

* Don’t watch package.jsons inside node_modules, fix tests

* Work around declaration emit bug

* Sync submodules?

* Delete unused type

* Add server cache tests

* Fix server fourslash editing

* Fix packageJsonInfo tests

* Add node core modules cache test and fix more fourslash

* Clean up symlink caching

* Improve logging

* Function name doesn’t make any sense anymore

* Move symlinks cache to host

* Fix markFileAsDirty from ScriptInfo

* Mark new Project members internal

* Use Path instead of fileName

* Rename AutoImportSuggestionsCache

* Improve WatchType description

* Remove entries() from packageJsonCache

* Fix path/fileName bug

* Also cache symlinks on Program for benefit of d.ts emit

* Let language service use Program’s symlink cache
2019-09-27 13:38:31 -07:00
Wesley Wigham 61cb06ce40
Allow allowJs and declaration to be used together (#32372)
* Allow allowJs and declaration to be used together

This intorduces a new symbol-based declaration emitter - currently this
is only used for JSON and JavaScript, as the output is likely worse than
what the other declaration emitter is capable of. In addition, it is
still incomplete - it does not yet support serializaing namespaces.

* Add tests for various import/export forms, add notes on export as namespace and fix export * from

* Tests & fixes for computed names

* Add test with current @enum tag behavior

* fix declaration emit for jsdoc @enum tags

* Small adjustments to base class serialization to fix bugs in it

* Guard against type/type parameter confusion when using typeParameterToName a bit

* Integrate feedback from PR

* Fix issue with export= declarations visibility calculation and type declaration emit that impacted all forms of declaration emit

* Only make one merged getCommonJsExportEquals symbol for a symbol

* Support preserving type reference directives in js declarations

* Skip declare mdoifiers for namespace members in ambient contexts

* FAKE ALIASES AND NAMESPACES EVERYWHERE

* Dont do namespace sugar when type members contain keyword names

* Fix json source file export modifier under new output

* Such clean nested aliasing, very wow

* Fix lint

* Add visibility errors, reuse type nodes where possible

* Suppoer having correctly named import types in bundled js declaration emit & adjust binding to allow namespaces with aliases to merge when the aliases look to be type-only

* Better support for module.exports = class expression

* Fix discovered crash bug

* Allow export assigned class expressions to be reachable symbols from external declarations

* Add missing semicolon

* Support @enum tag post-merge

* preserve comments on signatures and declarations where possible

* Basic support for js classy functions

* Add example we should do better with

* Prototype assignments make things a bit wonky, but the example from the PR seems OK

* Make a ton of changes to support the new way js classes are bound

* Remove some old comments, fix import and export default names

* Fix bug in object define handling and add tests for object define property declaration emit

* Fix organization nits from PR comments

* Preserve comments from jsdoc declarations on properties and js declaration type aliases

* Merge export declarations with identical specifiers

* Remove completed TODO comment

* Split lint

* Remove now-unused function

* PR feedback

* Add some project references tests, remove some checks from project refs codepaths that are now invalid

* Update project references tests again

* Merge and update project references tests

* Rename case

* Update test to include declaration output

* Remove yet another project refernces redirect extension check

* Update comment

* Add additional import ref to test

* Add shorthand prop to test

* Fix comment text

* Extract var to temp

* Simplify function and add whitespace

* Update project refs test to use incremental edit entry

* Stylistic refactors in the symbol serializer

* Another round of PR feedback, mostly style, small bugfix with constructors, and test showing bug in export assigned class expression name shadowing

* Use x instead of index
2019-09-26 14:27:16 -07:00
Sheetal Nandi 2b7ab891ad Merge branch 'baselining' into resolution 2019-09-24 14:04:22 -07:00
Sheetal Nandi 585532d1c2 Merge branch 'master' into baselining 2019-09-24 13:26:05 -07:00
Sheetal Nandi d6a3a944d7 Add test that fails to emit declarations correctly 2019-09-20 14:11:10 -07:00
Sheetal Nandi b76277092c Add test to verify tsc like command line input 2019-09-20 14:10:48 -07:00
Sheetal Nandi 54d9ce9247 Merge branch 'master' into referencesPrototypeSourceFile 2019-09-05 13:51:56 -07:00
Sheetal Nandi 79bcb3d547
Handle seenEmittedFiles which was not being set when emit of a file was complete (#33145)
* Add test that fails because file is written multiple times
Reported from #33061

* Handle seenEmittedFiles which was not being set when emit of a file was complete.
It was issue only when errors are reported before emitting (which puts the files into pendingEmit that needs to check only in seenEmittedFiles)
If emit happens before semantic diagnostics query this issue is not repro, because the affected files come into play and those are being set correctly
Fixes #31398

* make baselining source map optional

* Handle emitDeclarationOnly in --build scenario

* Ensure we are using d.ts emit as signature even when --declarationMap is on (map files are emitted before d.ts)

* Move module specifiers to verifyTsBuildOutput

* implement create Hash to be default hashing plus data so we can verify it easily in baseline

* Remove failing baseline

* Accept correct baseline name
2019-08-30 16:33:44 -07:00
Sheetal Nandi 4c4ddf833d Merge branch 'master' into referencesPrototypeSourceFile 2019-08-21 15:42:36 -07:00
Sheetal Nandi d9ad559042 Verify demo build 2019-08-09 13:38:24 -07:00
Ron Buckton d75740280f
Resolve module specifier relative to moduleFile.originalFileName (#32722)
* Resolve module specifier relative to moduleFile.originalFileName

* Use baseline testing for outputs

* Added skipLibCheck to test

* Switch to using vfs.formatPatch for output
2019-08-06 13:48:58 -07:00
Ron Buckton cc3db8f448 Merge branch 'Saulzi-master' 2019-08-06 10:48:47 -07:00
sisisin 33a6509751 Fixes export destructured variables reference (#32007)
* Add basic test for current behavior

* Fixes getting destructured variables references(#31922)

* Add test case that renames destructured property

* Fixes missing nested object destrucuturing variable references
2019-08-05 12:00:06 -07:00
Ron Buckton 5710f7d5ff Merge branch 'master' of https://github.com/Saulzi/TypeScript into Saulzi-master 2019-08-05 11:17:32 -07:00
Sheetal Nandi 2db8a13d81 Remove project status, watches etc when project is no longer part of build order 2019-07-29 15:33:34 -07:00
Sheetal Nandi 1ac980ec96 File move 2019-07-29 15:33:33 -07:00
Sheetal Nandi 666c4be844 Merge branch 'master' into referencesPrototypeSourceFile 2019-07-25 14:03:48 -07:00
Salisbury, Tom 395d1515ee #32458 stop ES5 __values with no Symbol.iterator getting stuck in loop 2019-07-25 12:17:22 +01:00
Ron Buckton d982014d73
Update __awaiter to be more spec compliant (#32462)
* Update __awaiter to be more spec compliant

* Add awaiter evaluation test
2019-07-22 17:23:35 -07:00
Ron Buckton 47e3fedb5d
Fix object spread runtime semantics (#32514) 2019-07-22 16:46:09 -07:00
Sheetal Nandi 824c22c460 Source of project reference behave as if those files cannot be emitted. 2019-07-09 14:52:27 -07:00
Sheetal Nandi 15b68a9396 Skip typechecking of source of project reference redirect 2019-07-03 15:39:29 -07:00
Sheetal Nandi 0e5d95feef Container only ref needs to be ignored from uptodate status
Fixes #31288
2019-06-20 16:09:35 -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
Andrew Branch 12492a369e
Rename test to match 2019-04-18 16:28:12 -07:00
Andrew Branch af3d0f0248
Start smart select API 2019-04-18 16:05:05 -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 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 6c0b4568a0 Enable incremental program updates through tsbuildinfo in tsc --watch mode 2019-03-08 15:56:09 -08:00
Sheetal Nandi 990b199ebd Merge branch 'master' into incrementalBuildInfo 2019-03-08 11:42:19 -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 6fd7011870 Add test that batches all the open files to update program only once 2019-02-26 10:21:01 -08:00
Sheetal Nandi b958f1c8b5 Merge branch 'master' into incrementalBuildInfo 2019-02-14 12:19:10 -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 9794080ee7 Merge branch 'master' into usePrependToSkipBuild 2019-02-07 12:09:36 -08: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 db3a4fe25d Separate out the tests for tsbuild into its own folder 2019-01-31 15:36:34 -08: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
Klaus Meinhardt 2a2b573fa2 Merge branch 'master' of github.com:Microsoft/TypeScript into shebang-comments 2019-01-03 22:44:57 +01:00
Sheetal Nandi c426fc6868 Merge branch 'master' into tscWatchExportUpdate 2019-01-03 11:35:54 -08:00
Klaus Meinhardt 6eb9165553
Merge branch 'master' into shebang-comments 2019-01-03 17:38:25 +01:00
Sheetal Nandi efc71602cd Refactor tsc-watch tests 2018-12-20 14:17:43 -08:00
Sheetal Nandi f117184562 More tsserver tests refactoring 2018-12-20 14:00:45 -08:00
Sheetal Nandi 53e2507f60 More scenarios in their own test 2018-12-20 12:55:18 -08:00
Sheetal Nandi 5c8ef3934d Move the tests into their own folder for easy scenario search 2018-12-20 12:19:18 -08:00
Sheetal Nandi 9e17a66151 Sym links into single test 2018-12-20 12:18:43 -08:00
Sheetal Nandi 160c73f942 Separate out caching file system test 2018-12-20 12:16:47 -08:00
Sheetal Nandi f6ac949596 Separate out LargeFileReferencedEvent test 2018-12-20 12:15:58 -08:00
Sheetal Nandi 04e190abb7 ProjectUpdatedInBackground in a separate unittest 2018-12-20 12:15:43 -08:00
Sheetal Nandi 39ec69e26e Separate out tests for project loading events into their own unittest file 2018-12-20 12:15:25 -08:00
Sheetal Nandi 347f89c851 tsc-watch emit tests in to its own tests 2018-12-20 12:11:36 -08:00
Sheetal Nandi 7b9b0f8da7 Split resolutionCache and watchApi tests into its own unittest 2018-12-20 12:11:07 -08:00
Sheetal Nandi 47200acfcd Split watch environment into its own unittest 2018-12-20 12:10:28 -08:00
Sheetal Nandi 2a02077e37 Add name of test in all describe blocks in it 2018-12-20 12:09:42 -08:00
Klaus Meinhardt b55b6e2f6b fix comment parsing at start of file
* skip shebang if present (fixes: #28477)
* don't parse trailing comments as they are also treated like leading comments
2018-11-12 21:45:36 +01:00
Caleb Sander ece27eb177 Utilities for PseudoBigInt 2018-11-05 11:36:30 -08:00
Wesley Wigham a4a1bed88b
Add showConfig tsc flag for debugging configs (#27353)
* Add showConfig tsc flag for debugging configs

* Merge showConfig implementation with init implementation, add basic unit tests

* Fix lint

* Add missing semicolon

* showConfig when theres no config file
2018-10-31 15:57:09 -07:00
Ron Buckton a255d9a163 Merge branch 'master' into typesVersions 2018-09-07 13:52:12 -07:00
Sam Lanning 65fa0128bb Add test for ts.equalOwnProperties 2018-08-30 14:08:20 -07:00
Ron Buckton 5f6a2cbf69 Merge branch 'master' into typesVersions 2018-08-28 17:37:23 -07:00
Ron Buckton b9afdadf71 Remove jsTypings/semver.ts, add unit tests and logging 2018-08-22 12:38:16 -07:00
Sheetal Nandi 17ee9231b7 Write first test with --build and --watch 2018-08-21 13:41:30 -07:00
Elizabeth Dinella 421730a68d
Refactoring promises returning functions to use async and await (#26373) 2018-08-10 16:11:45 -07:00
Klaus Meinhardt b8d7a2f763 add tests 2018-07-02 17:44:32 +02:00
Ryan Cavanaugh 066b191982 Collapse core/compiler/parser into parser 2018-06-11 17:07:58 -07:00
Ryan Cavanaugh ab10b86205 Almost working? 2018-06-10 19:28:38 -07:00
Ryan Cavanaugh 3b4b7dc125 Fix unittests config 2018-06-10 15:10:10 -07:00
Ryan Cavanaugh 336c37662d Projzilla phase 1 2018-06-09 16:48:08 -07:00