Commit graph

3185 commits

Author SHA1 Message Date
Andrew Branch 086e00de91
Expand auto-import to all package.json dependencies (#38923)
* Start experiment

* Add logging

* Go back to a single program

* Fix forEachExternalModuleToImportFrom

* Move auxiliary program to language service

* Add logging

* Don’t use resolution cache

* Fix(?) containingProjects for ScriptInfo in auxiliary program

* Fix ScriptInfo project inclusion

* Add test for default project of auto-importable ScriptInfo

* Add fourslash server test

* Don’t create auto import provider inside node_modules

* Add monorepo-like test

* WIP

* Naively ensure autoImportProvider is up to date after package.json change

* Start limiting when auto update provider gets updated

* Respond to changes in node_modules

* Don’t create auto-import provider until a file is open that would use it

e.g., don’t create them during cross-project find-all-refs

* Clean up naming, @internal marking, and fix empty project creation bug

* Drop devDependencies, include peerDependencies

* Add additional compiler options

* Fix interaction with importSuggestionsCache

* Move option to UserPreferences, allow inclusion of devDependencies

* Don’t filter out peerDependencies

* Watch unparseable package.jsons

* But don’t filter packages out due to an invalid package.json

* Update test

* Don’t use autoImportProvider in codefixes where it can never be used (or any refactors)

* Add CompletionEntry property for telemetry

* Add assertion for isPackageJsonImport to fourslash

* Fix missing pushSymbol argument

* Add isPackageJsonImport to tests and API baselines

* Fix unit test

* Host auto import provider in new Project kind

* Fix InferredProject attaching on AutoImportProvider-included files, load eagerly

* Update Public APIs

* Simplify PackageJsonCache host

* Remove unneeded markAsDirty

* Defer project finished event until after AutoImportProvider is created

* Make AutoImportProviderProject always report isOrphan = true

* Close and remove AutoImportProviderProject when host project closes

* Don’t set pendingEnsureProjectForOpenFiles

* Use hasAddedOrRemovedFiles instead of hasNewProgram

* Use host-wide watchOptions for package.json watching

* Add to `printProjects`

* Clean up

* Get autoImportProvider directly from LanguageServiceHost

* Clean up

* Clean up

* Close auto import provider on disableLanguageService

* Move AutoImportProvider preload to project updateGraph

* Clear auto import suggestion cache when provider program changes

* Fix tests

* Revert yet-unneeded change

* Use projectService host for module resolution host

* Don’t re-resolve type directives if nothing has changed

* Update src/server/project.ts

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>

* Use ts.emptyArray

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2020-06-22 16:34:27 -07:00
Wenlu Wang 59ad375234
Add deprecated related feature (#38523)
* Add deprecated related feature

* Add more support

* fix navtree

* Add identifier check

* Add more deprecated

* fix crash

* fix more crash

* fix crash

* improve diagnostic

* avoid new tag

* avoid tags

* accept baseline

* Check deprecated in binder

* fix baseline

* fix jsdoc cache

* fix incorrect fix

* Avoid useless changes

* Accept baseline

* Add tests

* fix perf

* fix public api

* Adjust deprecated mark on qualifed name

* Revolve alias symbol

* Use modifier flags insted of symbol props

* Fix modifier flag resolve

* Make lint happy

* Fix crash

* fix crash

* Add cached utils function

* Accept baseline

* Add more tests

* try pinning octokit again

* Avoid tests

* Use utils some

* Deprecated perf test (#3)

* check valueDeclaration only

* check without modifierFlags

* donot check alias

* use cached tag

* remove call to jsdoc

* use deprecated tag

* revert changes

* Revert mission changes

* use node flags

* cache result

* cache

* avoid modifier flags

* Opts

* fix jsdoc include modifier

* fix tests

* fix again

* use symbol flag

* set @octokit/rest back to latest

* fix trailing spacel int

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-06-18 17:41:26 -07:00
ShuiRuTian 8293e517c0
fix rename cause import change wrongly (#38462)
* use canonical file name when resolve module

* renameSync in vfs supports same folder.

* Update src/harness/vfsUtil.ts

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>

* change tss rather than compiler.

* remove useless comment.

* use fileName rather than path.

Co-authored-by: Song Gao <song.gao@laserfiche.com>
Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2020-06-18 08:31:30 -07:00
Orta d7aa5f3ee1
Show a diff when the public api baselines fail (#39108)
* Add semantic highlighting pt1

* Make the public API unit tests echo out a diff
2020-06-17 17:00:46 -04:00
Ron Buckton eb3645f16b
Refactor node factory API, use node factory in parser (#35282)
* Refactor node factory API, use node factory in parser

* Move UnparsedSource nodes to factory

* Make most Node properties read-only

* Make pos/end/parent and JSDoc 'comment' read-only

* Update function/constructor-type factories

* Remove treeStateObserver

* Simplify Debug.deprecate

* Remove unused factory methods, simplify lazy factory methods

* Fix base factory used for source file updates

* Update test baseline due to merge from master

* Rename factory methods to be more consistent (#39058)
2020-06-16 16:55:03 -07:00
Andrew Branch 852e7a0b60
Add containerName to CallHierarchyItem (#38997)
* Add containerName to CallHierarchyItem

* Update public APIs

* Update test to demonstrate nested namespace working
2020-06-10 11:56:03 -07:00
rockcs1992 74b4b5640a
Fix typo for 'blocklist' (#39001) 2020-06-10 08:27:16 -07:00
蜗牛老湿 3c49fb0d9f
use blocklist instead of blacklist (#38988) 2020-06-09 08:10:18 -07:00
Sheetal Nandi 0dc338281a
Deprecate reloadFs so the tests are more clear in what they are achieving and its easier to track changed behaviour (#38954) 2020-06-05 13:43:34 -07:00
Jesse Trinity 3b15b35b37
Merge pull request #38378 from jessetrinity/refactorTriggerReason
Add RefactorTriggerReason
2020-06-03 11:18:08 -07:00
Sheetal Nandi f0da6d1203
Some changes to tsc baselines for clarity (#38850)
* Baseline programs in tsc -b and tsc -incremental mode as well

* Refactor outFile

* Tests

* Distinct input and output

* Add helper to baseline serialized invocations of tsc on incremental edits

* Input and output in watch mode

* Update src/testRunner/unittests/tsbuild/helpers.ts

Co-authored-by: Wesley Wigham <wewigham@microsoft.com>

Co-authored-by: Wesley Wigham <wewigham@microsoft.com>
2020-06-02 11:49:21 -07:00
Jesse Trinity a07a79b772 remove unused test method 2020-05-29 13:02:49 -07:00
Jesse Trinity 85e0d8b14a add refactorNotAvailableForTriggerReason 2020-05-29 12:55:35 -07:00
Jesse Trinity f3751fbdf3 change type of RefactorTriggerReason 2020-05-29 12:54:59 -07:00
Armando Aguirre 89429ac6aa Fixed lint errors 2020-05-22 18:22:28 -07:00
Armando Aguirre 413a3d3eb4 Fixed more lint issues. 2020-05-22 17:04:53 -07:00
Armando Aguirre 35a3d8547b Fixed lint issues 2020-05-22 16:59:50 -07:00
Armando Aguirre ee37d8e8d3 Added comment and uncomment selection 2020-05-22 16:56:57 -07:00
Armando Aguirre 381dd8427a Removed TextRange and added FileRangeRequestArgs 2020-05-22 16:47:34 -07:00
Armando Aguirre 33333e86eb Added toggleLineComment, toggleMultilineComment with jsx and tests 2020-05-22 16:46:31 -07:00
Andrew Branch 707e977056
Ensure formatter can always get a newline character (#38579)
* Ensure formatter can always get a newline character

* Make FormatContext.host optional since it’s not necessary if format options are all applied

* Make FormattingHost required again
2020-05-19 13:14:32 -07:00
Wenlu Wang 9725d623ce
Fix build type error (#38525) 2020-05-13 07:44:49 -04:00
Andrew Branch 23b500cadf
Don’t offer this. completions on self, window, global, globalThis. Disambiguate this. completions from others in details requests. (#37652)
* Special-case window, self, global, globalThis methods

* Disambiguate global and this property completions in details requests

* Hide the Map<boolean> implementation

* Update old tests

* Replace SymbolOriginKind stringification with dedicated enum
2020-03-31 12:40:57 -07:00
Orta 6afd5c996c
Adds a preview link to the baseline emits for sourcemaps (#37111) 2020-03-26 11:37:37 -04:00
Sheetal Nandi 6c1e8aa0ad
Sort the arrays of fileNames in the build info (#37541)
* Sort the arrays of fileNames in the build info
Earlier we did this in testing to ensure we could baseline now moved to actual build info writing
Fixes #37156

* Sort using compareStringsCaseSensitive
2020-03-25 14:57:46 -07:00
Sheetal Nandi 7e07a2b5d1
Allow rich response for compile on save (#37462)
Fixes #30739
2020-03-19 14:03:21 -07:00
Andrew Branch 237ea526f9
Preserve newlines from original source when printing nodes from TextChanges (#36688)
* Allow emitter to write multiple newlines in node lists

* Progress

* Progress

* Fix recomputeIndentation

* Add tests, fix leading line terminator count

* Do a bit less work when `preserveNewlines` is off

* Fix accidental find/replace rename

* Restore some monomorphism

* Fix single line writer

* Fix other writers

* Revert "Fix other writers"

This reverts commit 21b0cb8f3b.

* Revert "Fix single line writer"

This reverts commit e535e279f9.

* Revert "Restore some monomorphism"

This reverts commit e3ef42743a.

* Add equal position optimization to getLinesBetweenRangeEndAndRangeStart

* Add one more test

* Actually save the test file

* Rename preserveNewlines to preserveSourceNewlines

* Make ignoreSourceNewlines internal

* Optimize lines-between functions

* Add comment;

* Fix trailing line terminator count bug for function parameters

* Preserve newlines around parenthesized expressions

* Back to speculative microoptimizations, yay

* Don’t call getEffectiveLines during tsc emit at all
2020-03-19 09:46:00 -07:00
Sheetal Nandi e60bbac84f
Fix declaration emit when the packages are included through symlinks (#37438)
* Convert symlink scenarios to virtual FS where its symlinks are correctly maintained
Adds test for #36866

* Fix the casing issue when redirects differ in casing of the file

* Make ModuleSpecifierResolutionHost internal

* Refactoring for ModuleSpecifierResolutionHost

* If any of the file path option is from node_modules folder, consider only paths in node_modules folder

* Update src/services/utilities.ts

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

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2020-03-17 13:21:40 -07:00
Sheetal Nandi 2458c8a016
When the imported module is through node_modules and symlink to folder that isnt node_modules (#37387)
* Add tests that fail because of symlink to non common directory node_modules

* When the imported module is through node_modules and symlink to folder that isnt node_modules
Most of the monorepo like scenarios are like this so looking at symlink to decide if file can be imported is essential
Fixes #28689
2020-03-16 11:15:39 -07:00
Orta f1cc8e4e4e
[minor] Adds some docs to the LSP interface (#36740)
* Adds some docs to the LSP dts

* Ensure that getProgramDiagnostic is included everywhere that getCompilerOptionsDiagnostic is

* Update baselines

* Apply suggestions from code review

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

* Remove the getCompilerOptionsDiagnostics -> getProgramDiagnostics change

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2020-03-13 13:26:39 -04:00
Sheetal Nandi 1f710167de
Ensure that we have seenAffectedFiles map when files are added to pending emit because they were present in the old state (#37302)
* Make the systems for baselining default to pretty

* Ensure that we have seenAffectedFiles map when files are added to pending emit because they were present in the old state
This happens in build scenarios since semantic diagnostics are queried before emit and hence files are added to seenAffectedFiles pending emit
Fixes #37269
2020-03-12 10:54:30 -07:00
Andrew Branch f9945f5acf
Full support for CommonJS auto-imports in JS (#37027)
* Support add new requires

* Always use destructuring for requiring default exports

* Add more tests

* Update existing fourslash tests

* Use `getExportsAndPropertiesOfModule`

* Add UMD test

* Apply suggestions from code review

Fix typos

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

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-02-28 14:34:20 -08:00
Orta 2c4155c351
Adds underlines to differences in strings (#36409) 2020-02-27 12:46:15 -05:00
Sheetal Nandi e89df5ce6f
Handle getScriptVersion correctly to ensure program structure is checked correctly (#36808)
* Fix tests when there are project references but has disableSourceOfProjectReferenceRedirect

* Handle getScriptVersion correctly to ensure program structure is checked correctly
Fixes #36748

* Harness's language service host doesnt have getProjectVersion.
This means earlier we were creating fresh program everytime we did LS operation
Now we reuse same program, so quick info depends on order of quickinfo demands

* Because same program is used, it unvails a bug that if `export=` is evaluated before finding references, it cant find all definitions from the merge

* Update src/server/project.ts

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

* Make clearSourceMapperCache required

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-02-25 16:11:21 -08:00
Orta 8a797cad2b
Adds floating block comments to the outlining spans response (#36880)
* Adds floating block comments to the outlining spans response

* Only use one route for grabbing outline nodes, which now includes special casing the EOF token
2020-02-25 17:09:16 -05:00
Ron Buckton 177713ef45
Switch Debug.assertX functions to use asserts conditions (#36995)
* Switch Debug.assertX functions to use asserts conditions

* Replace assert functions with ts.noop when assertion level too low
2020-02-24 18:20:58 -08:00
Wesley Wigham 4a34294908
Unify padding impls and consistently use them 2020-02-19 17:21:51 -08:00
Andrew Branch 950b36192a
Fix renaming an ExportSpecifier name when propertyName is present (#36790)
* Fix renaming exportSpecifier name when propertyName is present

* Add baseline test for name without propertyName too
2020-02-13 16:55:52 -08:00
Alexander T 8c31700735
Enable @typescript-eslint/space-before-function-paren, @typescript-eslint/no-unused-expressions (#36569)
* use @typescript-eslint/no-unused-expressions instead of no-unused-expressions

* enable @typescript-eslint/space-before-function-paren
2020-02-04 14:43:25 -08:00
Ron Buckton 01af3aa483
Support 'find references' on most declaration-related keywords (#36490)
* Allow 'find references' to work on most declaration keywords

* Add support for rename

* Add more keywords, move logic out of checker and into services

* Add additional type and expression keywords
2020-01-31 11:53:57 -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
Wesley Wigham 140fee96d7
Capture fakes.version instead of the current version string in baselines (#36518)
* Capture CURRENT.VERSION instead of the current version string in baselines

* Use fakes.version

* Move replacer into patchHostForBuildInfoReadWrite
2020-01-29 16:15:09 -08:00
Ben Lichtman e87b2e3506
Merge pull request #36063 from uniqueiniquity/addWeakCompletionProperty
Add completion property to identify completions from unchecked files
2020-01-28 13:53:47 -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
Nathan Shively-Sanders ef5573b266
Add as completions (#36359) 2020-01-23 08:29:06 -08:00
Nathan Shively-Sanders c8e2f58ec5
Completions for asserts and declare (#36355)
* Add completions for `asserts`

* Add declare assertions.
2020-01-22 10:43:33 -08:00
Orta 5e59eece34
Adds support for showing default exports in the navtree (#35477)
* Adds support for showing default exports in the navtree - Fixes #34601

* Handle the feedback in #35477

* Navigation items using default export or export = will get noted if they are a const vs function
2020-01-22 08:13:04 -05:00
Ron Buckton 50adabe32d
Improve diagnostics and add code fixes for top-level await (#36173) 2020-01-18 12:24:08 -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
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 9889c74939
Disable declaration emit for json files (#36066) 2020-01-08 09:54:32 -08:00
Ben Lichtman d59c6f3e6a Make unchecked property assertion optional 2020-01-07 14:40:47 -08:00
Ben Lichtman 509d243ea5 Add test 2020-01-07 13:07:52 -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
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
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
Andrew Branch c73af610fe
Add ignoreInterpolations util to fourslash for fuzzy diagnostic matching (#35652)
* Add ignoreInterpolations util to fourslash for fuzzy diagnostic matching

* Simplify

* It’s not Swift

* Fix regexp

* Remove unnecessary type assertion
2019-12-16 17:21:21 -08:00
Andrew Branch 8a88c1c84c
Don’t offer import fix for members of arrays or classes (#35635)
* Write failing test

* Don’t offer import fix for members of arrays or classes
2019-12-13 14:20:54 -08:00
Sheetal Nandi 1fd1b429f0
Handles different references and renames involved with import export and import type node (#34813)
* Test

* Handle import type node when handling the namespace import and reexport
Fixes #33017

* Handle qualifier of the importTypeNode

* Handle export specifier

* Fix rename prefix when search for rename starts at qualifier in import type ndoe

* Fix rename of qualifier with importType node when invoked without provideSuffixAndPrefix option
2019-12-11 15:11:27 -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 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 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 Branch f050750cc6
Don’t auto-import undefined (#35504) 2019-12-05 14:47:51 -08:00
Wesley Wigham 27616dd523
Move codefix types into services/types.ts (#35506)
* Move codefix types into services/types.ts

* Also split apart refactorProvider

* Move all meanings of DocumentHighlights into one file

* Use setter for object allocator

* Remove unneeded namespace reference

* Remove some shorthand references to nonlocal namespace variables

* Convert WatchType string enum to a structure that can be merged across modules

* Rename harness to harnessIO

* Move accidental globals into namespace

* Remove unused globals

* Suppress lints - these qualifiers are needed for the migration to go smoothly

* Hide global declaration
2019-12-05 10:51:31 -08:00
Andrew Branch 97aba45d6f
Emit unused identifier suggestion diagnostics in declaration files and ambient nodes (#35119) 2019-12-02 09:52:40 -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
Daniel Rosenwasser 3da85df511
Clean up error messages for using TypeScript syntax in JavaScr… (#35254)
* Fix up quotation marks in error messages in JavaScript files.

* Accepted baselines.

* Typescript -> TypeScript

* Accepted baselines.

* Migrate syntactic diagnostics tests to baselining tests.

* Accepted baselines.

* Update diagnosticMessages.json

* Removed markers.

* Add ability to baseline both semantic and syntactic diagnostics.

* Fix up broken diagnostics when using a server LS.

* Accepted baselines.

* Lints.

* Fake up sourcefile objects in the tsserver session client instead.

* Fewer allocations.
2019-11-22 14:51:22 -08:00
Andrew Branch 571ca60b08
Add preceding semicolon on await insertion when parentheses are included (#34627)
* Add preceding semicolon on await insertion when parentheses are included

* Just start with precedingToken

* Fix semicolon formatter regression

* Delete test with debatable expected behavior

* Lint after control flow changes
2019-11-19 13:11:42 -08:00
Ron Buckton 6c59dc34ac
More tests for super.method call chain, improve vary-by (#35013) 2019-11-18 18:03:37 -08:00
Andrew Branch 454a3a0b0f
Fix auto-imports from auto type acquisition definitions (#33766)
* Fix auto-imports from ATA typings

* Compare canonical filenames in isImportablePath
2019-10-17 13:59:09 -07:00
Andrew Branch a95a25b9a7
Fix completions of optional properties in generic positions (#33937)
* fixes #30507

* Add test case for generic Partial type

* Fixes #28470

* Simplify contextFlags binary check

* Add string literal completion test

* Fix ContextFlags typings

* Speed up inference expression for completion

* Fix baseline merge

* Make contextFlags internal

* Reapply readonly array changes

* accept baselines

* Fix generic completion tests

* Re-merge ContextFlags

* Don’t change type during inference

* Fix typos and superfluous undefined arguments

* Add test for completions in unconstrained generic object literal
2019-10-17 10:45:40 -07:00
Sheetal Nandi f24db4ccf4
Merge pull request #33921 from sQVe/refactor/correct-misspelled-response
refactor(spelling): correct misspelled response
2019-10-16 08:07:25 -07:00
Oskar Grunning 2f48ff37fd
refactor(spelling): correct misspelled response 2019-10-16 08:44:14 +02:00
Nathan Shively-Sanders d8d5ead83b
Restore 'type' and 'namespace' to All completion filter (#34491)
Vote in the comments below if you think I should restore other keywords!
Remember to like and subscribe!
2019-10-15 14:06:47 -07: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
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
Andrew Branch 7d9b22eea0
Add semicolon preference to formatter options (#33402)
* Add UserPreferences for semicolons

* Prototype formatter semicolon removal

* Implement semicolon insertion

* Fix existing tests

* Start adding tests

* Fix some edge cases of semicolon deletion

* Fix semicolon removal before comments

* Fix indentation

* Test on checker

* Replace semicolon-omitting writer with formatter preference

* Fix writing new nodes, update protocol

* Rename option

* Really fix formatting synthetic nodes

* Fix refactoring misses

* Un-update submodules gahhhh

* Update APIs

* Update for ESLint

* Revert accidental test change

* De-kludge deduplication of EOF processing

* Omit last element semicolon from single-line object-like types

* Revert "Omit last element semicolon from single-line object-like types"

This reverts commit 5625cb0237.

* Fix straggler test

* Add test for leading semicolon class members

* Rename a lot of stuff for clarity

* Invert some boolean logic
2019-09-26 13:23:29 -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 b76277092c Add test to verify tsc like command line input 2019-09-20 14:10:48 -07:00
Sheetal Nandi c0f0d9f798 Merge branch 'master' into dtsOnlyEmit 2019-09-11 12:42:48 -07:00
Sheetal Nandi 3a868af5f5 Fix typo 2019-09-11 12:34:20 -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 54d9ce9247 Merge branch 'master' into referencesPrototypeSourceFile 2019-09-05 13:51:56 -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
Alexander T acafb502cd Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-27 09:30:31 +03:00
Nathan Shively-Sanders 21f192367a
Fix infer from usage prop assignment (#33088)
* Add test case

* Fix infer from usage property assignment

Property assignment and shorthand property assignment were incorrectly
treated differently; both have ObjectLiteralExpression as a parent, but
the code previously assumed that property assignments had
ObjectLiteralExpression as parent.parent.

Also make fourslash directives case insensitive and less whitespace
sensitive.

* Add "incorrect 3-slash" error to fourslash parsing.
2019-08-26 10:42:17 -07:00
Andrew Branch b4417da646
Fix fourslash server (#33063) 2019-08-26 08:46:41 -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
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 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
Alexander e79e835fce harness: change const to var 2019-08-10 10:12:51 +03:00
Alexander 23a3b340b0 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-10 09:58:25 +03:00
Orta 2a2866c3a9
Merge pull request #32563 from orta/fix_31298
Handle namepaths inside JSDoc type expressions a bit better
2019-08-09 16:15:50 -07:00
Sheetal Nandi fd515b519e Handle status and error messages for better checking 2019-08-09 13:38:25 -07:00
Sheetal Nandi d9ad559042 Verify demo build 2019-08-09 13:38:24 -07:00
Alexander 023e4c6249 disable no-redeclare 2019-08-09 07:30:40 +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
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
Orta Therox 487e2ffe2a Merge master 2019-08-06 15:34:06 -04: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
Alexander a292ae1789 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-04 15:35:41 +03:00
Andrew Branch 62f65a7884
Make auto-imports more likely to be valid for the file (including JS) & project settings (#32684)
* Add failing tests

* Use default import or namespace import for import fixes when compiler options allow

* Don’t do import * for export=, ever

* Only do import default for export equals if nothing else will work

* Never do import/require in a JavaScript file

* Update tests for changes in master

* Add const/require fix for JS and select based on usage heuristic

* Fix JS UMD import
2019-08-02 15:58:10 -07:00
Sheetal Nandi bf903eb48f
Merge pull request #32613 from microsoft/singleHostFsWatchFile
Create only single StatFileWatcher through node
2019-08-02 11:03:28 -07:00
Orta 4a26271b63
Merge pull request #32663 from orta/fix_31195
Ensure that the comma is removed when all named imports are removed via moveToFile
2019-08-02 10:29:51 -04:00
Wesley Wigham 00a75c4283
Retarget to es6 and fix the resulting bugs (#32221)
* Retarget to es6 and fix the resulting bugs

* Set target back to es5

* Fix typos in declaration emitter
2019-08-01 14:23:57 -07:00
Orta Therox c337f046fb Ensure that the comma is removed when all named imports are removed via moveToFile - fixes #31195 2019-08-01 15:01:52 -04: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
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 1b4dfbc7d6 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-29 18:39:29 +03:00
Orta Therox 30aad9db8d Support more terminators for parsing jsdoc filepaths 2019-07-29 09:46:42 -04:00
Wesley Wigham 2a4930f4ec
Bind a jsdoc enum as SymbolFlags.TypeAlias and not SymbolFlags.Enum (#32520)
* Bind a jsdoc enum as SymbolFlags.TypeAlias and not SymbolFlags.Enum

* Actually include an @enum tag as a declaration

* Add enum tag refs into a couple more syntax kind lists

* accept symbol baseline update
2019-07-26 13:57:22 -07:00
Sheetal Nandi 666c4be844 Merge branch 'master' into referencesPrototypeSourceFile 2019-07-25 14:03:48 -07:00
Alexander 0059763d8f move eslint rules from eslint-plugin-microsoft-typescript to scripts/eslint 2019-07-24 13:31:17 +03:00
Alexander T 40f2f77358 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-22 13:50:43 +03:00
Nathan Shively-Sanders e543d8bc5a
Fix type keyword completions (#32474)
* Fix type keyword completions

1. In functions, type keywords were omitted.
2. In All context, no keywords were omitted.

(1) fixes #28737
(2) removes 17 keywords that should not be suggested, even at the
toplevel of a typescript file:

* private
* protected
* public
* static
* abstract
* as
* constructor
* get
* infer
* is
* namespace
* require
* set
* type
* from
* global
* of

I don't know whether we have a bug tracking this or not.

* Change keyword filter in filterGlobalCompletion

Instead of changing FunctionLikeBodyKeywords

* Add more tests cases

* Make type-only completions after < more common

Because isPossiblyTypeArgumentPosition doesn't give false positives now
that it uses type information.
2019-07-19 15:22:04 -07: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
Andrew Branch 387c917765
Revert "Proposal: If there’s a package.json, only auto-import things in it, more or less (#31893)" (#32448)
This reverts commit 60a1b1dc1a.
2019-07-17 14:02:18 -07:00
Orta 10f306350b
Merge pull request #32421 from orta/improve_mulitline_exceptions
Make it easier to read multi-line exceptions
2019-07-16 14:55:09 -04:00
Sheetal Nandi dc38aceb02 Fix the export on TestServerHostCreationParameters to fix build break after LKG
Its not detected currently is because LKG doesnt have #32156
2019-07-16 11:38:09 -07:00
Orta Therox d3f3c8e113 Make it easier to read multi-line exceptions 2019-07-16 12:00:22 -04:00
Dmitrijs Minajevs 7608dc2306 Merge branch 'master' into fix29666 2019-07-16 10:52:26 +03:00
Dmitrijs Minajevs 9a37ef8667 typeAssertionKeywords tests 2019-07-16 10:04:14 +03:00
Alexander T 64baa804a8 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-15 18:35:34 +03:00
Andrew Branch 60a1b1dc1a
Proposal: If there’s a package.json, only auto-import things in it, more or less (#31893)
* 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
2019-07-12 10:08:55 -07:00
Andrew Branch 71bec5b698
Add quick fix to add missing 'await' (#32356)
* Start prototyping addMissingAwait codefix

* Filter by diagnostics that have missing-await related info

* Start writing tests and checking precedence

* Implement codeFixAll, add test for binary expressions

* Add test for iterables

* Add test for passing argument

* Add test for call/construct signatures

* Add test for awaiting initializer

* Improve assertion error

* Replace specific property access error with general one and add await related info

* Add test for property access

* Require code to be inside a function body to offer await

* Accept suggestion

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

* Add explicit test for code fix being not available unless something is a Promise

* Skip looking for function body if already in AwaitContext flags

* Inline getCodeActions function for symmetry
2019-07-12 10:07:55 -07:00
Dmitrijs Minajevs 1d93b76b3f Added "readonly" to Type Keywords 2019-07-12 14:04:19 +03:00
Sheetal Nandi 103fe5fbc5 Merge branch 'master' into referencesPrototypeSourceFile
Uptodate to 3.6.0-dev.20190711
2019-07-11 12:05:36 -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
Nathan Shively-Sanders 834a476a96 Merge branch 'master' into report-multiple-overload-errors 2019-07-08 09:33:24 -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 b5737fc535 Refactor tests so its easy to edit and reason about them 2019-07-03 12:15:24 -07:00
Nathan Shively-Sanders e62d84cd88 Merge branch 'master' into report-multiple-overload-errors 2019-07-03 09:28:44 -07:00