Commit graph

1209 commits

Author SHA1 Message Date
Sheetal Nandi 2cc67ec0a6
If there are no open files, do not schedule ensureProjectForOpenFiles (#41537) 2020-11-18 16:10:11 -08:00
Ron Buckton 54e54f4f19 Fix definition of ts.Iterator 2020-11-11 18:42:12 -08:00
Wesley Wigham 2c7c62d7fa
Merge branch 'master' into fix-incremental-jsx-crash 2020-11-11 13:00:47 -08:00
Christopher Hiller 40adb27799
dispose Mocha Runner after use to avoid MaxlistenersExceededWarning (#41403)
* dispose Mocha Runner after use to avoid MaxlistenersExceededWarning

- removed manual `unhandledRejection` listener as Mocha v8.2.0 now has one

* Remove ts-ignore comment and commented out line.

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-11-11 10:38:43 -08:00
Wesley Wigham dc7d997e4a
Fix crash on attempting to suggest a ts import for a synthetic js resolution 2020-11-09 14:05:17 -08:00
Sheetal Nandi 76cf8fd78b
Add way to exclude files and directories to watch (#39243)
* Parse excludeDirectories and excludeFiles

* Use watch factory in typings installer

* Some refactoring for watchFactory

* Create Noop watcher if file or directory being watched is excluded

* Baselines without using exclude watch options

* Baselines including exclude option

* Handle exclude options in the system watches

* Add test without exclude option for recursive directory watching

* Test baselines with exclude option

* Always set sysLog

* Test for exclude option in server

* Add exclude options in the config file and fix the test

* Fix host configuration for server

* Handle host configuration for watch options

* Fix sysLog time log so baselines can be clean

* Handle reloadProjects to reload the project from scratch

* Ensure that file updates are reflected

* Feedback

* Feedback
2020-11-04 13:30:06 -08:00
Oleksandr T ad70313141
fix(39858): generate valid async/await code for imported functions (#40154) 2020-11-02 16:12:08 -08:00
Oleksandr T 5d81b17d02
fix(40042): add modifiers in correct position for decorated methods (#40050) 2020-11-02 15:52:57 -08:00
Wesley Wigham 816af71d58
Fix incremental emit issue where dependency relations implied by synthesized imports would not be detected (#41346)
* Fix incremental emit issue where dependency relations implies by synthesized imports would not be detected

* Update src/compiler/program.ts

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-11-01 16:05:49 -08:00
Wesley Wigham 479105090d
Merge pull request #41330 from weswigham/jsx-import-source-as-auto-import
Auto-include types for the jsx import source in the new jsx transforms
2020-10-30 16:51:04 -07:00
Wesley Wigham 8493ee8824
Add mroe incremental-affecting affixes to compiler options, add incremental test for changing jsxImportSource 2020-10-30 16:01:27 -07:00
Ron Buckton bcbe1d7638
Merge pull request #41094 from microsoft/destructuringEvaluationOrder
Fix destructuring evaluation order for initializers
2020-10-29 17:12:18 -07:00
Jesse Trinity b27d4bf3f6
noop in setTypeAcquisiton for undefined (#41291)
* noop in setTypeAcquisiton for undefined

* accept new baseline

* add regression test
2020-10-29 13:30:42 -07:00
Sheetal Nandi 6bde4b5c02
Fix missing file name of extended source file in synchronizeProjectList when it is missing on disk (#41222)
Fixes #40136
2020-10-29 12:18:43 -07:00
Ron Buckton db6f66cc4e
Merge pull request #40593 from microsoft/nativePerformanceHooks
Migrate 'ts.performance' to use native performance hooks when available
2020-10-23 17:32:55 -07:00
Ron Buckton 8ed645ae1a
Don't emit duplicate triple-slash directives when using API to print a .d.ts (#40968) 2020-10-23 16:31:58 -07:00
Ron Buckton 0b303ff08a Fix some rest cases and handling of unused results 2020-10-22 18:58:21 -07:00
Ron Buckton 28c4f32ddf Merge branch 'master' into destructuringEvaluationOrder 2020-10-22 17:14:23 -07:00
Ron Buckton c5800d1928 Remove shims, workaround for bug in peformance.measure 2020-10-22 13:52:10 -07:00
Sheetal Nandi 15cec9d1f7
Optimizes project loading in few scenarios (#41126)
* Some refactoring of forEachResolvedProjectReference

* More refactoring

* Test before the change

* When loading project tree, load projects that directly or indirectly reference the projects we are looking for

* Optimize finding project in solution scenario by directly finding possible default project through projectReferenceRedirect
This helps in avoiding loading indirect projects when solution indirectly referenced default project
2020-10-19 12:59:59 -07:00
Jesse Trinity 08e4f369fb
Add editor configurable filename-based ATA (#40952)
* add typeAcquisition:inferTypings

* remove unused property

* handle inferred and external projects separately

* update missed rename

* fix tests

* pass as external compilerOption

* update test

* remove hostConfig reference

* change option name

* remove extraneous property

* add inferredProjectCompilerOptions
2020-10-19 09:53:58 -07:00
Ron Buckton c52e3b29e7 Add unit tests for PerformanceHooks shim 2020-10-15 19:10:51 -04:00
Ron Buckton a197beef6d Migrate 'ts.performance' to use native performance hooks when available 2020-10-15 19:10:50 -04:00
Ron Buckton 7393dba6bd Fix destructuring evaluation order for initializers 2020-10-13 17:14:35 -07:00
Sheetal Nandi a4b9bbae90
Handle noEmit and noEmitOnError with SemanticDiagnosticsBuilder (#40880)
* Add test that fails

* Handle noEmit on semantic builder's emit as well

* Add test for tsbuildinfo text verification

* Fix noEmit handling for tsbuildinfo emit with SemanticDiagnosticBuilder

* Add test for noEmitOnError with SemanticDiagnosticsBuilder

* Fix tsbuildinfo emit with SemanticDiagnosticsBuilder on noEmitOnError

* Update src/compiler/builder.ts

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

* Update src/compiler/builder.ts

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-10-09 17:25:04 -07:00
Sheetal Nandi e6d525c5cb
Structure is reused should be on new program instead of old program (#41005) 2020-10-09 15:56:51 -07:00
Sheetal Nandi 876e44bbc6
Handle extra file extensions when wild card directory watch is invoked (#41018)
Fixes #40495
2020-10-09 14:07:55 -07:00
Ron Buckton 14714bbace Don't emit duplicate triple-slash directives when using API to print a .d.ts 2020-10-06 15:02:41 -07:00
Sheetal Nandi d94b8e42a6
Fixes calculating resolved project reference to redirect for module resolution (#40954)
* Add test for #38711

* Fixes calculating resolved project reference to redirect for module resolution
Fixes #38711

* Update src/compiler/program.ts
2020-10-06 11:23:05 -07:00
Sheetal Nandi fb2f3d4fd4
Do not create packagejson imports and auto import provider in partial semantic server mode (#40890) 2020-10-02 10:59:04 -07:00
Andrew Branch dc8952d308
jsx option affects emit (#40775) 2020-09-25 12:20:29 -07:00
Andrew Branch 3b9eb1ebe9
Fix premature closing of AutoImportProviderProject for unbuilt monorepos (#40620)
* Fix premature closing of AutoImportProviderProject for unbuilt monorepos

* Update src/server/project.ts

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Update API baseline

* Don’t override hasRoots

* Update API baselines

* Really actually update baselines

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-09-24 10:05:07 -07:00
Alex T c5a28fcdec
fix(39589): add await before return promise expression (#39649) 2020-09-22 15:34:56 -07:00
Alex T d7cd405bb2
feat(14751): show static members at the top of the list for a class like completion (#40428) 2020-09-11 14:48:24 -07:00
Andrew Branch 9c8d11b5ed
Allow 'paths' without 'baseUrl' (#40101)
* Allow paths without baseUrl

* Remove exception for leading * paths

* Add comment, remove commented code

* Update baselines

* Remove unnecessary default

* Fix test harness

* Fix baseline

* Resolve relative to host.getCurrentDirectory() with createProgram API
2020-09-11 12:58:40 -07:00
Orta Therox aa2756a5d7
Updates Dom lib with TSJS changes, adding a new library for webworker iterable (#40500)
* Updates Dom lib with TSJS changes, adding a new library for webworker iterable

Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>

* Fixes tests

Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>
2020-09-11 15:36:00 -04:00
Wesley Wigham a36f17c1f8
Add emit support for jsx/jsxs experimental jsx runtime api (#39199) 2020-09-11 10:44:52 -07:00
Jack Moore 4a3b195772
Add lib es2020.sharedmemory (#39541) 2020-09-11 11:34:01 -04:00
Orta Therox cdafb7157b
Replaces the default module index resolver with '/index' instead of '' when handling internal routing for dts bundles (#39277)
* Adds support for declaring the bundled name of a dts module export

Co-authored-by: Wesley Wigham <wwigham@gmail.com>

* Adds baselines

* Update the tests

* Try to reduce the scope of the bundledPackageName error

* Use the flag in more baselines

* Get it green

* More tests

* Handle more feedback

* More test cleanup

* Set the moduleResolution for the tsconfigs

Co-authored-by: Wesley Wigham <wwigham@gmail.com>
2020-09-11 08:12:07 -04:00
Wenlu Wang ee5f51bc0f
Add see tag support (#39760)
* Add see tag parser

* add baseline

* fix symbol resolve

* add more case

* fix unittests

* improve tests and parser

* accept baseline

* Adopt package-lock.json and npm ci

* Add a workflow to update package-lock.json daily

* Git ignore package-lock.json and forcibly update in workflow

* Update bot email address

* Delete extra npm update

* Update package-lock.json

* Add compactDisplay and signDisplay to NumberFormatOptions (#40039)

* Fix typo in (Readonly)Set.keys comment (fixes #40164) (#40176)

* fix(26325): use a unique name for reserved words in 'constructor like' function name (#39684)

* fix(25770): add diagnostic message for the possible mapped type used as an index (#39973)

* fix(31046): add new diagnostic message for incompatible constructor signature (#40073)

* Update package-lock.json

* Update package-lock.json

* Add rename support

* Accpet baseline

* wip

* fix anders

* Revert "fix anders"

This reverts commit b3178d4618.

* Fix call hierarchy item serialization and server tests (#40348)

* Avoid error

* accept baseline

* Add more tests

* Add signature name resolve

Co-authored-by: Andrew Casey <andrew.casey@microsoft.com>
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
Co-authored-by: Neil Kistner <neil.kistner@gmail.com>
Co-authored-by: cherryblossom000 <31467609+cherryblossom000@users.noreply.github.com>
Co-authored-by: Alexander T <alexander.tarasyuk@outlook.com>
Co-authored-by: Erich Gamma <egamma@microsoft.com>
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2020-09-09 10:45:09 -07:00
Alex T 6101fbca39
fix(40150): use parameter name for a Promise callback function (#40191) 2020-09-08 13:44:38 -07:00
Andrew Branch f6f2d36ee3
Add optionalReplacementSpan to completions response (#40347)
* Add optionalReplacementRange to completions response

* Get the name right

* Fix unit tests

* Fix comment typo

* Fix comment typo

* Baseline
2020-09-04 13:09:52 -07:00
Andrew Branch 8ffb7f083d
Reprioritize cross-project module specifier suggestions for auto-import (#40253)
* Add test

* Suggest `paths` module specifiers even when a node_modules path was available

* Fix some tests

* Fix remaining tests

* Add comments
2020-09-03 14:00:06 -07:00
Nathan Shively-Sanders 6fea7ff536
Add unit tests for VersionRange (#40114)
* Add unit tests for VersionRange

Make it easier to understand the intended semantics next time I have to
read this code.

* I miss prettier
2020-08-18 13:06:17 -07:00
Daniel Rosenwasser 97a072926f
Revert "Add '(approximate)' to the beginning of quick info requests in PartialSemantic mode (#40061)" (#40072)
This reverts commit 2426eb4980.
2020-08-17 11:45:39 -07:00
Daniel Rosenwasser 2426eb4980
Add '(approximate)' to the beginning of quick info requests in PartialSemantic mode (#40061)
* Add '(approximate)' to the beginning of quick info requests.

* Use 'approximation' instead of 'approximate'.
2020-08-14 17:54:10 -07:00
Sheetal Nandi c95cffe111
Ensure file, include and exclude specs used are strings (#40041)
* Test displaying failure when specs used are not strings

* Ensure specs used are strings
Fixes #38164, #39856

* Feedback
2020-08-13 17:08:20 -07:00
Sheetal Nandi 03d946d145
Revert to including only open files in partial semantic server mode (#40026) 2020-08-12 20:45:59 -07:00
Alexander T 1f5caf554c
fix(13503): fix crash on calling getTypeAtLocation with the SourceFile nodes (#39994) 2020-08-12 00:11:25 -07:00
Andrew Branch 87a3b42d72
Handle empty package.json files (#39937) 2020-08-06 11:04:21 -07:00
Sheetal Nandi da5ff57608
Renames in servermode per feedback (#39883)
* Server mode renames as per feedback

* More renames
2020-08-05 12:19:15 -07:00
Sheetal Nandi bcccae2fd4
Handle the fact that noResolveResolution resolution is reused (#39889)
Fixes #39795
2020-08-04 13:33:27 -07:00
Sheetal Nandi aee78acedb
Add separate flag serverMode for server mode (#39735)
* Add separate flag serverMode for server mode to allow back compatibility

* Addressed code review feedback.

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-08-02 18:18:26 -07:00
Andrew Branch 86a87c493c
Limit auto import provider project size (#39855)
* Limit auto import provider project size

* Add test

* Make option configurable

* Fix test

* Only bail when setting is auto

* Fix other test

* Update API baseline
2020-08-02 17:47:49 -07:00
mshivaku99 bffe3540fa
Issue35876: Give better error message when Classic Module Resolution with incorrect path (#38105)
* added Error 5084 to diagnosticMessages.json

* added test case errorForBareSpecifierWithImplicitModuleResolution1 to tests/cases/compiler

* modified checker.ts to report error 5084 when classic resolution and incorrect path are used

* added baseline changes

* passes all test cases including src/testRunner/unittests/ tests

* Update with feedback

* Make it check whether it is the right module resolution kind

* Use the right diagnostic message in tsserver tests

Co-authored-by: Meera Shivakumar <mshivaku@umich.edu>
Co-authored-by: Orta <git@orta.io>
2020-07-30 13:45:29 -04:00
Sheetal Nandi 823b69acb3
Fixes slow nav to issue by keeping project with result. (#39721)
Also cache the result of config file name for open files
Fixes #38491
2020-07-24 13:33:25 -07:00
Sheetal Nandi 34adaaf6aa
Support loading of child project if found project is not pure solution has some of its own files and project references (#39613)
* Use disableReferencedProjectLoad to stop loading child projects to allow users to disable loading large solutions
Fixes #39144

* Handle indirect references

* Support loading of child project if found project is not pure solution has some of its own files and project references
Fixes #38605

* Fix grammar
2020-07-21 15:02:10 -07:00
Sheetal Nandi e92afacc44
Add disableReferencedProjectLoad to stop loading child projects to allow users to disable loading large solutions (#39593)
* Use disableReferencedProjectLoad to stop loading child projects to allow users to disable loading large solutions
Fixes #39144

* Handle indirect references

* PR feedback
2020-07-21 14:24:15 -07:00
Sheetal Nandi 3b22339df8
Triple slash references must resolve against the resolved file name (.d.ts and not original source file) since they are rewritten in the .d.ts emit (#39645)
* Add tests corresponding to repro from #37928

* Triple slash references must resolve against the resolved file name (.d.ts and not original source file) since they are rewritten in the .d.ts emit

* Remove the scenario not fixed in this PR
2020-07-17 16:25:32 -07:00
Sheetal Nandi 667ba74c93
Resolve only relative references in open files on syntax server (#39476)
* Resolve only relative references in open files on syntax server

* Support resolving tripleslash references only in the open file

* Apply suggestions from code review

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-07-16 14:31:24 -07:00
Alexander T c07c885151
fix(39515): fix getting a position for an element before the line break CRLF/LF on the line that contains 'after' element (#39554) 2020-07-16 13:56:30 -07:00
Andrew Branch 98ab3a788f
Fix tsc --watch crash on module augmentations when module resolution changes (#39604)
* Add failing test

* Ensure source files are bound before analyzing them
2020-07-14 15:05:10 -07:00
Armando Aguirre 635ee24a3c Merge remote-tracking branch 'upstream/master' into AddToggleCommentFeature 2020-07-13 16:58:19 -07:00
Ron Buckton 5ad8532a11 Merge branch 'master' into fix37113
# Conflicts:
#	src/compiler/transformers/module/module.ts
2020-07-13 11:13:35 -07:00
Ron Buckton 2c08affa0d
Merge pull request #39264 from microsoft/migrateMapsAndSets
Migrate maps and sets
2020-07-13 10:38:30 -07:00
Alexander T 31f75fed09
fix(types/mocha): change deprecated Mocha types (#39573) 2020-07-12 21:21:07 -07:00
Armando Aguirre ef81a0d0ee Merge remote-tracking branch 'upstream/master' into AddToggleCommentFeature 2020-07-09 21:55:36 -07:00
Armando Aguirre 55a1b50e7a Revert "Removed public commands"
This reverts commit 40751ba89b.
2020-07-09 15:55:51 -07:00
Ron Buckton 5c5f180f8e Fix namespace import/export helper usage 2020-07-07 17:36:59 -07:00
Andrew Branch 2d6d5db33a
Fix getTypeAtLocation for dotted implements clauses (#39363)
* Fix getTypeAtLocation for dotted implements clauses

* Fix typo
2020-07-07 16:17:07 -07:00
Ron Buckton 1359dbd6ca Merge branch 'master' into migrateMapsAndSets 2020-07-07 15:14:00 -07:00
Sheetal Nandi c08c059dae
Dont include auto type reference directives (#39472) 2020-07-07 13:58:53 -07:00
Ron Buckton 9d5cd280ef Merge branch 'master' into migrateMapsAndSets
# Conflicts:
#	src/compiler/checker.ts
#	src/compiler/commandLineParser.ts
#	src/compiler/core.ts
#	src/compiler/moduleNameResolver.ts
#	src/compiler/transformers/declarations.ts
#	src/compiler/tsbuildPublic.ts
#	src/compiler/types.ts
#	src/compiler/utilities.ts
#	src/harness/client.ts
#	src/server/editorServices.ts
#	src/server/typingsCache.ts
#	src/server/utilities.ts
#	src/services/codefixes/convertToAsyncFunction.ts
#	src/services/documentRegistry.ts
#	src/services/importTracker.ts
#	src/services/refactorProvider.ts
#	src/services/refactors/extractSymbol.ts
#	src/testRunner/unittests/programApi.ts
#	src/typingsInstallerCore/typingsInstaller.ts
#	tests/baselines/reference/api/tsserverlibrary.d.ts
#	tests/baselines/reference/api/typescript.d.ts
2020-07-07 13:53:46 -07:00
Michael Hensler 2d09da6df5
allow consecutive newlines in jsdoc tag comments (#38036) 2020-07-02 14:19:37 -07:00
Ron Buckton 7b942b4fa8
Revert the type change to ts.Map (#39366) 2020-07-01 17:00:26 -07:00
Nathan Shively-Sanders 0f9d4c78d4
JSDoc uses same newlines as normal scanner (#39351)
* JSDoc uses same newlines as normal scanner

Previously, scanJsDocToken treated each newline character separately, so
the sequence \r\n would be treated as two lines. This is unexpected, and
not the way the normal scanner does it.

This change makes the jsdoc scanner behave the same as the normal
scanner.

* fix lint in test
2020-06-30 15:16:45 -07:00
Ron Buckton 611b77f2e6 Migrate more places to use Map/Set 2020-06-26 10:15:53 -07:00
Ron Buckton eb2f4e2337
Switch to ES Map/Set internally (#33771)
* Add full implemention of Map and Set to shims

* Update default Map interface

* Remove WeakMap/WeakSet

* Add tests for set shim

* Update most usages of Map<K, true> to Set

* PR Feedback

* Fix lint issues

* Change key in fsWatchCallback

* Simpler shim, more tests

* Fix typo in collection shim
2020-06-26 10:12:47 -07:00
Ron Buckton cc7cb9eadb
Upgrade typescript-eslint version (#39242)
* Upgrade typescript-eslint version

* Update TS version used by typescript-eslint
2020-06-24 16:43:03 -07:00
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
Sheetal Nandi b977f86abd
Allows emitting buildInfo when --noEmit is specified (#39122)
* Some tests

* Allow noEmit with incremental and composite
Fixes #38440
2020-06-18 11:05:37 -07:00
Noj Vek f697d26ca1
reset soft with master for single commit (#38720) 2020-06-18 00:22:32 -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
Sheetal Nandi 4105d32b7e
Fix crash in reporting unresolved project reference as part of compilerOptions verification (#39095)
* Fix crash in reporting unresolved project reference as part of compilerOptions verification
Fixes #38143

* Fix typo
2020-06-17 11:20:02 -07: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
Sheetal Nandi 0232d4ae8e
Fixes issues with reload because of output emit (#39030)
* If there is no changes to folder structure when watching directories recursively, send the updates to fileNames only
Fixes #37994

* Ignore excluded directories from wild card watching

* Testcase showing that renaming file with non sync directory watcher displays correct error in the end
Testcase for #38684
2020-06-16 16:39:48 -07:00
Sheetal Nandi 25f6232d45
Syntax only server creates inferred project with all the open files w… (#38561)
* Syntax only server creates inferred project with all the open files with noResolve and can handle semantic operations

* No Watching

* Disable tests

* Add and fix tests

* Only support selected commands

* Revert "Disable tests"

This reverts commit 90d8a966eb.

* Dont log request details for unsupported commands
2020-06-16 13:39:20 -07:00
Sheetal Nandi f628bf8e24
Fix casing for wild card keys for implicit globs to get wild card directories to watch (#39049)
* Test showing how wild card directory is not watched because of mismatch in key case

* Fix casing for wild card keys for implicit globs
Fixes #36532
2020-06-12 14:21:51 -07:00
Wesley Wigham 58330d05a1
Patch to use this.timeout() > 0 rather than this.enableTimeout() to work with mocha 8+ 2020-06-10 14:26:22 -07:00
Daniel Rosenwasser e832e04fa7
Merge pull request #37727 from Kingwl/logical_assignment
Add logical assignment operator
2020-06-09 14:44:08 -07:00
Sheetal Nandi a72ed0a2f5
Schedule failed lookup updates (#38560)
* Schedule failed lookup updates

* Tests
2020-06-09 12:00:37 -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 9fbcb99a33
Emit build info even on noEmitOnError or tsc --build (#38853)
* Emit buildinfo when there are errors with noEmitOnError?
TODO: --build mode

* Always emit tsbuild info even if there are non syntax errors in tsc --build mode

* Sort affectedFilesPendingEmit for consistent build info text
2020-06-02 12:38:40 -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 e565931392 fix up some bools 2020-05-29 13:01:33 -07:00
Jesse Trinity 23f4dc9bd9 use enum for RefactorTriggerReason 2020-05-29 12:49:41 -07:00
Armando Aguirre 40751ba89b Removed public commands 2020-05-22 21:50:34 -07:00
Armando Aguirre ee37d8e8d3 Added comment and uncomment selection 2020-05-22 16:56:57 -07:00
Armando Aguirre 33333e86eb Added toggleLineComment, toggleMultilineComment with jsx and tests 2020-05-22 16:46:31 -07:00
Daniel 8cf2466110 Merge remote-tracking branch 'origin/master' into literal-to-primitive-relation-reporting 2020-05-22 00:09:52 +00:00
Wesley Wigham 59d0ceef5e
Fix recently added test so it is cross-plat 2020-05-21 11:45:23 -07:00
Dmitry Makhnev dbaeed5ad8
Add d.ts for Intl.RelativeTimeFormat (#36084)
* feat(lib/es2020.intl): Add `Intl.RelativeTimeFormat` (part of #29129);

* fix(lib/es2020.intl): fix for tests and linters `Intl.RelativeTimeFormat` (part of #29129);

* feat(lib/es2020.intl): Add TSDoc for `Intl.RelativeTimeFormat` by review request https://github.com/microsoft/TypeScript/pull/36084#issuecomment-584769420;

* fix(lib/es2020.intl): Fix for tests;

Co-authored-by: Dmitry Makhnev <dmitriy.makhnev@jugru.org>
2020-05-20 11:06:28 -04:00
kingwl b59e4c51ae Merge branch 'master' into logical_assignment 2020-05-20 10:18:20 +08:00
Wesley Wigham 5f597e69b2
Support naming tuple members (#38234)
* Initial draft of named tuple members

* Show tuple labels and documentation in completions

* Swap allowed syntax to parameter-like

* Add quickfix for labeled tuple syntax mistakes

* Add refactoring to convert list of signatures to single overload

* Fix small bug in visitor verification

* Signature help for rest parameters which are unions of tuples are displayed as seperate entries now

* Expand sanity check test cases in conformance suite

* Add tests and code for preserving tuple names through spreads where possible

* More refactoring tests, some comment preservation and some fixed formatting of multiline tuples

* Handle missing parameter named in isValidDeclarationForTupleLabel

* Minor text fixes
2020-05-19 15:54:02 -07:00
Daniel Rosenwasser 46f100f8ac
Merge pull request #38500 from a-tarasyuk/bug/38485
regression(38485): Unable to specify `rawText` when programmatically creating tagged template literals
2020-05-19 14:24:25 -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
kingwl 1d93db81cc Add logical assignment operator 2020-05-16 08:09:32 +08:00
Jesse Trinity 1a15717bc4
Fix regression organize imports duplicates comments (#38599)
* delete import comments on organize imports

* add unit test

* accept new baseline

* respond to review comment
2020-05-15 14:25:11 -07:00
Sheetal Nandi 5d6a5d04ea
Fix detecting default project when file is part for more than one project but not part of default configured project (eg because its output of that projet) (#38429)
Fixes #38366
2020-05-12 10:16:59 -07:00
Alexander T ee3f2ce362 regression(38485): allow using rawText property in processing a tagged template 2020-05-12 12:30:46 +03:00
Josh Goldberg be2eb8a2e1
Allowed comment directives to be multiline (#38228)
* Allowed comment directives to be multiline

* Added tests, and perhaps fixed a test runner bug?

* I think it's going to need a consistent variable to loop over

* Used dynamically computed indexes in verifies

* Added multiline tests

* Increased flexibility for multiline comment parsing

* Undid a couple of formatting changes; removed backslashes from multiline regexp

* Added baseline tests for multiline comment skipping

Co-authored-by: Orta Therox <orta.therox@gmail.com>
2020-05-06 13:09:29 -07:00
Andrew Branch 689822c183
convertToAsyncFunction: Disable for .then with both fulfillment and rejection handlers (#38152)
* Disable convert to async for `.then` with both fulfillment and rejection handlers

* Delete baselines

* Also disable refactor for 3+ arguments
2020-04-24 09:52:18 -07:00
Daniel Rosenwasser d7e437a409
Have the ChangeTracker filter out edits that are no-ops (#38123)
* Filter out edits that are no-ops in 'organize imports'.

* Updated tests for 'organize imports'.

* Always remove no-op changes from the change tracker.

* Add a new `stringContainsAt` helper function to avoid traversing the entire file contents.

* Combine `map`/`filter` sequence into `mapDefined`.

* Fix up documentation.
2020-04-23 12:54:49 -07:00
Nathan Shively-Sanders d571a09cf8
Navto covers all projects (#38027)
* Remove needless structure/destructuring

Just pass multiple arguments! Sheesh!

* Basic working prototype

* Cleaned up version

1. Add test
2. Change protocol. navto-all only happens when filename is undefined or
missing.
3. Change location to earlier code path. This change was largely
type-guided and resulted in some duplicated code, but I think it's less
fault-prone.

* remove temp notes

* Single-project hits if projectFileName is provided

and file is not

* use original code as fallback
2020-04-21 15:20:36 -07:00
Josh Goldberg 1b3c7a28c1 This had better be the last unit test fix... 2020-04-19 21:50:17 -04:00
Josh Goldberg cb19b3d251 Again fixed up manual unit tests 2020-04-19 21:34:05 -04:00
Josh Goldberg 769a2f2cfc Eased up on some of the more aggressive reporting changes 2020-04-19 20:25:24 -04:00
Josh Goldberg af4ea605f2 Fixed a couple of tsserver unit tests 2020-04-19 17:18:02 -04:00
Andrew Branch 2187ba1f84
Fix variable name collisions (#37761) 2020-04-02 15:12:19 -07:00
Sheetal Nandi 0b38a9a2b0
Add support for extraFileExtensions on WatchCompilerHost (#37726)
To support typescript-eslint/typescript-eslint#1813
2020-04-01 11:13:21 -07:00
Sheetal Nandi 7f5994958b
Handle comment directives in incremental parsing (#37632)
* Add test case that shows failure to handle commentDirectives in incremental parsing
Testcase for #37536

* Handle comment directives in incremental parsing
Fixes #37536
2020-03-27 12:00:34 -07:00
Sheetal Nandi 0ae938b718
Report error when cannot read file (#37611)
This also consolidates helper for readFile failure
2020-03-25 21:29:02 -07:00
Sheetal Nandi fd9e602fcf
When the global file is deleted mark all files as changed (#37538)
* Add test case when the errors are not refreshed if global file is deleted
Testcase for #36728

* When the global file is deleted mark all files as changed
Fixes #36728

* Update other baselines to fix file info
2020-03-25 16:26:10 -07:00
Sheetal Nandi 6bd68a83b4
Release the documents from language service using key instead of calculating it on the spot since we want to use correct paths for the files (#37596)
Fixes #37500
2020-03-25 15:51:07 -07:00
Andrew Casey e1772fa40e
Add test for #35011 (#37312)
* Add test for #35011

When searching for a default configured project, stop at
`node_modules`.

* Be more explicit about inferred projects

* Move test into tsserver/projects.ts

* Use existing helpers to simplify tests
2020-03-25 14:48:54 -07:00
Sheetal Nandi b7b2c333a9
Handle if reading tsconfig file fails (#37563)
Fixes #36862
2020-03-25 10:14:31 -07:00
Andrew Branch 37569d01f6
Convert to async function: handle type arguments to then/catch (#37463)
* Handle type arguments to then/catch

* Keep single-line types on a single line
2020-03-24 09:56:47 -07:00
Sheetal Nandi 9f296ce96d
Do not include global errors in semantic errors from the file (#37545)
Fixes #37084
2020-03-24 09:53:27 -07:00
Sheetal Nandi 221a2aeb1b
Handle import type and export type in preprocess (#37508)
Fixes #37338
2020-03-23 10:11:01 -07:00
Sheetal Nandi 8f64d667f2
If emitting declaration file, update the d.ts signature in state to not have to save all files when different file changes without changing its shape (#37483)
* Add test that calling getAffectedFiles on two different files (even if the second one is saved) returns all files

* If emitting declaration file, update the d.ts signature in state to not have to save all files when different file changes without changing its shape
Fixes #30508
2020-03-20 10:16:41 -07:00
Sheetal Nandi 5e9c43607f
Handle auto import scenarios when using project references (#37482)
* Add test for project reference and auto import
Test for #34677

* Add project reference redirect to the possible file name to import if file is source of project reference redirect
Fixes the auto import suggestion when project is built

* Use fileExists that mimics presence of project reference redirect file when trying to get auto import file name
2020-03-19 16:53:44 -07:00
Sheetal Nandi 7e07a2b5d1
Allow rich response for compile on save (#37462)
Fixes #30739
2020-03-19 14:03:21 -07:00
Sheetal Nandi 2df421b067
Always generate configFileDiag if file is going to be added to configured project (#37443)
Fixes #30623
2020-03-18 10:39:25 -07:00
David Sherret 48e1745d6d
Fix Node#getStart(sourceFile, true) throwing when node has a js doc and no parent (#37439)
* Fix missing source file argument.

* Add test

* fix lint

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-03-17 16:08:57 -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 ba39113ab9
Handle when default project for file is solution with file actually referenced by one of the project references (#37239)
* Add test where file from referenced project of solution belongs to inferred project instead of referenced project

* Try to find project from project references if the default config project is solution
Fixes #36708

* Add test to verify the correct collection of projects

* Handle when default config project is indirectly referenced in the solution

* Include public API tests in unittests

* Make sure default project for script info is calculated correctly

* Handle reload projects

* Ensure to load solution project tree when project is referenced by solution

* Find all refs when the file is referenced via d.ts

* Some comments per feedback

* Fix typo
2020-03-13 10:46:58 -07:00
Donald Pipowitch e0f6ecd957
improve error message TS2307 (#27054)
* improve error message TS2307

* add updates missed from merge

* update more missed baselines

* remove incorrectly re-added test files

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-03-12 15:55:54 -07:00
Andrii Dieiev c6cfd66fa8
Support template literals in preProcess (fixes #33680) (#33688) 2020-03-12 15:50:23 -07:00
Sheetal Nandi a76a16696d
Move useSourceOfProjectReferenceRedirect to program so other hosts can use it too, enabling it for WatchHost (#37370) 2020-03-12 13:11:11 -07: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
Sheetal Nandi 1a9c8197ff
Optimize module resolution cache for watch and editor (#37055)
* Refactor resolveName

* Have resolutions of failed lookups as array and resolved to fileName map
2020-03-11 14:35:26 -07:00
Wenlu Wang 20625a964b
add promise.any (#33844)
* add promise.prototype.any

* add AggregateError

* Update src/lib/esnext.promise.d.ts

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

* update baseline again

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-03-11 08:36:00 -07:00
Sheetal Nandi e68524a8d2
Handle WatchCompilerHost without timeout methods to retrieve correct Program (#37308) 2020-03-09 16:30:52 -07:00
Sheetal Nandi 8dede43365
Reset hasChangedAutomaticTypeDirectiveNames once new program is created (#37266)
* Allow passing watch to the change as parameter

* Reset hasChangedAutomaticTypeDirectiveNames once new program is created
Also dont invoke afterProgramCreate if the program is not new
2020-03-06 18:21:16 -08:00
Ben Lichtman 631def81d5
Merge pull request #37260 from uniqueiniquity/watchFileExistsFix
Fix fileExists check for a watch program
2020-03-06 13:01:03 -08:00
Ben Lichtman a4430f7baf Update tests to be more precise 2020-03-06 12:41:00 -08:00
Nathan Shively-Sanders 458977b94b
Reinstate incorrectly removed esnext.bigint (#37233)
* Reinstate incorrectly removed esnext.bigint

From a bad merge I made in #33845

* fix esnext.bigint alias
2020-03-05 10:11:48 -08:00
Nathan Shively-Sanders 0a1af90bb6
add string.prototype.replaceAll (#33845)
* add string.prototype.replaceAll

* accept baseline

* fix bad merge in tests

* update missed baselines

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-03-04 13:25:17 -08:00