Commit graph

1191 commits

Author SHA1 Message Date
Andrew Branch 86556d6c03
Fix export * that resolves to something type-only (#36558)
* Fix `export *` that resolves to something type-only

* Add same tests but non-tsserver
2020-01-31 15:09:27 -08:00
Sheetal Nandi 80ad0de87e
Fixes to handle file names in module resolution watching and createGetCanonicalFileName (#36106)
* Add test case to verify directory casing preservation when watching

* Fix unicode file name handling when watching failed lookup locations

* Add special file name lower conversion routine and use that instead of toLowerCase
Fixes #31819 and #35559

* Remove unicode from code

* Replace toLocaleLowerCase on filenames with ts.toFileNameLowerCase

* Make the intent of using toFileNameLowerCase more clear and why we make the restriction on turkish I with dot on top of it

* Update baselines for newly added tests in master
2020-01-31 10:40:57 -08:00
Ron Buckton f24f36350b
Fixes JSX attribute escaping when parent pointers are missing (#35743)
* Fixes JSX attribute escaping when parent pointers are missing

* Fix whitespace change
2020-01-30 16:52:31 -08:00
Hye Sung Jung 8ed129771f
fix spelling errors (#36523)
* fix spelling errors

* remove changes in lib/*
2020-01-30 13:39:54 -08:00
Sheetal Nandi 4c378c09dc
Report config file parsing diagnostics correctly with tsc --b (#36520)
* Refactor the test

* Add tests for syntax errors in tsconfig not being reported

* Report config file parsing diagnostics correctly
Fixes #36515

* Fix errors in existing tests for unintended tsconfig parse errors

* Fix lint
2020-01-30 11:18:06 -08:00
Andrew Branch 2fac535158
Fix type-only imports in interface 'extends' and import=/export= (#36496)
* Handle when files get checked in different orders

* Fix interface extends clause

* Fix import= something type only from a module

* Revert apparently unnecessary addition

* Revert "Revert apparently unnecessary addition"

This reverts commit 7444b0b72e.

* Disallow `import = a.b.c` on anything with type-only imports

* Safety first

* Add test for TS Server single-file open

* Add big comment

* Extract error reporting function for import aliases

* Delete blank line

* Un-export, comment, and colocate some utils

* Combine 3 type-only marking function calls into one

* Add more export default tests
2020-01-29 15:00:17 -08:00
Sheetal Nandi 502e711235
Dont use sourcemap if it contains inlined sources (#36384)
Fixes #35014
2020-01-29 11:21:42 -08:00
Nathan Shively-Sanders c42ef575be
createPrivateIdentifier: names must start with # (#36506) 2020-01-29 10:11:30 -08:00
Alexander T 39311da27b
fix(36385): return failed exit code if tsconfig doesn't exist and there are no input files. (#36474) 2020-01-28 16:11:19 -08:00
Ben Lichtman fdf29891e2
Merge pull request #36383 from uniqueiniquity/redirectInfo
Redirect info
2020-01-28 11:51:06 -08:00
Ben Lichtman 2dd89ca57b Use deepEqual in tests for clarity 2020-01-28 11:30:23 -08:00
Wesley Wigham 08e6bc20bb
Trampolines for large binary expressions (#36248)
* WIP

* Test no longer crashes, but emit trampoline is incomplete and skips pipeline phases

* Fix lints, use non-generator trampoline in emit (still skips pipeline)

* Final version with emitBinaryExprssion work stack that is only used if possible

* Fix lints

* retarget to es2015 for testing

* Use bespoke state machine trampolines in binder and checker

* Remove now extraneous code in parser

* Adjust fixupParentReferences to use a depth first preorder traversal rather than breadth first

* Reintroduce incremental fast bail in fixupParentReferences

* Revert target to es5

* PR feedback

* Small edit for devops rebuild with updated definition

* Fix comment nits, add internally extraneous check back into transformer
2020-01-24 16:29:55 -08:00
Sheetal Nandi 096e1b12e4
Handle error reporting of files when new file is created after its opened in editor (#36271)
* If script info is not attached to the project on which wild card is invoked, update it.

* Instead of getting default project before starting error list timer, get it at that time if no project is specified
Fixes #35794

* Fix the open File watch triggered setting
2020-01-24 16:07:48 -08:00
Ben Lichtman 8c18c7683a Add tests 2020-01-24 16:02:14 -08:00
Wesley Wigham 6b64c883f1
Fix crash on missing parent pointer in binder when transpiling export as ns (#36387) 2020-01-24 13:36:05 -08:00
Ben Lichtman 703685318c Merge branch 'master' into redirectInfo 2020-01-23 14:12:01 -08:00
Ben Lichtman 09528dd6d6 Add tests 2020-01-23 14:10:37 -08:00
Klaus Meinhardt 0276e7f910 noErrorTruncation affects semantic diagnostics (#36306) 2020-01-23 11:10:05 -08:00
Klaus Meinhardt 342f4c0b54 forceConsistentCasingInFileNames affects module resolution (#36334) 2020-01-21 12:45:13 -08:00
Klaus Meinhardt 1fbe20fe75 resolveJsonModule affectsModuleResolution (#36290)
* resolveJsonModule affectsModuleResolutionFixes: #36251

* fix lint
2020-01-21 11:49:38 -08:00
Klaus Meinhardt bc1e7728df experimentalDecorators and emitDecoratorMetadata affect builder state (#36297)
* experimentalDecorators and emitDecoratorMetadata affect builder state

* better test
2020-01-21 11:28:55 -08:00
Klaus Meinhardt 2dd21a08f5 useDefineForClassFields affects emit (#36308)
* useDefineForClassFields affects emit

* fix lint
2020-01-21 11:28:04 -08:00
Yacine Hmito 4445e1147c Fix isProgramUpToDate when changing rootFileNames (#36011) 2020-01-21 11:26:17 -08:00
Sheetal Nandi b2a7d42032
Handle untitled files from vscode which are of format: untitled:^Untitled-1 (#36240)
* Test for #36200

* Handle dynamic files by vscode
Fixes #36200
2020-01-16 15:38:55 -08:00
Andrew Branch 797c5362a2
Codefix: Don’t return a fixId if there’s definitely nothing else that can be fixed (#35765)
* Start fixing fixId

* Fix tests

* Add comment

* Fix unit tests, remove fixAllDescription when unavailable

* Add codeFixAllAvailable to fourslash harness
2020-01-16 10:07:37 -08:00
Andrew Casey f99072593d
Move individual duration properties into a performanceData object (#36210) 2020-01-15 16:48:00 -08:00
Klaus Meinhardt f220e62ce7 importsNotUsedAsValue affects semantic diagnostics (#36001)
* importsNotUsedAsValue affects semantic diagnostics

* add tests
2020-01-15 15:08:16 -08:00
Sheetal Nandi 76ee0214f9
Use watch invoked with node_modules/.staging as watch for refreshing complete node_modules, so that npm install is reflected correctly (#36039)
* Add test that demonstrates npm install watch behaviour some times

* Use watch invoked with `node_modules/.staging` as watch for refreshing complete node_modules, so that npm install is reflected correctly
Fixes #35966
2020-01-10 14:58:01 -08:00
Sheetal Nandi 00b21efcb0
Remove the check that if base file name starts with ^ is dynamic file name since those files can exist (#36109)
Fixes #35734
2020-01-10 10:57:44 -08:00
Andrew Casey 071819bb37
Report time spent in updateGraph (#35675)
Add a response property indicating how much of the elapsed time (from
`onMessage` to `doOutput`) was spent in `updateGraph` calls.  If there's
no `updateGraph` call, the property is undefined, to save space (with
the downside that it's harder to tell whether a given telemetry event
could have had the property).

Fixes #34774
2020-01-08 14:41:34 -08:00
Sheetal Nandi 5cc58deb57 Shorten test baseline names (#35993) 2020-01-03 16:37:04 -08:00
Andrew Branch 3b396e6124 Type-only imports and exports (#35200)
* Add type-only support for export declarations

* Use a synthetic type alias instead of binding type-only exports as a type alias

* Works for re-exports!

* isolatedModules works fine

* Diagnostic for type-only exporting a value

* Start isolated modules codefix

* Update for LKG control flow changes

* Type-only import clause parsing

* Type-only default import checking

* Type-only named imports

* Fix isolated modules error

* Filter namespaces down to type-only

* Fix class references

* Test nested namespaces

* Test circular type-only imports/exports

* Fix getTypeAtLocation for type-only import/export specifiers

* Fix type-only generic imports

* Update public APIs

* Remove unused WIP comment

* Type-only namespace imports

* Fix factory update calls

* Add grammar errors for JS usage and mixing default and named bindings

* Update updateExportDeclaration API baseline

* Fix grammar checking import clauses

* Enums, sort of

* Dedicated error for type-only enum

* Skip past type-only alias symbols in quick info

* Update error code in baseline

* WIP: convertToTypeOnlyExport

* isolatedModules codefix (single export declaration)

* isolatedModules code fix (all)

* Stop eliding non-type-only imports by default, add compiler flag

* Update to match updated diagnostic messages

* Update more baselines

* Update more tests

* Auto-import as type-only

* Add codefix for splitting type-only import with default and named bindings

* Add more services tests

* Add targeted error message for "export type T;" when T exists

* Add targeted error for "import type T = require(...)"

* Flip emit flag

* Add test for preserveUnusedImports option

* Fix flag flip on import =

* Make compiler option string-valued

* Fix merge conflicts

* Add --importsNotUsedAsValue=error

* Phrasing of messages.

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-01-03 14:39:32 -08:00
Sheetal Nandi 18269c0fc8
Add assumeChangesOnlyAffectDirectDependencies as a option to skip checking and generating .d.ts files for files indirectly importing affected file (#35711)
* Baselining tsc --watch output

* Add noIndirectImports as a option to skip checking and generating .d.ts files for files indirectly importing affected file
Fixes #33329

* Rename option to assumeChangesOnlyAffectDirectDependencies

* Description change as per feedback
2020-01-03 13:02:45 -08:00
ExE Boss 5a342742d0 feat(lib/es2020): Add Promise.allSettled(…) (#34065)
* feat(lib/es2020): Add `Promise.allSettled(…)`

* test(lib): Update tests to account for `es2020.promise`

* fix(lib/es2020): `Promise.allSettled(…)` takes `Iterable` argument

* refactor(lib/es2020): Rename `Promise.allSettled(…)` return type

* feat(lib/es2020): Simplify `Promise.allSettled(…)` type declaration

* refactor(lib/es2020): Improve naming of `Promise.allSettled(…)` types
2020-01-03 12:58:02 -08:00
Kagami Sascha Rosylight 05a2f1b110 Support bigints in ES2020 (#33874) 2019-12-23 12:18:52 -08:00
Alexander T a4e794d872 fix file extension (#35825) 2019-12-23 11:39:50 -08:00
Ron Buckton 6c413e0bbb
Add support for Call Hierarchies in language server (#35176)
* Add support for Call Hierarchies in language server

* Use baselines for callHierarchy tests

* Clean up commented code

* Support multiple hierarchy items when an implementation can't be found

* Use optional chaining in a few places

* Use getFileAndProject
2019-12-22 13:25:09 -08:00
Kagami Sascha Rosylight deb5288e31 Add module: es2020 (#33893) 2019-12-20 16:29:49 -08:00
Sheetal Nandi 9445657184
Correctly set filesByName map when reusing program to ensure it is same as old (#35784)
It was previously not populated correctly if preserveSymlinks with useSourceOfProjectReference was true,
in that case if module was resolved to symlink and we deduced it refers to source of project reference we want to set "resolvedFileName" correctly
otherwise it results in incorrect module not found errors.
2019-12-20 07:44:35 -08:00
Sheetal Nandi ec84392f2e
Use resolvedPath consistently in the builder (#35757)
* Add baseline for #35468

* Use resolvedPath consistently in the builder
Fixes #35468
2019-12-19 10:10:17 -08:00
Sheetal Nandi 853507642a
Do not list output files that just change their modified time when using --listEmittedFiles (#35714)
* Baseline incremental scenarios for listEmittedFiles

* Do not list output file that just changes modified time stamp as emitted file
Fixes #35605
2019-12-18 10:24:59 -08:00
Sheetal Nandi 8c1900c74b
Baselining tsc --watch output just like tsc baselines for easier updates (#35710)
* Baselining tsc --watch output

* Fix lint errors
2019-12-18 10:23:58 -08:00
Sheetal Nandi f90cde4706
Fix completions when the ts installation and project are on two different windows drive (#35733)
* Fix completions when the ts installation and project are on two different windows drive
Fixes #35512

* Fix typo
2019-12-17 14:19:52 -08:00
Sheetal Nandi c3b2aea9f9
Do not write files directly from builder when noEmitOnError is true (#34832)
* Add tests for noEmitOnError

* Do not write files directly from builder when noEmitOnError is true
Fixes #34823

* make linter happy

* Instead of generating output in memory, check errors before doing the emit in case of noEmitOnError
2019-12-12 19:51:18 -08:00
Wesley Wigham fc0f67dcfd
Dedent external runner message text 2019-12-11 14:28:59 -08:00
Sheetal Nandi 236012e47b
Add watchOptions to tsconfig and allow supplying them on command line as well (#35615)
* Create different watch options in compiler options

* Thread through the new watch options

* Actually use the options passed through for watch strategy

* Support delay on updating child directory watches

* Make watchOptions separate from compilerOptions

* Support passing watch options from command line

* Handle displaying of watchOptions
2019-12-11 13:26:44 -08:00
Sheetal Nandi 4212484ae1
Open bigger set of configured projects when opening composite project for operations that operate over multiple projects like rename (#33287)
* Add isInferredProject, isConfiguredProject and isExternalProject

* Skip refreshing configured project on change of config file if its not loaded

* Open a tree of projects when doing findAllRefs or rename operations

* Fix addToSeen project key

* Refactor combineProjectsOutputWorker

* if the definition is local, no need to load and look in other projects

* Add disableSearchSolution as option to disable looking for solution

* Rename the option to disableSolutionSearching
2019-12-11 12:28:18 -08:00
Sheetal Nandi 07364595e4
Handle consistent file name during editor and tsc --watch scenarios (#34622)
* Add isInferredProject, isConfiguredProject and isExternalProject

* Add test for rename on file with case change that fails
Test for #25460

* Dont store fileName on text storage

* Store root file names in the root file map to reflect their name

* Delay open file triggering watches

* Correct the name of source file as we query it (eg. it could be same source file returned in old program with different casing on case insensitive file name)

* More tests

* Refactoring

* Cache bind And check diagnostics and always get program diagnostics from the program

* Another test

* Try to report conflicting file error on file instead of global diagnostics

* Create better tests for module resolution diagnostics check

* Fix lint errors
2019-12-10 18:25:10 -08:00
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
Wesley Wigham c84afa1b9e
Fix build from incomplete merge 2019-11-27 14:08:16 -08:00
Sheetal Nandi d02531f650
Fix compileOnSaveEmit when using source of project reference redirect with --out (#35335)
* Fix compileOnSaveEmit when using source of project reference redirect with --out
Fixes #35226

* Fix typo
2019-11-27 13:47:19 -08:00
Wesley Wigham c447ebc59c
Refactor: No more than 1 namespace declaration per file (#35373)
* Refactor: No more than 1 namespace declaration per file

* Simplify refs where possible
2019-11-27 13:44:31 -08:00
Sheetal Nandi 25ec62f892
Handle when output file would be in subFolder specified by outDir/declarationDir (#35366)
Fixes #35328
2019-11-27 09:36:52 -08:00
Wesley Wigham 3e329469c1
Actually use the moer complete update function in visitEachChild (#35301) 2019-11-22 14:36:22 -08:00
Wesley Wigham 614a07c7d5
Fix printing and emit for definite assignment assertions (#35095)
* Fix printing and emit for definite assignment assertions

* Make factories that handle definite assertions internal
2019-11-21 11:20:57 -08:00
Nathan Shively-Sanders 0bbeab6e61
Revert "Skip costly tests" (#35197)
* Revert "Skip costly tests"

* fix package.json format
2019-11-19 12:59:09 -08:00
Ron Buckton 6c59dc34ac
More tests for super.method call chain, improve vary-by (#35013) 2019-11-18 18:03:37 -08:00
Sheetal Nandi aa0cb889da
Support dynamic file names with project root path (#35111)
* Support dynamic file names with project root path
Fixes #35094

* Remove unexpected change
2019-11-14 15:37:00 -08:00
Orta ef0cca7d12
Adds 'did you mean' to the CLI args parser (#35063)
* Adds did you mean to the CLI args parser

* Adds test coverage for the did you mean on CLI args

* Adds did you mean to convertOptionsFromJson

* Ensure tsconfig compiler flags also get 'did you mean?'
2019-11-13 20:16:48 -05:00
Wesley Wigham 165b4bc100
More version sanitization 2019-11-07 17:14:16 -08:00
Wesley Wigham db43be130d
Fix missing semicolon 2019-11-07 14:53:12 -08:00
Wesley Wigham 07d80edb3f
Strip more timestamps and versions from docker logs to better handle the more verbose logging from office-ui-fabric 2019-11-07 14:11:33 -08:00
Sheetal Nandi 47ec514cf4
Use empty object for invalid package json contents instead of undefined (#34906)
* Use empty object for invalid package json contents instead of undefined
Fixes #34726

* Behave as if package json doesnt exist in case of invalid json in package json
2019-11-04 14:31:45 -08:00
Sheetal Nandi dbef230eb8
This handles when packages are symbol links in mono repo like scenarios to use source files instead of output d.ts from project reference (#34743)
* Fix incorrect outDir usage instead of out

* Handle symlinks of packages in mono repo like packages
Fixes #34723

* Added clarified comment
2019-10-29 10:49:14 -07:00
Martin Probst ff590b622e Fix a crash when transforming functions in modules. (#34513)
When transforming a module declaration and block, parse tree nodes
contained in the module block have their parent pointers reset due to
`shouldEmitModuleDeclaration` calling into `isInstantiatedModule`, which
needs to set parent pointers to operate.

That causes a crash when later transforming any nodes within the module,
as retrieving their source file in `getSourceFileOfNode` (via
`getOrCreateEmitNode`) fails, due to their new synthesized parent nodes
not being in a source file.

This change avoids the issue by using the parse tree node in `ts.ts` to
decide whether a module declaration should be emitted (i.e. whether the
module contains values).

This means transformers cannot add values to modules that previously did
not contain any.

Fixes #34644.
2019-10-29 08:40:49 -07:00
Sheetal Nandi f12eee2e4b
Include *.json in the root files if they are specified as root (#34676)
Fixes #33827
2019-10-25 13:48:38 -07:00
Sangmin Lee a01c8ef764 Fix typo in watchMode.ts (#34701) 2019-10-25 13:13:00 -07:00
Gorka Hernández Estomba 8e1d228a44 Update inconsistent use of the word multiline/multi-line in test cases (#34733)
The word multi-line and multiline are used interchangeably within the file. Multiline seems to be the most used spelling of the word across the TypeScript repository codebase so a few strings have been updated to keep consistency within a single file. Additionally, corrected a minor capitalization mistake.
2019-10-25 11:28:50 -07:00
Andrew Casey 7275e9ca93 Delete redundant test 2019-10-17 17:22:47 -07:00
Andrew Casey 8927aaabb5 Rewrite tests 2019-10-17 16:50:22 -07:00
Andrew Casey caf0041f8a Add listFilesOnly command-line option
Msbuild currently uses a combination of `--listFiles` and `--noEmit` to
obtain a list of files to be consumed by tsc.  However, these two flags
don't suppress type checking, the results of which msbuild will never
consume.  This new switch gives msbuild a faster way to obtain the file
list.

Note: like `--noEmit`, doesn't make sense in build mode.
2019-10-17 16:36:50 -07:00
Sheetal Nandi fde10a2494 Merge branch 'master' into rootDir 2019-10-17 12:54:26 -07:00
Sheetal Nandi 575339c2e1 Merge branch 'master' into testChanges 2019-10-17 12:26:16 -07:00
Sheetal Nandi 4055689579
Merge pull request #34487 from microsoft/skipTsBuildinfoEmit
Do not write build info if there are no files to emit
2019-10-17 12:22:25 -07:00
Sheetal Nandi 4530d3ed80 Fixed scenario names 2019-10-17 12:04:24 -07:00
Sheetal Nandi 6caa92800f Fix scenario name 2019-10-17 12:00:41 -07:00
Sheetal Nandi 5b5f88ead0 Add test with incremental program with only d.ts files 2019-10-17 11:52:22 -07:00
Sheetal Nandi f32c2eac65 Some changes to incremental tests 2019-10-17 11:46:54 -07:00
Sheetal Nandi 1531c9ec21 Fix lint rules 2019-10-16 15:42:53 -07:00
Sheetal Nandi a4044ca684 Add test for #34502 2019-10-16 14:32:18 -07:00
Sheetal Nandi 66ea16a23a Sample to baseline output 2019-10-16 14:05:07 -07:00
Sheetal Nandi e54d5cae60 outFile to baseline 2019-10-16 12:51:41 -07:00
Sheetal Nandi 5390c644c9 rootDir tests are baselined 2019-10-16 12:19:26 -07:00
Sheetal Nandi 928a4e799c resolveJsonModule as baseline test 2019-10-16 12:12:12 -07:00
Sheetal Nandi 4b13406baf transitiveReferences as baseline 2019-10-16 11:52:46 -07:00
Sheetal Nandi 25db0b0bf0 Merge baselining and tsc logic into one 2019-10-16 11:39:40 -07:00
Sheetal Nandi e3cc4f4730 missingExtendedConfig to baseline test 2019-10-16 11:39:04 -07:00
Sheetal Nandi 7c0cc4a3b9 empty files to baseline test 2019-10-16 11:37:43 -07:00
Sheetal Nandi c2eabddf5c Write ExitStatus as enumng-rootDir-is-in-the-tsconfig.js 2019-10-16 11:37:35 -07:00
Sheetal Nandi 348735a755 Demo as baseline test instead 2019-10-16 09:10:33 -07:00
Sheetal Nandi c8e6f1c2eb Convert some more tests into baselines 2019-10-16 09:10:30 -07:00
Sheetal Nandi 333436b9a8 Some changes to incremental tests 2019-10-16 09:10:22 -07:00
Sheetal Nandi aaadb17afe
Merge pull request #34495 from microsoft/forceDts
Add forceDtsEmit flag to getEmitOutput
2019-10-16 08:14:47 -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
Eli Barzilay cd34808a14 Fixes missing error exit code when a bogus input file is specified
Fixes #33849.
2019-10-15 15:35:07 -04:00
Eli Barzilay f25575e5fe Typofix: ..._OutputsSkupped -> ..._OutputsSkipped 2019-10-15 15:13:11 -04:00
Sheetal Nandi 850d16e45f Add forceDtsEmit flag to getEmitOutput
Fixes #33936
2019-10-15 10:07:19 -07:00
Sheetal Nandi 758bd99879 Add test for #30457 2019-10-14 15:05:56 -07:00
Sheetal Nandi 4b10145340 Make sure commandline options are absolute paths so they dont conflict with tsbuildinfo paths
Fixes #33667
2019-10-14 14:44:47 -07:00
Sheetal Nandi 827427f35b Add test for --tsbuildinfo not as absolute or relative path 2019-10-14 14:29:14 -07:00
Sheetal Nandi 35a6426a79
Merge pull request #33647 from microsoft/defaultProject
Use correct default project for file if that project is opened at later time
2019-10-10 16:01:39 -07:00
Sheetal Nandi 144b81c67a Use correct default project for file if that project is opened at later time
Fixes #31926
2019-10-10 13:02:33 -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
Alexander T a3da2e77f9 update eslint. fix eslint @typescript-eslint/no-unnecessary-type-assertion errors 2019-10-04 11:00:24 +03:00
Ron Buckton 526ed5284e
Ensure prepend texts are set when skipping internals (#33694) 2019-10-01 12:33:17 -07:00
Ryan Cavanaugh 6b63c1bc5c
Rename this function so it stops shadowing a local we use elsewhere (#33692) 2019-10-01 10:37:53 -07:00
Sheetal Nandi 2d96a163d1
Merge pull request #33681 from microsoft/autoTypeReference
Fix issue when types installed after watch/editor is opened for auto type reference that is for global types not being detected
2019-10-01 08:28:08 -07:00
Wenlu Wang 7c50bccec2 nullish coalescing commit (#32883)
* migrate nullish coalescing commit

* add more test case

* add branch type check test

* add more tests

* fix nullish precedence

* update public api

* add rescan question question token to fix regression

* update public api baseline

* Added tests that emit for nullish coalescing operator conforming with grammar restrictions when assertions are used.

* Fixed emit to hoist temporary variables (they previously went undeclared).
Added tests to ensure calls and property accesses are only called once.

* use not equal to null

* rename factory

* add grammar check

* fix more cases

* Fix handling of nullish coalescing oprator in expando objects.

* Fixed classifier to support ?? operator.

* update baseline

* accept baseline

* fix review

* update emitter and more testcase

* update control flow

* make linter happy

* update libs

* avoid unnecessary assert

* fix typooo

* Fixes for control-flow analysis
2019-09-30 15:33:50 -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
Sheetal Nandi 1a614a27d1 Fix issue when types installed after watch/editor is opened for auto type reference that is for global types not being detected
Fixes #32285
2019-09-30 09:58:33 -07:00
Sheetal Nandi b0ea83b719 Add test when file is part of non default configured project before the default one 2019-09-27 14:36:54 -07:00
Sheetal Nandi c1751dc168 More refactor 2019-09-27 14:36:54 -07:00
Sheetal Nandi f3a6ea6abe Refactor 2019-09-27 14:36:54 -07:00
Sheetal Nandi 49a52d02d3
Merge pull request #33636 from microsoft/rootReferenceRedirect
Fix the issue when file is attached to project because its a root file name but program contains instead its d.ts
2019-09-27 14:36:08 -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
Sheetal Nandi 1c24e27ce4 Add the test that fails with find all references 2019-09-27 09:00:29 -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
Nathan Shively-Sanders 500a0df6f3
Add useDefineForClassFields flag for Set -> Define property declaration (#33509)
* Disallow property/accessor overrides

Unless the base property or accessor is abstract

* Disallow uninitialised property overrides

This causes quite a few test breaks. We'll probably want to revert many
of them by switching to the upcoming `declare x: number` syntax.

* Updates from design review + fix ancient bug

1. Don't error when overriding properties from interfaces.
2. Fix error when overriding methods with other things. This had no
tests so I assume that the code was always dead and never worked.

* Need to add a couple of errors and squash one

Will update after checking out other branch for a minute

* Everything works so far

Need to test properties initialised in constructor

* Check for constructor initialisation

* change error wording

* Improve error wording

* Add codefix to add missing 'declare'

* Always emit accessors in .d.ts files

* Allow 'declare' on any uninitialised property decl

* Undo code moves

* Let sleeping dogs lie

* Correctly set NodeFlags.Ambient

And simplify redundant parts of check.

* Remove more unneeded code

* Update baselines

* Update baselines

* Update baselines

* Ignore this-property assignments

* Fix base-in-interface check

* Do not error when base parent is interface

* Fix base interface check

* Add missed baselines

* Fix check

* Fix new errors in services

* Fix new errors in services

* Fix errors in testRunner

* Add flag and turn off errors when on

* Structure of new emit is correct, fake content

It is 'hi'.

* Basically right emit

* Fix one last unitialised property declaration

* Haha no I missed another one

* Fix whitespace back to CRLF

* Minor fix and code cleanup

* New test case

* Fix bug in isInitializedProperty

* Updates from design meeting.

1. Change flag name to useDefineForClassFields (and flip polarity).
2. Forbid ES3 + useDefineForClassFields (since there is no
defineProperty).
3. Forbid overriding an abstract property-with-initializer with an
accessor.

* Update baselines

* Object.defineProperty for methods too

Using code from Ron from his upcoming refactor of the factory functions.

* Update slow baselines

* Improve error message

* Update src/compiler/transformers/utilities.ts

Co-Authored-By: Andrew Branch <andrewbranch@users.noreply.github.com>

* Add test of computed properties

* Remove done TODO
2019-09-26 13:25:05 -07:00
Sheetal Nandi 91c66a0963 Add tsc baselining test for scenario that changed. 2019-09-25 10:05:10 -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 992c211c22
Merge pull request #32028 from microsoft/referencesPrototypeSourceFile
For editing experience, use source instead of .d.ts files from project references
2019-09-24 13:16:53 -07:00
Sheetal Nandi f24cad20e2 Update the error summary reporter to take sys as parameter 2019-09-24 12:15:37 -07:00
Sheetal Nandi bf0fc858c1 Fix after merging latest baselining branch 2019-09-24 09:55:50 -07:00
Sheetal Nandi bd7d370fc8 Merge branch 'baselining' into resolution 2019-09-24 09:53:13 -07:00
Sheetal Nandi 8c2cd888dd Make time and tick local to test case so it doesnt affect the baseline 2019-09-24 09:46:32 -07:00
Sheetal Nandi 2d62050b8f Show redirected files in --listFiles 2019-09-20 14:23:04 -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 4786279fb0 Expose method to baseline fs 2019-09-20 14:10:47 -07:00
Sheetal Nandi 7f004ad8df
Merge pull request #33380 from microsoft/isolatedModules
With --isolatedModules, --declaration emit is now allowed and builder handles it for incremental compilation
2019-09-19 16:20:21 -07:00
Martin Probst 6bb7e5c086 Handle parentless nodes in isParameterPropertyDeclaration
Fixes #33295.

This follows a similar pattern as in #20314 by requiring an explicit
`parent` parameter. Where possible, it uses the appopriate variable at
the call sites.

In several locations there is no context available though (e.g.
inspecting `valueDeclarations`) and we access `.parent` as the code
previously did. From a cursory inspection this seems correct, these
callpaths originate in phases where there must be a `parent` (i.e. in
checker, binder, etc).

Change-Id: I28e4726777b57237bec776e4001e9e69ac591b11
2019-09-17 13:22:30 -07:00
Andrew Casey f10e38fea7 Make extractSymbol explicitly drop JSDoc nodes
Fixes #33332
2019-09-17 10:35:11 -07:00
Wesley Wigham 038d95144d
Remove all submodules - just force clone and reset on run instead (#33425) 2019-09-13 16:14:33 -07:00
Arpad Borsos a8d04b2db9 Fix Identifiers: NaN diagnostic when having JSON SourceFiles
This makes sure that the `identifierCount` and `nodeCount` properties
are always initialized for `SourceFile` objects.
2019-09-12 21:10:38 +02:00
Sheetal Nandi 2692b2e214 Add failing test cases for isolatedModules after enabling declaration emit 2019-09-11 12:48:58 -07:00
Sheetal Nandi c0f0d9f798 Merge branch 'master' into dtsOnlyEmit 2019-09-11 12:42:48 -07:00
Sheetal Nandi b26ca160f4 Merge branch 'master' into referencesPrototypeSourceFile 2019-09-11 12:27:58 -07:00
Sheetal Nandi 8521002dff Baseline emitted files that are written even if same file contents 2019-09-09 15:44:43 -07:00
Sheetal Nandi e43d504422 Baseline tsbuild info section files from written files 2019-09-09 15:14:35 -07:00
Sheetal Nandi bfc4f7a12f Get the last output from the written files 2019-09-09 14:17:58 -07:00
Sheetal Nandi 1f149ccfd7 Use clean and written files to verify the tsbuild incremental compilation = clean build compilation 2019-09-09 14:09:54 -07:00
Sheetal Nandi 566d32b2e8 Refactor to write baseline of sourcemaps that are written 2019-09-09 13:54:59 -07:00
Sheetal Nandi 54d9ce9247 Merge branch 'master' into referencesPrototypeSourceFile 2019-09-05 13:51:56 -07:00
Alexander T f0e8518010 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-09-04 11:35:45 +03:00
Sheetal Nandi 5de0303728 Fix transpiling when options specify incremental or tsbuildinfofile
Fixes #33184
2019-09-03 13:14:50 -07:00
Alexander b1d748b644 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-31 22:12:41 +03: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 5ea4257e6e
Fix the semantic diagnostics caching in builder to handle conversion from relative to buildInfo to absolute path (#33168)
Fixes #33161
2019-08-30 15:44:51 -07:00
Alexander T f8ab00b407 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-28 10:11:38 +03:00
Andre Sutherland 5d36aab06f Added errorCount to WatchStatusReporter to detect 2 or more errors (#33082)
* Added errorCount to WatchStatusReporter discern between 0 and 2 or more errors

* Added test for ensuring WatchStatusReporter receives errorCount
2019-08-27 16:40:21 -07:00
Sheetal Nandi a469fd82b9 Should not report that files are not part of config for files that are not going to be emitted 2019-08-22 13:37:36 -07:00
Sheetal Nandi 076dde4820 Test with --out as well 2019-08-22 13:00:37 -07:00
Sheetal Nandi c6e502be7d Verify config file errors 2019-08-22 11:26:26 -07:00
Sheetal Nandi 4c4ddf833d Merge branch 'master' into referencesPrototypeSourceFile 2019-08-21 15:42:36 -07:00
Alexander T 0d941d6943 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-21 10:02:57 +03:00
Wesley Wigham 219a570a75
Fix discovery and execution of root-level tests in the parallel runner (#32980) 2019-08-20 17:18:31 -07:00
Sheetal Nandi 5ac450510a
Handle network style paths for watching (#32888)
* Refactoring

* take windows style root as test server host parameter

* Handle network style paths for watching
Fixes #32796
2019-08-20 10:52:56 -07:00
Alexander T fea9e11174 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-20 11:07:18 +03:00
Ron Buckton 1bf218291f
Fix default behavior for transpileModule when fileName not provided (#32982) 2019-08-19 18:13:39 -07:00
Alexander a7f41621fb Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-17 16:37:39 +03:00
Wesley Wigham d304049e0c
Run user test submodule update in the correct directory (#32921) 2019-08-16 14:22:21 -07:00
Alexander T b6d981aec8 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-16 12:13:57 +03:00
Andrew Branch 2dd10bdfa1
Reuse unchanged ambient declarations in incremental parsing (#32849)
* Incrementally parse unchanged ambient declarations

* Re-parse modifiers and decorators so as not to skip errors

* Revert unnecessary change

* Undo the test change that was changed 2 years ago
2019-08-15 10:05:21 -07:00
Alexander T f20a2828f2 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-15 10:32:45 +03:00
Sheetal Nandi 31a26120f9
Merge pull request #32788 from microsoft/tsbuildFixes
Fixes for tsbuild scenarios
2019-08-14 09:07:24 -07:00
Alexander T b728bf4bfa Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-14 13:42:02 +03:00
Ron Buckton a74f109f95 Do not escape actual template literals on emit (#32844) 2019-08-13 15:54:35 -07:00
Sheetal Nandi 1a9198a53a PR feedback 2019-08-12 16:06:09 -07:00
Alexander b33b90b559 change const to let 2019-08-10 10:10:04 +03:00
Alexander 371c3c630e remove TODO comments 2019-08-10 10:05:13 +03:00
Alexander 23a3b340b0 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-10 09:58:25 +03:00
Andrew Casey 816e7b0567
Merge pull request #32789 from amcasey/FileNotFoundError
Correct string template
2019-08-09 15:16:23 -07:00
Andrew Casey 8c6612b31e Tweak message text 2019-08-09 14:50:24 -07:00
Andrew Casey a02735e1fb
Merge pull request #32785 from amcasey/FileNotFoundError
Include fewer paths in exception
2019-08-09 14:28:32 -07:00
Sheetal Nandi 8ac45805c0 Add error related to file not in rootDir and file not part of included root files at the references 2019-08-09 14:19:40 -07:00
Andrew Casey 6c19c13094 Use an explicit type 2019-08-09 14:04:04 -07:00
Ron Buckton 9133e7ad0e
Use defaults for transpileModule (#31563) 2019-08-09 14:04:01 -07:00
Sheetal Nandi fd515b519e Handle status and error messages for better checking 2019-08-09 13:38:25 -07:00
Sheetal Nandi 9e8fbcd7f8 Transitively upstream blocked project should not build 2019-08-09 13:38:25 -07:00
Sheetal Nandi 94d54b967d Circular reference in the build queue is build stoppable error 2019-08-09 13:38:25 -07:00
Sheetal Nandi d9ad559042 Verify demo build 2019-08-09 13:38:24 -07:00
Alexander 536f59cd7d fix formatting 2019-08-08 21:49:10 +03:00
Alexander ceccfd8867 array-type: [ default: array, generic: array ] 2019-08-08 21:30:18 +03:00
Alexander 455f8b5511 fix eslint errors. remove tslint:* comments 2019-08-07 21:35:05 +03:00
Alexander 481d70d50d Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-07 21:23:10 +03:00
Ben Lichtman 9971e8b560
Merge pull request #32688 from uniqueiniquity/skipCOSForDTS
Avoid compile on save when there is no emit impact
2019-08-07 10:44:54 -07:00
Alexander 5c2e000561 remove useless TODO comment 2019-08-07 20:33:13 +03: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
Ben Lichtman c0f187a4e8 Allow compile on save with decorator emit 2019-08-06 13:39:18 -07:00
Ron Buckton cc3db8f448 Merge branch 'Saulzi-master' 2019-08-06 10:48:47 -07:00
Ron Buckton 3ff0a249d2 Update based on PR feedback 2019-08-06 10:46:17 -07:00
Alexander T 034ba9fd25 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-06 09:07:48 +03:00
Ron Buckton e3f4979736
Fix emit for object rest on a module export (#32699)
* Fix emit for object rest on a module export

* Add tests for exports of empty object/array binding patterns

* Add delay for exec to ensure diff tool has enough time to start
2019-08-05 16:53:21 -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
Alexander T 012bacc415 Define interface for TSConfig. Change compilerOnSave to compileOnSave (#32481) 2019-08-05 09:24:09 -07:00
Alexander 4d23429d98 fix eslint errors 2019-08-04 16:00:57 +03:00
Alexander a292ae1789 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-04 15:35:41 +03:00
Alexander a37d34a5b6 lint src/, scripts/ folders separately 2019-08-04 15:33:01 +03:00
Ben Lichtman 0cab79fc56 Add test 2019-08-02 15:56:01 -07:00
Sheetal Nandi b84f13d7cf Use single stats watcher per filename
Fixes #28690
2019-07-29 15:33:34 -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 4efcfb7120 Some refactoring 2019-07-29 15:33:33 -07:00
Sheetal Nandi 1ac980ec96 File move 2019-07-29 15:33:33 -07:00
Alexander b6c3c7a486 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-29 22:25:02 +03:00
Wesley Wigham b963e1a2a7
Update LKG (#32578)
* Update LKG

* Add @types/node version bump

* Small paatches/casts to be compatible with latest node

* Accept API baseline update

* Make internal NodeBuffer compatable with latest Buffer

* Why do we even have an internal buffer type

* Sync up internal buffer type better

* Fix lint

* Readd mroe missing Buffer methods
2019-07-29 10:33:43 -07:00
Alexander T e1a138312f fix eslint errors 2019-07-29 18:42:01 +03:00
Alexander T 1b4dfbc7d6 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-29 18:39:29 +03:00
Alexander T 11ec6118fb @typescript-eslint/array-type 2019-07-29 18:39:11 +03:00
Sheetal Nandi 2fe3c1b3b7
Merge pull request #32561 from microsoft/retainFreshlyCreatedProject
Retain the configured project opened during opening client file even if opened file isnt included in that project
2019-07-26 12:18:26 -07:00
Jesse Trinity 599e36a068
Decrement line ends if they end with a carriage return. (#31220)
* Decrement line ends if they end with a carriage return.

* Changed handling of newlines and inlined regex operation.

* fixed misname of hintSpan

* added tests

* revert inline of regex match and use getLineEndOfPosition

* fixed lint error and changed a silly thing in tests
2019-07-25 21:29:12 -07:00
Sheetal Nandi 666c4be844 Merge branch 'master' into referencesPrototypeSourceFile 2019-07-25 14:03:48 -07:00
Sheetal Nandi 10ee85c98c Retain the configured project opened during opening client file even if opened file isnt included in that project
This helps not create and remove project on every open if tsconfig file isnt referenced by any open file
2019-07-25 12:38:26 -07:00
Sheetal Nandi ee623c1ae6 Add test case before change where config project is created just to remove it 2019-07-25 12:04:13 -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
Alexander 0059763d8f move eslint rules from eslint-plugin-microsoft-typescript to scripts/eslint 2019-07-24 13:31:17 +03:00
Wesley Wigham 40fd4efdf6
Strip more kinds of timestamps and versions from dockerfile output (#32519)
* Strip more kinds of timestamps and versions from dockerfile output, rewrite office-ui-fabric dockerfile to use new lerna build system

* Add another filter for just output

* Update user baselines (#23)

* Update user baselines (#24)

* Strip only maybe-present timestamps

* More lenient timestamp filter

* Update user baselines (#25)

* Simplify and enhance vscode dockerfile to use nightly ts in ts extension, too

* Update user baselines (#26)

* Update user baselines (#27)
2019-07-23 17:14:50 -07:00
Alexander T a79f598269 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-23 13:10:04 +03: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
Alexander T 40f2f77358 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-22 13:50:43 +03:00
Sheetal Nandi aab3069e64 Fix the assert of reporting file infos still attached to the project for circular json reference 2019-07-19 15:55:46 -07:00
Alexander T 949770a4fe @typescript-eslint/triple-slash-reference 2019-07-19 10:30:40 +03:00
Alexander T 2c32308f35 no-null/no-null 2019-07-18 10:50:38 +03:00
Alexander T a8ee8fbe87 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-18 10:00:16 +03:00
Sheetal Nandi b589020bb3
Merge pull request #32425 from microsoft/scopedPackageAquisition
Handle scoped package names in typing installer
2019-07-16 16:48:35 -07:00
Sheetal Nandi 607c9c5e26 Fix missing tokenToString for the backtick
Fixes #32073
2019-07-16 13:30:38 -07:00
Sheetal Nandi 49ba408e4f Handle scoped package names in typing installer
Fixes #32075
2019-07-16 11:13:03 -07:00
Alexander T 64baa804a8 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-15 18:35:34 +03:00
Sheetal Nandi fd4f4fe5a2 Ensure that the filePaths in compiler options are absolute before getting relative path to buildInfo directory
Fixes #32353
2019-07-11 13:18:35 -07:00
Sheetal Nandi 103fe5fbc5 Merge branch 'master' into referencesPrototypeSourceFile
Uptodate to 3.6.0-dev.20190711
2019-07-11 12:05:36 -07:00
Sheetal Nandi b631850978 Add option disableSourceOfProjectReferenceRedirect to disable using sources of project reference redirect from editor 2019-07-10 15:49:53 -07:00
Alexander T 9d01ef0f8e Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-10 14:36:10 +03: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 b1fa2ebff5 Errors using DiagnosticsSync commands 2019-07-05 12:40:27 -07:00
Sheetal Nandi 9be475bdaa Refactoring 2019-07-05 10:17:42 -07:00
Alexander T 4defd1d635 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-04 12:49:33 +03:00
Ron Buckton e8bf9584aa
Improve type checking and inference for Generators and Async Generators (#30790)
* Improve typing for Generators and Async Generators

* Add TReturn and TNext to Iterator, IterableIterator, etc.

* Update ts internal Iterator to be assignable from global Iterator

* Make 'done' optional in IteratorYieldResult

* Revert Iterable and IterableIterator to simpler versions plus other fixes

* Add additional inference tests

* Added additional tests

* PR cleanup and minor async iteration type fix

* Updated diagnostics message and added non-strict tests

* Fix expected arity of Iterator/AsyncIterator
2019-07-03 21:55:59 -07:00
Sheetal Nandi 15b68a9396 Skip typechecking of source of project reference redirect 2019-07-03 15:39:29 -07:00
Sheetal Nandi b5737fc535 Refactor tests so its easy to edit and reason about them 2019-07-03 12:15:24 -07:00
Nathan Shively-Sanders 6f0baa3ae1
Merge pull request #29717 from petersandor/jsdoc-tag-author-email-support
Support email in author JSDoc tag
2019-07-03 10:42:02 -07:00
Alexander T 9f474150c6 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-02 17:57:44 +03:00
Wesley Wigham 3e6856137a
Add support for sharding tests across multiple workers (#32173)
* Add support for sharding tests across multiple workers

* Disable unittests when runners are expressly provided (unless they contain the unittest runner)
2019-07-01 14:56:57 -07:00
Wesley Wigham ff81d5261e
Elide the exact node version rush complains about from the docker output (#32204) 2019-07-01 13:13:44 -07:00
Sheetal Nandi 4d13f53df8 Merge branch 'master' into referencesPrototypeSourceFile 2019-07-01 11:50:11 -07:00
Sheetal Nandi f72af3be60 Verify the scenarios when d.ts directory of dependency doesnt exist 2019-07-01 11:34:57 -07:00
Sheetal Nandi af20e791fd
Merge pull request #32167 from microsoft/tryReuseProgram
When checking sourceFile is from external library, use sourceFile.resolvedPath since thats how the source files are queried and thats the real path
2019-07-01 11:16:17 -07:00
Sheetal Nandi f6d7261288
Merge pull request #32147 from microsoft/noDtsWhenNotUsingProjectReferences
Watch generated file if it doesnt exist when trying to translate it to to source generated position
2019-07-01 10:22:16 -07:00
Austin Cummings c30054de63 Fix esModuleInterop affectsEmit change test 2019-06-30 11:06:00 -07:00
Austin Cummings 5b694f8302 Add tests for module and esModuleInterop affectsEmit change 2019-06-28 18:34:59 -07:00
Wesley Wigham 6760a03cec
Add vscode docker test (#32152)
* Add vscode docker test

* Remove PID-log line

* Update user baselines (#18)
2019-06-28 13:22:25 -07:00
Sheetal Nandi 96a8c86c65 Merge branch 'master' into referencesPrototypeSourceFile 2019-06-28 12:42:22 -07:00
Sheetal Nandi 4f802e7205 When checking sourceFile is from external library, use sourceFile.resolvedPath since thats how the source files are queried and thats the real path
Fixes #32086
2019-06-28 10:14:33 -07:00
Wesley Wigham 2af8ac73ff
Add xterm test to docker suite (#32149) 2019-06-27 15:29:22 -07:00
Sheetal Nandi b32afb55d1
Merge pull request #31985 from microsoft/buildInfoData
Make paths in tsbuildinfo file to be relative to the file
2019-06-27 12:49:52 -07:00
Sheetal Nandi 75bd3cd9be Fix more tests 2019-06-27 12:16:32 -07:00
Sheetal Nandi da9260c013 Create original project when location is in source of project reference redirect 2019-06-27 10:38:52 -07:00
Alexander T 769bb0b475 remove tslint configuration 2019-06-27 13:49:35 +03:00
Alexander T 810303542d Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-06-27 11:51:20 +03:00
Alexander T f6a50067d3 @typescript-eslint/indent 2019-06-27 11:30:03 +03:00
Sheetal Nandi 2f30add809 More tests 2019-06-26 15:29:35 -07:00
Sheetal Nandi 012ecdacde Add sourceOf project reference redirect to filesByName list for redirect path so that module symbol is correctly resolved 2019-06-26 14:56:21 -07:00
Nathan Shively-Sanders 261952247a
Merge pull request #31945 from microsoft/skip-costly-tests
Skip costly tests
2019-06-25 15:47:49 -07:00
Sheetal Nandi f4728682b7 Watch generated file if it doesnt exist when trying to translate it to to source generated position 2019-06-25 15:16:11 -07:00
Sheetal Nandi 3e49556a88 Watch generated file if it doesnt exist when trying to translate it to to source generated position 2019-06-25 15:11:44 -07:00
Wesley Wigham a150d55592
Explicitly error when an exclude is provided by a test as it will be unused (#32014) 2019-06-24 15:29:02 -07:00
Alexander 4b5017d551 fix eslint errors after merge 2019-06-23 18:58:07 +03:00
Alexander 7389200ce2 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-06-23 18:49:35 +03:00
Sheetal Nandi 181028821b Fix tests 2019-06-21 14:54:38 -07:00
Wesley Wigham 9d23ce3d06
Sanitize rush progress numbers in docker test output (#32029) 2019-06-21 14:49:43 -07:00
Sheetal Nandi 179e0a606a
Merge pull request #32027 from microsoft/containerReference
Container only ref needs to be ignored from uptodate status
2019-06-21 11:28:45 -07:00
Sheetal Nandi d0282b75a1 Add test to verify when source changes 2019-06-21 09:07:14 -07:00
Wesley Wigham 37b20f6afd
Eliminate references to defunct LSHost in comments (#32018) 2019-06-20 19:11:46 -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
Wesley Wigham c39a877a92
Add dockerfile based tests for azure-sdk-for-js and office-ui-fabric-react (#31948)
* Add dockerfile based tests

* Update tests/cases/docker/README.md

Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

* Combine sanitize functions

* Add some debugging instructions to README

* Fix listed command order
2019-06-20 12:47:57 -07:00
Sheetal Nandi 36df28d800
Merge pull request #31986 from microsoft/buildLocale
Support --locale with --build
2019-06-20 12:25:37 -07:00
Alexander T 9fcaa19ab0 microsoft-typescript/no-in-operator 2019-06-20 14:13:46 +03:00
Sheetal Nandi 06d188a255 Support --locale with --build
Fixes #31960
2019-06-19 15:38:05 -07:00
Sheetal Nandi b9fc44ece7 Bundle info paths as relative to tsbuildinfo file 2019-06-19 14:49:13 -07:00
Sheetal Nandi 9446fc0c0c Convert options to relative paths 2019-06-19 12:54:22 -07:00
Sheetal Nandi d760cbb74b Make any paths in buildInfoFile to be relative to it. 2019-06-19 12:54:21 -07:00
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