Commit Graph

3730 Commits

Author SHA1 Message Date
Alexander T
c75af697af fix(29890): wrap variable/method/property to jsx expression 2020-06-28 10:51:11 +03:00
Andrew Branch
3d22a4fd72 Preserve newlines between try/catch/finally, if/else, do/while (#39280)
* Preserve newlines between try/catch, if/else, do/while

* Update baselines
2020-06-26 14:48:19 -07:00
Alexander T
95690c0aca fix(38840): omit completions for a spread like argument in a function definition (#38897) 2020-06-26 09:38:05 -07:00
Alexander T
59f80970d9 fix(38785): include in NavigationBar child items from default exported functions (#38915) 2020-06-26 09:35:27 -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
Ron Buckton
fe33e61823 Reparse top level 'await' in modules (#39084)
* Reparse top-level 'await' in modules

* Add more tests and additional diagnostics

* One more incremental parse test
2020-06-18 23:43:18 -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
Jacob Bandes-Storch
8136047a3d Code fix for accidental calls to get-accessors (#38749)
* add code fix

* fix forEachChild and update some baselines

* excluding them from forEachChild is easier!

* cleanup

* review feedback

* fix whitespace
2020-06-18 13:58:42 -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
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
Nathan Shively-Sanders
d841971347 Merge pull request #38358 from a-tarasyuk/bug/38081
fix(38081): 'Debug Failure. Invalid cast.' for convert import quick fix
2020-06-09 08:50:56 -07:00
Eli Barzilay
a4c14a2cdc getSymbolDisplayPartsDocumentationAndSymbolKind: use actual symbol.flags for getAliasedSymbol
Fixes #35347.
2020-06-04 13:50:33 -04:00
Jesse Trinity
3b15b35b37 Merge pull request #38378 from jessetrinity/refactorTriggerReason
Add RefactorTriggerReason
2020-06-03 11:18:08 -07:00
Eli Barzilay
073fb308bf Fix two tests
* `docCommentTemplateInSingleLineComment`: Accidentally dropped space, fixes #38651

* `codeFixCorrectReturnValue13`: Bogus test code copied
2020-06-03 12:59:16 -04:00
Jesse Trinity
d88ea4e1f8 address PR comments 2020-06-02 19:06:12 -07:00
Jesse Trinity
463f8e10b9 Merge pull request #38734 from a-tarasyuk/bug/34934
fix(34934): Completions for private members appear in JavaScript files
2020-06-02 12:47:17 -07:00
Alexander T
bc502c8c3c fix(38081): allow transforming object binding to named imports 2020-06-02 11:23:56 +03:00
Jesse Trinity
52dad733db Merge branch 'master' into m-lambda-to-fn 2020-06-01 13:53:19 -07:00
Jack Works
8e290e5aae Improve error range for ts2657 (jsx expr must have parent element), add code fix for it (#37917)
* fix: range of ts2657 (jsx expr must have parent) and remove 2695 (LHS expr of comma has no side effects)

* feat: add code fix for 2657

* fix: resolve review

* chore: hoist a var

* chore: add test for skipTrivia

* fix: rebase error

* Update src/compiler/diagnosticMessages.json

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>

* Update src/services/codefixes/wrapJsxInFragment.ts

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>

Co-authored-by: Andrew Branch <andrew@wheream.io>
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2020-06-01 12:22:44 -07:00
Alexander T
4f0b81d415 fix(32341): add prefix name for module exports properties (#38541) 2020-06-01 11:45:05 -07:00
Alexander T
fa49ac0b78 fix(19385): add space after brace in the multiline string template (#38742) 2020-06-01 10:30:52 -07:00
Alexander T
68d2ee055c fix(38815): dive in arrow functions to check only this usage instead of checking all statements (#38865) 2020-06-01 10:27:11 -07:00
Jesse Trinity
a86a2fa703 polish tests 2020-05-29 13:03:14 -07:00
Jesse Trinity
2db0054444 remove outdated tests 2020-05-29 13:03:11 -07:00
Jesse Trinity
f479279217 convert import trigger reason test 2020-05-29 13:03:08 -07:00
Jesse Trinity
c20908a3e7 convert export trigger reason test 2020-05-29 13:03:01 -07:00
Jesse Trinity
4971c7d546 remove declaration 2020-05-29 13:02:55 -07:00
Jesse Trinity
3e1e61470b Revert "update refactorConvertImport_partialSelection"
This reverts commit e28d8a0895f118321c37016a6dad4751a7c13673.
2020-05-29 13:02:52 -07:00
Jesse Trinity
86122c412f convert get set test 2020-05-29 12:55:52 -07:00
Jesse Trinity
673a86833a update test names 2020-05-29 12:55:48 -07:00
Jesse Trinity
3825d193f6 extract symbol test 2020-05-29 12:55:43 -07:00
Jesse Trinity
df8ff659c5 extract type test 2020-05-29 12:55:39 -07:00
Jesse Trinity
85e0d8b14a add refactorNotAvailableForTriggerReason 2020-05-29 12:55:35 -07:00
Jesse Trinity
dc363f10fc fix some indices 2020-05-29 12:55:32 -07:00
Jesse Trinity
fbf6737ae2 use verify trigger reason for import export 2020-05-29 12:55:28 -07:00
Jesse Trinity
96f210c1c8 arrow function refactor test 2020-05-29 12:55:24 -07:00
Jesse Trinity
f3751fbdf3 change type of RefactorTriggerReason 2020-05-29 12:54:59 -07:00
Jesse Trinity
665e434832 convert import tests 2020-05-29 12:50:18 -07:00
Jesse Trinity
57e856b0b4 convert export tests 2020-05-29 12:50:14 -07:00
Jesse Trinity
c5343f1d4e update refactorConvertImport_partialSelection 2020-05-29 12:46:03 -07:00
Daniel Rosenwasser
6128f30c3b Merge pull request #38821 from a-tarasyuk/bug/23716
fix(23716): signature help of tagged template doesn't show instantiated signature
2020-05-28 17:19:23 -07:00
BigAru
e6dc8f6c69 Merge remote-tracking branch 'upstream/master' into m-lambda-to-fn 2020-05-27 20:33:27 +02:00
Nathan Shively-Sanders
bfa1744586 Merge pull request #37894 from microsoft/always-error-on-property-override-accessor
Always error on property override accessor
2020-05-26 10:37:07 -07:00
Alexander T
6e98431cec fix(23716): show generic type in tagged template expression 2020-05-26 19:16:44 +03:00
Nathan Shively-Sanders
324d292e3d Merge pull request #38415 from Kingwl/navTree-fix
Fix trancked es5 classes after new scope
2020-05-26 09:05:17 -07:00
Nathan Shively-Sanders
e466bb94c1 Fix multi-file usage
1. Follow aliases with getSupers.
2. Make fix in file with superclass, not with the error.
2020-05-22 09:06:05 -07:00
Alexander T
4c278aa33b fix(34934): exclude private properties from Js completion list 2020-05-22 15:11:39 +03:00
Nathan Shively-Sanders
802e87b1eb Merge branch 'master' into always-error-on-property-override-accessor 2020-05-21 16:08:09 -07:00
Daniel Rosenwasser
62675a58d6 Merge pull request #38481 from a-tarasyuk/bug/38463
fix(38463): No indexed access completions after Record<...>
2020-05-21 13:44:44 -07:00