Commit Graph
100 Commits
Author SHA1 Message Date
Sheetal Nandi e71e459faf Experiment with module resolution cache be the only one to store resolutions 2023-09-25 14:19:06 -07:00
Sheetal Nandi 934216f968 Support using client watch in tsserver using events (#54662) 2023-09-22 14:25:40 -07:00
Sheetal Nandi c5cd2758fd Use forEachResolvedModule in incremental utils (#55833) 2023-09-22 11:29:31 -07:00
Sheetal Nandi dcb0fa7f44 Incremental testing for program structure and resolutions and fixes (#55814) 2023-09-22 10:53:19 -07:00
Sheetal Nandi 83f02a4b7e Picking resolutions of module for sourceFile as method (#55818) 2023-09-22 10:24:37 -07:00
Sheetal Nandi ec1414f627 Source files not affected by all module resolution options (#55790) 2023-09-20 16:45:32 -07:00
Sheetal Nandi fc418a2e61 Special case "/workspaces" for watching root so that codespaces work correctly (#55738) 2023-09-14 11:34:19 -07:00
Sheetal Nandi 3ade5022d7 Fix file matching with tsx and dts of same name are included by include patterns (#55690) 2023-09-12 13:10:34 -07:00
Sheetal Nandi 3bc41784f0 Fix issue with wildcard with supported extensions when plugins add external files and override getScriptKind to add script kinds for the additional extensions (#55716) 2023-09-12 11:52:49 -07:00
Sheetal Nandi dd18dc1dac If outDir is not specified, dont need to include json files explicitly in the config since they will not be emitted (#55389) 2023-09-08 12:23:13 -07:00
Sheetal Nandi 9261ca7a13 Share redirects cache key calculation between multiple caches used for module resolution and type reference directive (#55376) 2023-08-14 18:46:55 -07:00
Sheetal Nandi cd23992100 Temp fix till we investigate #55069 making project.ts changes building error free (#55219) 2023-07-31 11:24:29 -07:00
Sheetal Nandi 5464403848 ParseConfigHost needs to extend ModuleResolutionHost (#54922) 2023-07-10 11:40:40 -07:00
Sheetal Nandi 3c4c060dff Adds tests and fixes issues by verifying incremental project updates are handling language service ref counting correctly (#54504) 2023-06-06 11:11:14 -07:00
Sheetal Nandi c64a378ef9 Handle already released source files that dont match scriptKind (#54401) 2023-05-25 15:58:22 -07:00
Sheetal Nandi d210074c88 Make sure order of watches in baseline is fixed instead of depending on when it was added (#54313) 2023-05-18 13:01:11 -07:00
Sheetal Nandi d01a1c3081 Fix the sample test which lead to discripancy with incremntal build because of error (#54311) 2023-05-18 12:02:42 -07:00
Sheetal Nandi 8b825f7aaa Handle module node found error reporting in incremental and watch scneario (#54115) 2023-05-09 13:42:26 -07:00
Sheetal Nandi 6afe257571 Remove unnecessary baselines (#54140) 2023-05-05 10:05:27 -07:00
Sheetal Nandi bbb9f2ebcf Just like request and response, events are also logged as formatted json for readability (#54105) 2023-05-02 13:32:12 -07:00
Sheetal Nandi a956bbc831 Instead of watching files in typing installer, forward it to projectService (#54028) 2023-04-26 13:31:36 -07:00
Sheetal Nandi f22898d577 Close TypingInstaller watches on project close (#54025) 2023-04-26 12:34:42 -07:00
Sheetal Nandi 9ac5886715 Add back tests for async plugin that got deleted as part of #51699 (#54019) 2023-04-25 15:30:59 -07:00
Sheetal Nandi 30fb9fa57e Refactor plugin related code (#53942) 2023-04-20 16:49:47 -07:00
Sheetal Nandi ddd5084659 Add resolveLibrary method on hosts and store resolvedLibraries in program so that resolutions can be reused (#53877) 2023-04-20 13:50:22 -07:00
Sheetal Nandi 0a98b32b47 Refactor test helpers (#53918) 2023-04-19 14:46:56 -07:00
Sheetal Nandi bd4f40317c Library resolution should happen from config file directory if present just like auto type reference directive resolution (#53899) 2023-04-18 14:40:20 -07:00
Sheetal Nandi ece33b7b59 Trace lib resolutions if resolving using options.traceResolution (#53898) 2023-04-18 10:56:57 -07:00
Sheetal Nandi b846033000 Instead of clearing out all resolutions and closing all the directory watchers, mark everything as invalidated when changes affect module resolution (#53882) 2023-04-18 10:21:17 -07:00
Sheetal Nandi 9919f6da1d Dont defer non relative type reference directive resolutions watching since we dont need to check ambient module presence to determine whether to watch them (#53875) 2023-04-17 12:37:51 -07:00
Sheetal Nandi 53d378720a When installing unrelated package inside scoped packages dont invalidate resolutions from everything in the scoped package (#53873) 2023-04-17 12:37:32 -07:00
Sheetal Nandi df3bec6674 Tweak module resolution failed lookup watching (#53591) 2023-04-13 14:50:50 -07:00
Sheetal Nandi 537cd60d9a Truncate long files in fourslash baselines around +- n lines (#53769) 2023-04-13 13:35:01 -07:00
Sheetal Nandi 4615e52d93 Update more tests for paths (#53728) 2023-04-10 14:29:43 -07:00
Sheetal Nandi 926c6f1ddb Some of the test updates to ensure that it still tests what it is suppose to after we update watch path logic (#53726) 2023-04-10 13:37:33 -07:00
Sheetal Nandi 85f20246a4 Make the server logs more stable by stubbing time and seq info in the log (#53693) 2023-04-06 16:23:44 -07:00
Sheetal Nandi d07b1b93ab Fix incorrect setting of nonRecursive watch field (#53675) 2023-04-05 14:17:52 -07:00
Sheetal Nandi acb48f192c More directory patterns for testing that we will care about (#53653) 2023-04-03 15:34:37 -07:00
Sheetal Nandi 27d3454f07 Add baselines per root for affected file watching (#53616) 2023-03-31 15:57:19 -07:00
Sheetal Nandi 2eab265a2b Baseline some watch related path determinations so its easy to track changes (#53598) 2023-03-31 15:13:06 -07:00
Sheetal Nandi 0ee51b96dc More baselining for timeouts that make furture changes easier (#53579) 2023-03-30 09:48:34 -07:00
Sheetal Nandi d105b6a994 More baselining for future changes (#53564) 2023-03-29 00:47:37 -07:00
Sheetal Nandi e47e1266dc Add current directory, useCasesensitive file names to each baseline (#53483) 2023-03-23 21:14:22 -07:00
Sheetal Nandi c66f8de7c8 Fix incorrect assert about configFileName when watch is created with explicit options, projectReferences etc (#53468) 2023-03-23 12:40:09 -07:00
Sheetal Nandi 1b745df857 Adding baseline methods for verification of findAllRefs, GoTo*, Occurrences, highlights and rename deprecating the corresponding verification methods from fourslash tests (#52576) 2023-03-22 14:02:18 -07:00
Sheetal Nandi 377c4ce32f Refactor config file syntax search to callback model instead of constructing arrays to iterate over (#53416) 2023-03-21 11:23:36 -07:00
Sheetal Nandi 8814f6da48 Report error if commanline only option is specified in tsconfig (#53397) 2023-03-20 13:26:04 -07:00
Sheetal Nandi 7a8238d88d Refactor config file parsing such that json and jsonSourceFile api use same paths (#53331) 2023-03-20 12:00:08 -07:00
Sheetal Nandi 905a0b4e69 Create baselines for tsserver event tests (#53330) 2023-03-17 16:56:01 -07:00
Sheetal Nandi b1ef5b79f7 Convert config file parsing tests to baseline for easier future update verification and adds missing location verification (#53324) 2023-03-17 12:58:55 -07:00
Sheetal Nandi 46d70d79cd When resolving type reference from custom typeRoot localtion use mangled scope name if the package is scoped name (#53166) 2023-03-10 09:58:41 -08:00
Sheetal Nandi b19cfc03f2 Make getSupportedCodeFixes plugin test such that we dont need to update its baseline for every new error (#53070) 2023-03-02 14:58:13 -08:00
Sheetal Nandi 1da6d87a05 ScriptInfo versioning improvements (#53001) 2023-03-01 15:55:37 -08:00
Sheetal Nandi 8b87de1750 Baseline for watches to only add watch state if there is change and include typing installer baselines into tsserver baselines (#52901) 2023-03-01 14:10:51 -08:00
Sheetal Nandi dcc766f2b2 Remove long deprecated occurrences request (#52347) 2023-03-01 10:59:07 -08:00
Sheetal Nandi 9c5b09cd21 Updates to type reference directive resolution and module resolution when failed (#51715) 2023-03-01 10:57:47 -08:00
Sheetal Nandi 27f20c9fae Defer creation of node typings installer (#52904) 2023-02-22 11:40:48 -08:00
Sheetal Nandi ddadea1732 Make getSupportedCodeFixes plugin test such that we dont need to update its baseline for every new error (#52596) 2023-02-03 13:17:33 -08:00
Sheetal Nandi ab5067bd43 Always respect preserveSymlinks (#51842) 2023-02-02 12:37:35 -08:00
Sheetal Nandi 5a419a2f8f In tsc --b mode detect if root file of compilation is not root any more (#52417) 2023-01-26 16:03:00 -08:00
Sheetal Nandi a097d55f81 Remove long deprecated typingOptions and enableAutoDiscovery (#52339) 2023-01-20 15:39:57 -08:00
Sheetal Nandi e474b3df69 Mark APIs related to prepend option deprecated (#52344) 2023-01-20 15:25:19 -08:00
Sheetal Nandi d76f3612c1 More removals of long deprecated APIs (#52343) 2023-01-20 15:25:06 -08:00
Sheetal Nandi e5515164eb Remove older deprecated APIs (#52338) 2023-01-20 12:55:04 -08:00
Sheetal Nandi 181cf21b68 Deprecate prepend option on project reference (#52312) 2023-01-20 12:10:18 -08:00
Sheetal Nandi 9d7df99414 Fix isExternalLibraryImport for classic resolution (#51840) 2022-12-09 14:44:35 -08:00
Sheetal Nandi 86e0fc92af Fix the test (#51839) 2022-12-09 10:22:49 -08:00
Sheetal Nandi 3716ffe748 Make getSupportedCodeFixes on LS so it can be proxied by plugins (#51769)
Fixes #28966
2022-12-08 09:52:25 -08:00
Sheetal Nandi a77a79fe4b Remove some unnecessary createGetCanonicalFileName by exposing one from program (#51796) 2022-12-07 09:17:52 -08:00
Sheetal Nandi 832a6e45a7 Unify verifyTsc and verifyTscWithEdits and make them look like verifyTscWatch for easy copy paste (#51798)
* Make edits optional in verifyTscWatch

* Unify verifyTsc and verifyTscWithEdits and make them look like verifyTscWatch
2022-12-06 17:18:31 -08:00
Sheetal Nandi e0293b5877 Instead of computing signatures during building, compute them afterwards for verification (#51718)
This helps with finding issues with d.ts emit because of caching.
2022-12-06 16:55:08 -08:00
Sheetal Nandi 84e475c105 Make resolution cache use sets instead of arrays for easier checking (#51735) 2022-12-06 14:25:19 -08:00
Sheetal Nandi 38f33ade06 Use non relative name cache for type reference resolutions and API updates (#51732)
* Make the non relative name resolution cache generic

* Add cache for non relative type reference resolution

* Add getter only methods so we can use these in future for sharing resolutions across the projects

* Mark existing non relative module name cache getOrCreate as deprecated

* Prefer getters for getting directory results
2022-12-06 14:22:03 -08:00
Sheetal Nandi 9e845d2248 Api cleanup for Module and Type Reference directive resolution (#51546)
* Refactoring so CacheWithRedirects has Key and Value type parameters

* ModuleResolutionCache or TypeRefDirectiveCache will look in directory before solving, so ResolutionCache doesnt need this check

* Test showing module resolution is not shared because resolution cache doesnt update own options

* Enable traceResolution on some of the project reference tests

* Simplify CacheWithRedirects and ensure the options are set in all common scenarios so cache can be shared between redirects

* Make failedlookup etc optional in ResolvedModule/TypeRefefWithFailedLookupLocations
Also make accidental public failed lookup internal

* Add new API for module and type ref resolution

* Store auto type reference resolutions

* Modify test to show how using program partially doesnt report resolution diagnostics

* Ensure that resolution diagnostics are reported in filePreocessingDiagnostics so they can be reused when program is reused

* Some cleanup

* Remove the newly added ReoslutionInfo in favor of new APIs

* update
2022-12-05 11:56:33 -08:00
Sheetal Nandi 7b7f6a75ea Code refactoring for module resolution api (#51675)
* Refactoring so CacheWithRedirects has Key and Value type parameters

* ModuleResolutionCache or TypeRefDirectiveCache will look in directory before solving, so ResolutionCache doesnt need this check

* Test showing module resolution is not shared because resolution cache doesnt update own options

* Enable traceResolution on some of the project reference tests

* Simplify CacheWithRedirects and ensure the options are set in all common scenarios so cache can be shared between redirects
2022-12-01 10:17:58 -08:00
Sheetal Nandi f636fc1846 Fix the name of the file to be deleted when doing baseline accept (#51705) 2022-11-30 14:01:03 -08:00
Sheetal Nandi 16edc29bc9 Handle empty string when getting file version (#51689)
* Test for empty string change

* Fix empty string for file versioning
2022-11-30 10:30:32 -08:00
Sheetal Nandi c2519bb301 When there is no change in file text for program, no need to update program (#51626)
* When fsEvent for change is repeated

* When trying to check if program is uptodate, read the files from disk to determine the version instead of delaying so that new program is not created if file contents have not changed
2022-11-29 12:20:41 -08:00
Sheetal Nandi af36a859b9 Fix the crash when affected file pending emit is not in program is being serialized into buildInfo (#51674)
Fixes #51641
2022-11-29 12:20:09 -08:00
Sheetal Nandi 9f93c6717d Dont calculate version paths proactively as they may not be needed (#51593) 2022-11-29 12:19:44 -08:00
Sheetal Nandi 59e659ac4a More test cleanup/baselining for future changes (#51635)
* More test cleanup/baselining for future changes

* More cleanup

* More cleanup

* Make the reuse program structure stable for each test
2022-11-28 15:49:08 -08:00
Sheetal Nandi c1427c90b6 Convert reuse program structure and tracing of module resolution to baseline for easier updates (#51628)
* Modify all usages of file name lower casing to use custom lower casing method

* Baseline reuse program structure tests for easy update when making changes to module resolution
2022-11-22 20:58:21 -08:00
Sheetal Nandi 2f2a17ad0b Removing some unnecessary methods from host and function parameters (#51499) 2022-11-15 17:34:58 -08:00
Sheetal Nandi 9ede7ce006 Fix incorrect spelling of packageId (#51483) 2022-11-10 16:55:49 -08:00
Sheetal Nandi c5aea89230 Add alias ResolutionMode for ModuleKind.ESNext | ModuleKind.CommonJs | undefined (#51482)
* Add alias ResolutionMode for ModuleKind.ESNext | ModuleKind.CommonJs | undefined

* ResolutionMode | undefined = ResolutionMode

* More
2022-11-10 16:47:46 -08:00
Sheetal Nandi 3eafb64faf Handle reusing type reference resolution in resolution cache correctly (#51475)
* Add tests where typeRef resolution is not in the cache

* Ensure that type ref reuse is actually handled since type ref resolution only sends containingSourceFileMode and not containingSourceFile
2022-11-10 16:03:25 -08:00
Sheetal Nandi 57a916c455 Emit buildinfo if file deleted isnt global (#51472)
* Add test for when file is deleted

* Emit buildinfo if file deleted isnt global
2022-11-09 18:07:17 -08:00
Sheetal Nandi 6e0a62e8dd Detangle unittests to reference helpers directly (#51450)
* Remove unnecessary redirection now that we are not in namespaces

* Move the tsc helpers in one place

* Move virtual file system with watch in unittests folder instead of harness since harness doesnt use it anyways

* Replace protocol and commandNames

* Revert incorrect pick
2022-11-09 10:02:40 -08:00
Sheetal Nandi 48aebcdcdb TypeReference directive reuse (#49750) 2022-11-07 15:15:11 -08:00
Sheetal Nandi 7b0df1ff99 Pass in information for the module name resolution when resolutions from file are partially used (#49738)
* Test showing wrong resolution is returned because of incorrect mode calculation
Test for #48229

* Pass in information for the module name resolution when resolutions from file are partially used
Fixes #48229

* Make the resolution info complete
2022-11-07 11:51:04 -08:00
Sheetal Nandi eac566b8c3 Enables passing --declaration, --emitDeclarationOnly, --declarationMap, --soureMap and --inlineSourceMap to tsc --build (#51241)
* Add different tests for baselining before behavior

* Fix assert for first project output

* Add ability to pass declaration, declarationMap, emitDeclarationOnly, sourceMap and inlineSourceMap on commandline of --build

* Store these options in --out scenario

* Store buildInfo program for --out even if not composite

* Changes to make these commanline options work

* Do not include sourceMapUrl text in the sourceFile version

* Emit complete program in --out scenario as well since we need to determine uptodate ness

* Copy js or dts bundle from old build if emitting only js or dts files

* Dont emit dts if we want to emit only js files even though options suggest emitting d.ts files as well

* Adding comments and refactoring some of the code
2022-11-07 10:53:22 -08:00
Sheetal Nandi 354891cf43 Avoid unnecessary buildInfo read if host supports caching it (avoids in --build scenario) and some reporting cleanup (#51403)
* Emit diagnostics when just manipuating bundle at that time itself
[4:04:42 PM] Updating output of project '/TypeScript/src/tsserver/tsconfig.json'...

Memory used:        581215K
transformTime time:   0.01s
Source Map time:      0.35s
commentTime time:     0.00s
printTime time:       0.58s
Emit time:            0.90s
I/O Write time:       0.01s
Total time:           0.90s

* Pull out getSourceFile and writeFile in a function

* Fix incorrect solutionPerformance reporting in watch mode

* Remove unnecessary build info read when host can give cached buildInfo

* Simplify overloads

* Accept API change
2022-11-04 19:19:57 -07:00
Sheetal Nandi 5e3fa9b87b There is no use of creating reference map with --out since its not used anyways (#51379)
* Convert some of the tests to baselines

* There is no use of creating reference map with --out since its not used anyways.
The changes to affectedFileList returned should be intended since --out needs saving just one file for correct output and not both
2022-11-03 15:30:32 -07:00
Sheetal Nandi 610ae68ecf Serialize and use files that can be emitted as affectedFilesPendingEmit (#51364) 2022-11-02 14:55:37 -07:00
Sheetal Nandi 8ed84e1c85 Write original fileInfo when its not just string = version = signature in readable baseline (#51391) 2022-11-02 13:55:20 -07:00
Sheetal Nandi 7c580111df Set impliedNodeFormat on sourceFile we get from host to ensure the field is set correctly (#50977)
* Add test that fails

* Handle impliedNodeFormat when handling sourceFileCache
Fixes #50872

* Revert the fix

* Make sure impliedNodeFormat is set for the sourceFile

* Revert "Make sure impliedNodeFormat is set for the sourceFile"

This reverts commit 651a47fdd6.

* Revert "Revert the fix"

This reverts commit 5c98b9cfc1.

* Swap the keys for map
2022-10-31 11:26:36 -07:00
Sheetal Nandi cfa55f1c2d Fixes the tests that got disabled when generating config set es2016 expecting to find libFile and remove incorrect affects flag from listFilesOnly (#51243)
* Fix the existing test

* Remove affectsEmit from listFilesOnly
2022-10-31 10:15:19 -07:00
Sheetal Nandi 18f559faf9 Store array only if dtsOnly emit is pending to compress buildinfo (#51246) 2022-10-31 10:14:22 -07:00
Sheetal Nandi 2625c1feae Make the init config category order predictable (#51247) 2022-10-20 13:23:18 -07:00
Sheetal Nandi 5f3e6cc498 Plugin probe location is higher priority than peer node_modules (#51079)
Fixes #34616
2022-10-06 13:45:22 -07:00