@zzzen/pyright-internal 1.2.0-dev.20231203 → 1.2.0-dev.20231217

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/dist/analyzer/analyzerFileInfo.d.ts +4 -3
  2. package/dist/analyzer/analyzerFileInfo.js.map +1 -1
  3. package/dist/analyzer/backgroundAnalysisProgram.d.ts +15 -14
  4. package/dist/analyzer/backgroundAnalysisProgram.js +38 -38
  5. package/dist/analyzer/backgroundAnalysisProgram.js.map +1 -1
  6. package/dist/analyzer/binder.js +67 -62
  7. package/dist/analyzer/binder.js.map +1 -1
  8. package/dist/analyzer/checker.js +43 -33
  9. package/dist/analyzer/checker.js.map +1 -1
  10. package/dist/analyzer/circularDependency.d.ts +3 -2
  11. package/dist/analyzer/circularDependency.js.map +1 -1
  12. package/dist/analyzer/codeFlowEngine.js +47 -47
  13. package/dist/analyzer/codeFlowEngine.js.map +1 -1
  14. package/dist/analyzer/codeFlowTypes.d.ts +0 -1
  15. package/dist/analyzer/codeFlowTypes.js.map +1 -1
  16. package/dist/analyzer/constraintSolver.js +3 -5
  17. package/dist/analyzer/constraintSolver.js.map +1 -1
  18. package/dist/analyzer/dataClasses.js +1 -1
  19. package/dist/analyzer/dataClasses.js.map +1 -1
  20. package/dist/analyzer/declaration.d.ts +5 -3
  21. package/dist/analyzer/declaration.js +3 -2
  22. package/dist/analyzer/declaration.js.map +1 -1
  23. package/dist/analyzer/declarationUtils.d.ts +3 -2
  24. package/dist/analyzer/declarationUtils.js +14 -12
  25. package/dist/analyzer/declarationUtils.js.map +1 -1
  26. package/dist/analyzer/decorators.js +14 -43
  27. package/dist/analyzer/decorators.js.map +1 -1
  28. package/dist/analyzer/enums.js +1 -1
  29. package/dist/analyzer/enums.js.map +1 -1
  30. package/dist/analyzer/importResolver.d.ts +29 -25
  31. package/dist/analyzer/importResolver.js +300 -301
  32. package/dist/analyzer/importResolver.js.map +1 -1
  33. package/dist/analyzer/importResult.d.ts +5 -4
  34. package/dist/analyzer/importResult.js.map +1 -1
  35. package/dist/analyzer/importStatementUtils.d.ts +5 -4
  36. package/dist/analyzer/importStatementUtils.js +23 -22
  37. package/dist/analyzer/importStatementUtils.js.map +1 -1
  38. package/dist/analyzer/namedTuples.js +3 -3
  39. package/dist/analyzer/namedTuples.js.map +1 -1
  40. package/dist/analyzer/packageTypeReport.d.ts +7 -6
  41. package/dist/analyzer/packageTypeReport.js +4 -4
  42. package/dist/analyzer/packageTypeReport.js.map +1 -1
  43. package/dist/analyzer/packageTypeVerifier.js +68 -64
  44. package/dist/analyzer/packageTypeVerifier.js.map +1 -1
  45. package/dist/analyzer/parentDirectoryCache.d.ts +7 -6
  46. package/dist/analyzer/parentDirectoryCache.js +9 -10
  47. package/dist/analyzer/parentDirectoryCache.js.map +1 -1
  48. package/dist/analyzer/parseTreeUtils.d.ts +1 -1
  49. package/dist/analyzer/parseTreeUtils.js +7 -4
  50. package/dist/analyzer/parseTreeUtils.js.map +1 -1
  51. package/dist/analyzer/patternMatching.js +102 -14
  52. package/dist/analyzer/patternMatching.js.map +1 -1
  53. package/dist/analyzer/program.d.ts +27 -26
  54. package/dist/analyzer/program.js +162 -156
  55. package/dist/analyzer/program.js.map +1 -1
  56. package/dist/analyzer/properties.js +6 -3
  57. package/dist/analyzer/properties.js.map +1 -1
  58. package/dist/analyzer/pyTypedUtils.d.ts +3 -2
  59. package/dist/analyzer/pyTypedUtils.js +4 -5
  60. package/dist/analyzer/pyTypedUtils.js.map +1 -1
  61. package/dist/analyzer/pythonPathUtils.d.ts +7 -6
  62. package/dist/analyzer/pythonPathUtils.js +21 -23
  63. package/dist/analyzer/pythonPathUtils.js.map +1 -1
  64. package/dist/analyzer/service.d.ts +24 -23
  65. package/dist/analyzer/service.js +190 -184
  66. package/dist/analyzer/service.js.map +1 -1
  67. package/dist/analyzer/sourceFile.d.ts +4 -5
  68. package/dist/analyzer/sourceFile.js +68 -56
  69. package/dist/analyzer/sourceFile.js.map +1 -1
  70. package/dist/analyzer/sourceFileInfoUtils.js +3 -3
  71. package/dist/analyzer/sourceFileInfoUtils.js.map +1 -1
  72. package/dist/analyzer/sourceMapper.d.ts +11 -10
  73. package/dist/analyzer/sourceMapper.js +61 -63
  74. package/dist/analyzer/sourceMapper.js.map +1 -1
  75. package/dist/analyzer/sourceMapperUtils.d.ts +2 -1
  76. package/dist/analyzer/sourceMapperUtils.js +2 -2
  77. package/dist/analyzer/sourceMapperUtils.js.map +1 -1
  78. package/dist/analyzer/tracePrinter.d.ts +3 -2
  79. package/dist/analyzer/tracePrinter.js +21 -23
  80. package/dist/analyzer/tracePrinter.js.map +1 -1
  81. package/dist/analyzer/typeDocStringUtils.d.ts +2 -1
  82. package/dist/analyzer/typeDocStringUtils.js +14 -17
  83. package/dist/analyzer/typeDocStringUtils.js.map +1 -1
  84. package/dist/analyzer/typeEvaluator.js +259 -152
  85. package/dist/analyzer/typeEvaluator.js.map +1 -1
  86. package/dist/analyzer/typeGuards.d.ts +1 -0
  87. package/dist/analyzer/typeGuards.js +5 -4
  88. package/dist/analyzer/typeGuards.js.map +1 -1
  89. package/dist/analyzer/typePrinter.d.ts +2 -0
  90. package/dist/analyzer/typePrinter.js +48 -8
  91. package/dist/analyzer/typePrinter.js.map +1 -1
  92. package/dist/analyzer/typeStubWriter.d.ts +2 -1
  93. package/dist/analyzer/typeStubWriter.js +2 -2
  94. package/dist/analyzer/typeStubWriter.js.map +1 -1
  95. package/dist/analyzer/typeUtils.d.ts +5 -2
  96. package/dist/analyzer/typeUtils.js +37 -10
  97. package/dist/analyzer/typeUtils.js.map +1 -1
  98. package/dist/analyzer/typedDicts.js +4 -4
  99. package/dist/analyzer/typedDicts.js.map +1 -1
  100. package/dist/analyzer/types.d.ts +10 -6
  101. package/dist/analyzer/types.js +7 -5
  102. package/dist/analyzer/types.js.map +1 -1
  103. package/dist/backgroundAnalysis.d.ts +1 -2
  104. package/dist/backgroundAnalysis.js +6 -4
  105. package/dist/backgroundAnalysis.js.map +1 -1
  106. package/dist/backgroundAnalysisBase.d.ts +22 -20
  107. package/dist/backgroundAnalysisBase.js +76 -55
  108. package/dist/backgroundAnalysisBase.js.map +1 -1
  109. package/dist/backgroundThreadBase.d.ts +1 -1
  110. package/dist/backgroundThreadBase.js +20 -11
  111. package/dist/backgroundThreadBase.js.map +1 -1
  112. package/dist/commands/createTypeStub.js +3 -2
  113. package/dist/commands/createTypeStub.js.map +1 -1
  114. package/dist/commands/dumpFileDebugInfoCommand.js +21 -20
  115. package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
  116. package/dist/commands/quickActionCommand.js +5 -5
  117. package/dist/commands/quickActionCommand.js.map +1 -1
  118. package/dist/common/configOptions.d.ts +14 -13
  119. package/dist/common/configOptions.js +29 -27
  120. package/dist/common/configOptions.js.map +1 -1
  121. package/dist/common/diagnostic.d.ts +6 -5
  122. package/dist/common/diagnostic.js +2 -2
  123. package/dist/common/diagnostic.js.map +1 -1
  124. package/dist/common/diagnosticSink.d.ts +2 -1
  125. package/dist/common/diagnosticSink.js.map +1 -1
  126. package/dist/common/editAction.d.ts +6 -5
  127. package/dist/common/editAction.js +2 -2
  128. package/dist/common/editAction.js.map +1 -1
  129. package/dist/common/envVarUtils.d.ts +2 -1
  130. package/dist/common/envVarUtils.js +20 -28
  131. package/dist/common/envVarUtils.js.map +1 -1
  132. package/dist/common/extensibility.d.ts +19 -19
  133. package/dist/common/extensibility.js.map +1 -1
  134. package/dist/common/fileSystem.d.ts +29 -28
  135. package/dist/common/fileWatcher.d.ts +2 -1
  136. package/dist/common/fileWatcher.js.map +1 -1
  137. package/dist/common/fullAccessHost.d.ts +8 -7
  138. package/dist/common/fullAccessHost.js +21 -16
  139. package/dist/common/fullAccessHost.js.map +1 -1
  140. package/dist/common/host.d.ts +7 -6
  141. package/dist/common/host.js +1 -1
  142. package/dist/common/host.js.map +1 -1
  143. package/dist/common/logTracker.d.ts +2 -1
  144. package/dist/common/logTracker.js +4 -4
  145. package/dist/common/logTracker.js.map +1 -1
  146. package/dist/common/pathUtils.d.ts +1 -28
  147. package/dist/common/pathUtils.js +17 -366
  148. package/dist/common/pathUtils.js.map +1 -1
  149. package/dist/common/realFileSystem.d.ts +7 -3
  150. package/dist/common/realFileSystem.js +78 -60
  151. package/dist/common/realFileSystem.js.map +1 -1
  152. package/dist/common/serviceProviderExtensions.d.ts +2 -1
  153. package/dist/common/serviceProviderExtensions.js +5 -2
  154. package/dist/common/serviceProviderExtensions.js.map +1 -1
  155. package/dist/common/textEditTracker.d.ts +2 -1
  156. package/dist/common/textEditTracker.js +28 -28
  157. package/dist/common/textEditTracker.js.map +1 -1
  158. package/dist/common/textRange.d.ts +2 -1
  159. package/dist/common/textRange.js.map +1 -1
  160. package/dist/common/uri/baseUri.d.ts +51 -0
  161. package/dist/common/uri/baseUri.js +194 -0
  162. package/dist/common/uri/baseUri.js.map +1 -0
  163. package/dist/common/uri/emptyUri.d.ts +32 -0
  164. package/dist/common/uri/emptyUri.js +98 -0
  165. package/dist/common/uri/emptyUri.js.map +1 -0
  166. package/dist/common/uri/fileUri.d.ts +36 -0
  167. package/dist/common/uri/fileUri.js +180 -0
  168. package/dist/common/uri/fileUri.js.map +1 -0
  169. package/dist/common/uri/memoization.d.ts +3 -0
  170. package/dist/common/uri/memoization.js +72 -0
  171. package/dist/common/uri/memoization.js.map +1 -0
  172. package/dist/common/uri/uri.d.ts +50 -0
  173. package/dist/common/uri/uri.js +104 -0
  174. package/dist/common/uri/uri.js.map +1 -0
  175. package/dist/common/uri/uriUtils.d.ts +39 -0
  176. package/dist/common/uri/uriUtils.js +362 -0
  177. package/dist/common/uri/uriUtils.js.map +1 -0
  178. package/dist/common/uri/webUri.d.ts +36 -0
  179. package/dist/common/uri/webUri.js +207 -0
  180. package/dist/common/uri/webUri.js.map +1 -0
  181. package/dist/common/workspaceEditUtils.d.ts +8 -8
  182. package/dist/common/workspaceEditUtils.js +35 -38
  183. package/dist/common/workspaceEditUtils.js.map +1 -1
  184. package/dist/languageServerBase.d.ts +19 -22
  185. package/dist/languageServerBase.js +91 -95
  186. package/dist/languageServerBase.js.map +1 -1
  187. package/dist/languageService/analyzerServiceExecutor.d.ts +2 -1
  188. package/dist/languageService/analyzerServiceExecutor.js +14 -16
  189. package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
  190. package/dist/languageService/autoImporter.d.ts +11 -9
  191. package/dist/languageService/autoImporter.js +45 -44
  192. package/dist/languageService/autoImporter.js.map +1 -1
  193. package/dist/languageService/callHierarchyProvider.d.ts +3 -2
  194. package/dist/languageService/callHierarchyProvider.js +23 -35
  195. package/dist/languageService/callHierarchyProvider.js.map +1 -1
  196. package/dist/languageService/codeActionProvider.d.ts +2 -1
  197. package/dist/languageService/codeActionProvider.js +8 -10
  198. package/dist/languageService/codeActionProvider.js.map +1 -1
  199. package/dist/languageService/completionProvider.d.ts +7 -6
  200. package/dist/languageService/completionProvider.js +32 -30
  201. package/dist/languageService/completionProvider.js.map +1 -1
  202. package/dist/languageService/completionProviderUtils.d.ts +2 -1
  203. package/dist/languageService/completionProviderUtils.js +1 -1
  204. package/dist/languageService/completionProviderUtils.js.map +1 -1
  205. package/dist/languageService/definitionProvider.d.ts +4 -3
  206. package/dist/languageService/definitionProvider.js +26 -24
  207. package/dist/languageService/definitionProvider.js.map +1 -1
  208. package/dist/languageService/documentHighlightProvider.d.ts +3 -2
  209. package/dist/languageService/documentHighlightProvider.js +3 -3
  210. package/dist/languageService/documentHighlightProvider.js.map +1 -1
  211. package/dist/languageService/documentSymbolCollector.js +8 -7
  212. package/dist/languageService/documentSymbolCollector.js.map +1 -1
  213. package/dist/languageService/documentSymbolProvider.d.ts +5 -4
  214. package/dist/languageService/documentSymbolProvider.js +9 -11
  215. package/dist/languageService/documentSymbolProvider.js.map +1 -1
  216. package/dist/languageService/hoverProvider.d.ts +4 -3
  217. package/dist/languageService/hoverProvider.js +6 -5
  218. package/dist/languageService/hoverProvider.js.map +1 -1
  219. package/dist/languageService/navigationUtils.d.ts +2 -1
  220. package/dist/languageService/navigationUtils.js +2 -3
  221. package/dist/languageService/navigationUtils.js.map +1 -1
  222. package/dist/languageService/quickActions.d.ts +2 -1
  223. package/dist/languageService/quickActions.js +3 -3
  224. package/dist/languageService/quickActions.js.map +1 -1
  225. package/dist/languageService/referencesProvider.d.ts +10 -9
  226. package/dist/languageService/referencesProvider.js +28 -28
  227. package/dist/languageService/referencesProvider.js.map +1 -1
  228. package/dist/languageService/renameProvider.d.ts +4 -3
  229. package/dist/languageService/renameProvider.js +17 -18
  230. package/dist/languageService/renameProvider.js.map +1 -1
  231. package/dist/languageService/signatureHelpProvider.d.ts +3 -2
  232. package/dist/languageService/signatureHelpProvider.js +4 -4
  233. package/dist/languageService/signatureHelpProvider.js.map +1 -1
  234. package/dist/languageService/symbolIndexer.d.ts +2 -1
  235. package/dist/languageService/symbolIndexer.js +11 -3
  236. package/dist/languageService/symbolIndexer.js.map +1 -1
  237. package/dist/languageService/tooltipUtils.js +10 -4
  238. package/dist/languageService/tooltipUtils.js.map +1 -1
  239. package/dist/languageService/workspaceSymbolProvider.d.ts +4 -3
  240. package/dist/languageService/workspaceSymbolProvider.js +10 -11
  241. package/dist/languageService/workspaceSymbolProvider.js.map +1 -1
  242. package/dist/localization/localize.d.ts +2 -0
  243. package/dist/localization/localize.js +2 -0
  244. package/dist/localization/localize.js.map +1 -1
  245. package/dist/localization/package.nls.en-us.json +3 -1
  246. package/dist/parser/parseNodes.d.ts +1 -0
  247. package/dist/parser/parseNodes.js +1 -0
  248. package/dist/parser/parseNodes.js.map +1 -1
  249. package/dist/parser/parser.js +18 -15
  250. package/dist/parser/parser.js.map +1 -1
  251. package/dist/pyright.js +16 -15
  252. package/dist/pyright.js.map +1 -1
  253. package/dist/pyrightFileSystem.d.ts +13 -13
  254. package/dist/pyrightFileSystem.js +38 -43
  255. package/dist/pyrightFileSystem.js.map +1 -1
  256. package/dist/readonlyAugmentedFileSystem.d.ts +29 -28
  257. package/dist/readonlyAugmentedFileSystem.js +62 -65
  258. package/dist/readonlyAugmentedFileSystem.js.map +1 -1
  259. package/dist/server.js +21 -20
  260. package/dist/server.js.map +1 -1
  261. package/dist/tests/chainedSourceFiles.test.js +39 -30
  262. package/dist/tests/chainedSourceFiles.test.js.map +1 -1
  263. package/dist/tests/checker.test.js +31 -30
  264. package/dist/tests/checker.test.js.map +1 -1
  265. package/dist/tests/classDeclaration.test.d.ts +1 -0
  266. package/dist/tests/classDeclaration.test.js +166 -0
  267. package/dist/tests/classDeclaration.test.js.map +1 -0
  268. package/dist/tests/completions.test.js +7 -3
  269. package/dist/tests/completions.test.js.map +1 -1
  270. package/dist/tests/config.test.js +24 -22
  271. package/dist/tests/config.test.js.map +1 -1
  272. package/dist/tests/documentSymbolCollector.test.js +3 -2
  273. package/dist/tests/documentSymbolCollector.test.js.map +1 -1
  274. package/dist/tests/filesystem.test.js +37 -35
  275. package/dist/tests/filesystem.test.js.map +1 -1
  276. package/dist/tests/fourSlashParser.test.js +4 -4
  277. package/dist/tests/fourSlashParser.test.js.map +1 -1
  278. package/dist/tests/fourslash/hover.docstring.alias.fourslash.js +27 -11
  279. package/dist/tests/fourslash/hover.docstring.alias.fourslash.js.map +1 -1
  280. package/dist/tests/harness/fourslash/fourSlashParser.js +2 -2
  281. package/dist/tests/harness/fourslash/fourSlashParser.js.map +1 -1
  282. package/dist/tests/harness/fourslash/testLanguageService.d.ts +4 -5
  283. package/dist/tests/harness/fourslash/testLanguageService.js +9 -15
  284. package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -1
  285. package/dist/tests/harness/fourslash/testState.d.ts +4 -4
  286. package/dist/tests/harness/fourslash/testState.js +91 -51
  287. package/dist/tests/harness/fourslash/testState.js.map +1 -1
  288. package/dist/tests/harness/fourslash/workspaceEditTestUtils.js +4 -0
  289. package/dist/tests/harness/fourslash/workspaceEditTestUtils.js.map +1 -1
  290. package/dist/tests/harness/testAccessHost.d.ts +3 -2
  291. package/dist/tests/harness/testAccessHost.js +2 -1
  292. package/dist/tests/harness/testAccessHost.js.map +1 -1
  293. package/dist/tests/harness/testHost.js +13 -11
  294. package/dist/tests/harness/testHost.js.map +1 -1
  295. package/dist/tests/harness/vfs/factory.d.ts +3 -2
  296. package/dist/tests/harness/vfs/factory.js +5 -4
  297. package/dist/tests/harness/vfs/factory.js.map +1 -1
  298. package/dist/tests/harness/vfs/filesystem.d.ts +32 -31
  299. package/dist/tests/harness/vfs/filesystem.js +47 -49
  300. package/dist/tests/harness/vfs/filesystem.js.map +1 -1
  301. package/dist/tests/harness/vfs/pathValidation.js +1 -10
  302. package/dist/tests/harness/vfs/pathValidation.js.map +1 -1
  303. package/dist/tests/importResolver.test.js +106 -58
  304. package/dist/tests/importResolver.test.js.map +1 -1
  305. package/dist/tests/importStatementUtils.test.js +10 -9
  306. package/dist/tests/importStatementUtils.test.js.map +1 -1
  307. package/dist/tests/ipythonMode.test.js +12 -11
  308. package/dist/tests/ipythonMode.test.js.map +1 -1
  309. package/dist/tests/logger.test.js +2 -1
  310. package/dist/tests/logger.test.js.map +1 -1
  311. package/dist/tests/parseTreeUtils.test.js +2 -1
  312. package/dist/tests/parseTreeUtils.test.js.map +1 -1
  313. package/dist/tests/pathUtils.test.js +3 -138
  314. package/dist/tests/pathUtils.test.js.map +1 -1
  315. package/dist/tests/pyrightFileSystem.test.js +38 -34
  316. package/dist/tests/pyrightFileSystem.test.js.map +1 -1
  317. package/dist/tests/service.test.js +37 -42
  318. package/dist/tests/service.test.js.map +1 -1
  319. package/dist/tests/signatureHelp.test.js +3 -2
  320. package/dist/tests/signatureHelp.test.js.map +1 -1
  321. package/dist/tests/sourceFile.test.js +8 -7
  322. package/dist/tests/sourceFile.test.js.map +1 -1
  323. package/dist/tests/sourceMapperUtils.test.js +73 -35
  324. package/dist/tests/sourceMapperUtils.test.js.map +1 -1
  325. package/dist/tests/testState.test.js +13 -9
  326. package/dist/tests/testState.test.js.map +1 -1
  327. package/dist/tests/testStateUtils.d.ts +2 -5
  328. package/dist/tests/testStateUtils.js +27 -64
  329. package/dist/tests/testStateUtils.js.map +1 -1
  330. package/dist/tests/testUtils.d.ts +3 -5
  331. package/dist/tests/testUtils.js +15 -64
  332. package/dist/tests/testUtils.js.map +1 -1
  333. package/dist/tests/textEditUtil.test.js +4 -3
  334. package/dist/tests/textEditUtil.test.js.map +1 -1
  335. package/dist/tests/typeEvaluator1.test.js +16 -15
  336. package/dist/tests/typeEvaluator1.test.js.map +1 -1
  337. package/dist/tests/typeEvaluator2.test.js +22 -9
  338. package/dist/tests/typeEvaluator2.test.js.map +1 -1
  339. package/dist/tests/typeEvaluator3.test.js +86 -63
  340. package/dist/tests/typeEvaluator3.test.js.map +1 -1
  341. package/dist/tests/typeEvaluator4.test.js +29 -20
  342. package/dist/tests/typeEvaluator4.test.js.map +1 -1
  343. package/dist/tests/typeEvaluator5.test.js +28 -27
  344. package/dist/tests/typeEvaluator5.test.js.map +1 -1
  345. package/dist/tests/typePrinter.test.js +4 -3
  346. package/dist/tests/typePrinter.test.js.map +1 -1
  347. package/dist/tests/uri.test.d.ts +1 -0
  348. package/dist/tests/uri.test.js +695 -0
  349. package/dist/tests/uri.test.js.map +1 -0
  350. package/dist/tests/workspaceEditUtils.test.js +28 -28
  351. package/dist/tests/workspaceEditUtils.test.js.map +1 -1
  352. package/dist/tests/zipfs.test.js +11 -11
  353. package/dist/tests/zipfs.test.js.map +1 -1
  354. package/dist/workspaceFactory.d.ts +13 -14
  355. package/dist/workspaceFactory.js +54 -55
  356. package/dist/workspaceFactory.js.map +1 -1
  357. package/package.json +2 -2
  358. package/dist/common/uriParser.d.ts +0 -24
  359. package/dist/common/uriParser.js +0 -45
  360. package/dist/common/uriParser.js.map +0 -1
@@ -3,17 +3,18 @@
3
3
  import { Dirent, ReadStream, WriteStream } from 'fs';
4
4
  import { FileSystem, MkDirOptions, TempFile, TmpfileOptions } from '../../../common/fileSystem';
5
5
  import { FileWatcher, FileWatcherEventHandler, FileWatcherEventType } from '../../../common/fileWatcher';
6
+ import { Uri } from '../../../common/uri/uri';
6
7
  import { Metadata } from './../utils';
7
8
  export declare const MODULE_PATH: string;
8
9
  export interface DiffOptions {
9
10
  includeChangedFileWithSameContent?: boolean;
10
11
  }
11
12
  export declare class TestFileSystemWatcher implements FileWatcher {
12
- private _listener;
13
13
  private _paths;
14
- constructor(paths: string[], _listener: FileWatcherEventHandler);
14
+ private _listener;
15
+ constructor(_paths: Uri[], _listener: FileWatcherEventHandler);
15
16
  close(): void;
16
- fireFileChange(path: string, eventType: FileWatcherEventType): boolean;
17
+ fireFileChange(path: Uri, eventType: FileWatcherEventType): boolean;
17
18
  }
18
19
  /**
19
20
  * Represents a virtual POSIX-like file system.
@@ -33,6 +34,7 @@ export declare class TestFileSystem implements FileSystem, TempFile {
33
34
  private _id;
34
35
  private static _nextId;
35
36
  constructor(ignoreCase: boolean, options?: FileSystemOptions);
37
+ get isCaseSensitive(): boolean;
36
38
  /**
37
39
  * Gets metadata for this `FileSystem`.
38
40
  */
@@ -83,7 +85,7 @@ export declare class TestFileSystem implements FileSystem, TempFile {
83
85
  *
84
86
  * @link http://pubs.opengroup.org/onlinepubs/9699919799/functions/chdir.html
85
87
  */
86
- chdir(path: string): void;
88
+ chdir(uri: Uri): void;
87
89
  /**
88
90
  * Pushes the current directory onto the directory stack and changes the current working directory to the supplied path.
89
91
  */
@@ -110,16 +112,15 @@ export declare class TestFileSystem implements FileSystem, TempFile {
110
112
  * @param traversal The traversal scheme to use.
111
113
  */
112
114
  lscanSync(path: string, axis: Axis, traversal: Traversal): string[];
113
- createFileSystemWatcher(paths: string[], listener: FileWatcherEventHandler): FileWatcher;
115
+ createFileSystemWatcher(paths: Uri[], listener: FileWatcherEventHandler): FileWatcher;
114
116
  fireFileWatcherEvent(path: string, event: FileWatcherEventType): void;
115
- getModulePath(): string;
116
- tmpdir(): string;
117
- tmpfile(options?: TmpfileOptions): string;
118
- realCasePath(path: string): string;
119
- isMappedFilePath(filepath: string): boolean;
120
- getOriginalFilePath(mappedFilePath: string): string;
121
- getMappedFilePath(originalFilepath: string): string;
122
- getUri(path: string): string;
117
+ getModulePath(): Uri;
118
+ tmpdir(): Uri;
119
+ tmpfile(options?: TmpfileOptions): Uri;
120
+ realCasePath(path: Uri): Uri;
121
+ isMappedUri(filepath: Uri): boolean;
122
+ getOriginalUri(mappedFilePath: Uri): Uri;
123
+ getMappedUri(originalFilepath: Uri): Uri;
123
124
  /**
124
125
  * Mounts a physical or virtual file system at a location in this virtual file system.
125
126
  *
@@ -144,7 +145,7 @@ export declare class TestFileSystem implements FileSystem, TempFile {
144
145
  /**
145
146
  * Determines whether a path exists.
146
147
  */
147
- existsSync(path: string): boolean;
148
+ existsSync(path: Uri): boolean;
148
149
  /**
149
150
  * Get file status. If `path` is a symbolic link, it is dereferenced.
150
151
  *
@@ -152,7 +153,7 @@ export declare class TestFileSystem implements FileSystem, TempFile {
152
153
  *
153
154
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
154
155
  */
155
- statSync(path: string): Stats;
156
+ statSync(path: Uri): Stats;
156
157
  /**
157
158
  * Change file access times
158
159
  *
@@ -174,7 +175,7 @@ export declare class TestFileSystem implements FileSystem, TempFile {
174
175
  *
175
176
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
176
177
  */
177
- readdirSync(path: string): string[];
178
+ readdirSync(path: Uri): string[];
178
179
  /**
179
180
  * Read a directory. If `path` is a symbolic link, it is dereferenced.
180
181
  *
@@ -182,7 +183,7 @@ export declare class TestFileSystem implements FileSystem, TempFile {
182
183
  *
183
184
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
184
185
  */
185
- readdirEntriesSync(path: string): Dirent[];
186
+ readdirEntriesSync(path: Uri): Dirent[];
186
187
  /**
187
188
  * Make a directory.
188
189
  *
@@ -190,7 +191,7 @@ export declare class TestFileSystem implements FileSystem, TempFile {
190
191
  *
191
192
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
192
193
  */
193
- mkdirSync(path: string, options?: MkDirOptions): void;
194
+ mkdirSync(path: Uri, options?: MkDirOptions): void;
194
195
  /**
195
196
  * Remove a directory.
196
197
  *
@@ -198,7 +199,7 @@ export declare class TestFileSystem implements FileSystem, TempFile {
198
199
  *
199
200
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
200
201
  */
201
- rmdirSync(path: string): void;
202
+ rmdirSync(uri: Uri): void;
202
203
  /**
203
204
  * Link one file to another file (also known as a "hard link").
204
205
  *
@@ -214,7 +215,7 @@ export declare class TestFileSystem implements FileSystem, TempFile {
214
215
  *
215
216
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
216
217
  */
217
- unlinkSync(path: string): void;
218
+ unlinkSync(path: Uri): void;
218
219
  /**
219
220
  * Rename a file.
220
221
  *
@@ -238,36 +239,36 @@ export declare class TestFileSystem implements FileSystem, TempFile {
238
239
  *
239
240
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
240
241
  */
241
- realpathSync(path: string): string;
242
+ realpathSync(path: Uri): Uri;
242
243
  /**
243
244
  * Read from a file.
244
245
  *
245
246
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
246
247
  */
247
- readFileSync(path: string, encoding?: null): Buffer;
248
+ readFileSync(path: Uri, encoding?: null): Buffer;
248
249
  /**
249
250
  * Read from a file.
250
251
  *
251
252
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
252
253
  */
253
- readFileSync(path: string, encoding: BufferEncoding): string;
254
+ readFileSync(path: Uri, encoding: BufferEncoding): string;
254
255
  /**
255
256
  * Read from a file.
256
257
  *
257
258
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
258
259
  */
259
- readFileSync(path: string, encoding?: BufferEncoding | null): string | Buffer;
260
+ readFileSync(path: Uri, encoding?: BufferEncoding | null): string | Buffer;
260
261
  /**
261
262
  * Write to a file.
262
263
  *
263
264
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
264
265
  */
265
- writeFileSync(path: string, data: string | Buffer, encoding?: BufferEncoding | null): void;
266
- readFile(filePath: string): Promise<Buffer>;
267
- readFileText(filePath: string, encoding?: BufferEncoding): Promise<string>;
268
- createReadStream(path: string): ReadStream;
269
- createWriteStream(path: string): WriteStream;
270
- copyFileSync(src: string, dst: string): void;
266
+ writeFileSync(uri: Uri, data: string | Buffer, encoding?: BufferEncoding | null): void;
267
+ readFile(fileUri: Uri): Promise<Buffer>;
268
+ readFileText(fileUri: Uri, encoding?: BufferEncoding): Promise<string>;
269
+ createReadStream(path: Uri): ReadStream;
270
+ createWriteStream(path: Uri): WriteStream;
271
+ copyFileSync(src: Uri, dst: Uri): void;
271
272
  /**
272
273
  * Generates a `FileSet` patch containing all the entries in this `FileSystem` that are not in `base`.
273
274
  * @param base The base file system. If not provided, this file system's `shadowRoot` is used (if present).
@@ -277,7 +278,7 @@ export declare class TestFileSystem implements FileSystem, TempFile {
277
278
  * Generates a `FileSet` patch containing all the entries in `changed` that are not in `base`.
278
279
  */
279
280
  static diff(changed: TestFileSystem, base: TestFileSystem, options?: DiffOptions): FileSet | undefined;
280
- isInZip(path: string): boolean;
281
+ isInZip(path: Uri): boolean;
281
282
  dispose(): void;
282
283
  private _mkdir;
283
284
  private _filemeta;
@@ -31,28 +31,26 @@ var __importStar = (this && this.__importStar) || function (mod) {
31
31
  };
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
33
  exports.formatPatch = exports.Mount = exports.S_IFIFO = exports.S_IFCHR = exports.S_IFDIR = exports.S_IFBLK = exports.S_IFREG = exports.S_IFLNK = exports.S_IFSOCK = exports.S_IFMT = exports.Symlink = exports.Unlink = exports.Rmdir = exports.Link = exports.SameFileContentFile = exports.File = exports.Directory = exports.TestFileSystem = exports.TestFileSystemWatcher = exports.MODULE_PATH = void 0;
34
- const vscode_uri_1 = require("vscode-uri");
35
34
  const pathUtil = __importStar(require("../../../common/pathUtils"));
35
+ const stringUtils_1 = require("../../../common/stringUtils");
36
+ const uri_1 = require("../../../common/uri/uri");
36
37
  const utils_1 = require("../utils");
37
38
  const utils_2 = require("./../utils");
38
39
  const pathValidation_1 = require("./pathValidation");
39
- const stringUtils_1 = require("../../../common/stringUtils");
40
40
  exports.MODULE_PATH = pathUtil.normalizeSlashes('/');
41
41
  let devCount = 0; // A monotonically increasing count of device ids
42
42
  let inoCount = 0; // A monotonically increasing count of inodes
43
43
  class TestFileSystemWatcher {
44
- constructor(paths, _listener) {
44
+ constructor(_paths, _listener) {
45
+ this._paths = _paths;
45
46
  this._listener = _listener;
46
- this._paths = [];
47
- this._paths = paths.map((p) => pathUtil.normalizePath(p));
48
47
  }
49
48
  close() {
50
49
  // Do nothing.
51
50
  }
52
51
  fireFileChange(path, eventType) {
53
- const normalized = pathUtil.normalizePath(path);
54
- if (this._paths.some((p) => normalized.startsWith(p))) {
55
- this._listener(eventType, normalized);
52
+ if (this._paths.some((p) => path.startsWith(p))) {
53
+ this._listener(eventType, path.getFilePath());
56
54
  return true;
57
55
  }
58
56
  return false;
@@ -82,7 +80,7 @@ class TestFileSystem {
82
80
  this._applyFiles(files, /* dirname */ '');
83
81
  }
84
82
  let cwd = options.cwd;
85
- if ((!cwd || (!pathUtil.isDiskPathRoot(cwd) && !pathUtil.isUri(cwd))) && this._lazy.links) {
83
+ if ((!cwd || !pathUtil.isDiskPathRoot(cwd)) && this._lazy.links) {
86
84
  const iterator = (0, utils_2.getIterator)(this._lazy.links.keys());
87
85
  try {
88
86
  for (let i = (0, utils_2.nextResult)(iterator); i; i = (0, utils_2.nextResult)(iterator)) {
@@ -101,6 +99,9 @@ class TestFileSystem {
101
99
  }
102
100
  this._cwd = cwd || '';
103
101
  }
102
+ get isCaseSensitive() {
103
+ return !this.ignoreCase;
104
+ }
104
105
  /**
105
106
  * Gets metadata for this `FileSystem`.
106
107
  */
@@ -223,7 +224,8 @@ class TestFileSystem {
223
224
  *
224
225
  * @link http://pubs.opengroup.org/onlinepubs/9699919799/functions/chdir.html
225
226
  */
226
- chdir(path) {
227
+ chdir(uri) {
228
+ let path = uri.getFilePath();
227
229
  if (this.isReadonly) {
228
230
  throw (0, utils_1.createIOError)('EPERM');
229
231
  }
@@ -254,7 +256,7 @@ class TestFileSystem {
254
256
  this._dirStack.push(this._cwd);
255
257
  }
256
258
  if (path && path !== this._cwd) {
257
- this.chdir(path);
259
+ this.chdir(uri_1.Uri.file(path));
258
260
  }
259
261
  }
260
262
  /**
@@ -266,7 +268,7 @@ class TestFileSystem {
266
268
  }
267
269
  const path = this._dirStack && this._dirStack.pop();
268
270
  if (path) {
269
- this.chdir(path);
271
+ this.chdir(uri_1.Uri.file(path));
270
272
  }
271
273
  }
272
274
  /**
@@ -307,48 +309,41 @@ class TestFileSystem {
307
309
  }
308
310
  fireFileWatcherEvent(path, event) {
309
311
  for (const watcher of this._watchers) {
310
- if (watcher.fireFileChange(path, event)) {
312
+ if (watcher.fireFileChange(uri_1.Uri.file(path), event)) {
311
313
  break;
312
314
  }
313
315
  }
314
316
  }
315
317
  getModulePath() {
316
- return exports.MODULE_PATH;
318
+ return uri_1.Uri.file(exports.MODULE_PATH);
317
319
  }
318
320
  tmpdir() {
319
321
  this.mkdirpSync('/tmp');
320
- return pathUtil.normalizeSlashes('/tmp');
322
+ return uri_1.Uri.parse('file:///tmp', true);
321
323
  }
322
324
  tmpfile(options) {
323
325
  // Use an algorithm similar to tmp's.
324
326
  const prefix = (options === null || options === void 0 ? void 0 : options.prefix) || 'tmp';
325
327
  const postfix = (options === null || options === void 0 ? void 0 : options.prefix) ? '-' + options.prefix : '';
326
328
  const name = `${prefix}-${this._tmpfileCounter++}${postfix}`;
327
- const path = pathUtil.combinePaths(this.tmpdir(), name);
329
+ const path = this.tmpdir().combinePaths(name);
328
330
  this.writeFileSync(path, '');
329
331
  return path;
330
332
  }
331
333
  realCasePath(path) {
332
334
  return path;
333
335
  }
334
- isMappedFilePath(filepath) {
336
+ isMappedUri(filepath) {
335
337
  return false;
336
338
  }
337
339
  // Get original filepath if the given filepath is mapped.
338
- getOriginalFilePath(mappedFilePath) {
340
+ getOriginalUri(mappedFilePath) {
339
341
  return mappedFilePath;
340
342
  }
341
343
  // Get mapped filepath if the given filepath is mapped.
342
- getMappedFilePath(originalFilepath) {
344
+ getMappedUri(originalFilepath) {
343
345
  return originalFilepath;
344
346
  }
345
- getUri(path) {
346
- // If this is not a file path, just return the original path.
347
- if (pathUtil.isUri(path)) {
348
- return path;
349
- }
350
- return vscode_uri_1.URI.file(path).toString();
351
- }
352
347
  /**
353
348
  * Mounts a physical or virtual file system at a location in this virtual file system.
354
349
  *
@@ -378,13 +373,13 @@ class TestFileSystem {
378
373
  try {
379
374
  const stats = this.lstatSync(path);
380
375
  if (stats.isFile() || stats.isSymbolicLink()) {
381
- this.unlinkSync(path);
376
+ this.unlinkSync(uri_1.Uri.file(path));
382
377
  }
383
378
  else if (stats.isDirectory()) {
384
- for (const file of this.readdirSync(path)) {
379
+ for (const file of this.readdirSync(uri_1.Uri.file(path))) {
385
380
  this.rimrafSync(pathUtil.combinePaths(path, file));
386
381
  }
387
- this.rmdirSync(path);
382
+ this.rmdirSync(uri_1.Uri.file(path));
388
383
  }
389
384
  }
390
385
  catch (e) {
@@ -458,7 +453,10 @@ class TestFileSystem {
458
453
  * Determines whether a path exists.
459
454
  */
460
455
  existsSync(path) {
461
- const result = this._walk(this._resolve(path), /* noFollow */ true, () => 'stop');
456
+ if (path.isEmpty()) {
457
+ return false;
458
+ }
459
+ const result = this._walk(this._resolve(path.getFilePath()), /* noFollow */ true, () => 'stop');
462
460
  return result !== undefined && result.node !== undefined;
463
461
  }
464
462
  /**
@@ -469,7 +467,7 @@ class TestFileSystem {
469
467
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
470
468
  */
471
469
  statSync(path) {
472
- return this._stat(this._walk(this._resolve(path)));
470
+ return this._stat(this._walk(this._resolve(path.getFilePath())));
473
471
  }
474
472
  /**
475
473
  * Change file access times
@@ -509,7 +507,7 @@ class TestFileSystem {
509
507
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
510
508
  */
511
509
  readdirSync(path) {
512
- const { node } = this._walk(this._resolve(path));
510
+ const { node } = this._walk(this._resolve(path.getFilePath()));
513
511
  if (!node) {
514
512
  throw (0, utils_1.createIOError)('ENOENT');
515
513
  }
@@ -526,7 +524,7 @@ class TestFileSystem {
526
524
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
527
525
  */
528
526
  readdirEntriesSync(path) {
529
- const { node } = this._walk(this._resolve(path));
527
+ const { node } = this._walk(this._resolve(path.getFilePath()));
530
528
  if (!node) {
531
529
  throw (0, utils_1.createIOError)('ENOENT');
532
530
  }
@@ -548,10 +546,10 @@ class TestFileSystem {
548
546
  throw (0, utils_1.createIOError)('EROFS');
549
547
  }
550
548
  if (options === null || options === void 0 ? void 0 : options.recursive) {
551
- this.mkdirpSync(path);
549
+ this.mkdirpSync(path.getFilePath());
552
550
  return;
553
551
  }
554
- this._mkdir(this._walk(this._resolve(path), /* noFollow */ true));
552
+ this._mkdir(this._walk(this._resolve(path.getFilePath()), /* noFollow */ true));
555
553
  }
556
554
  /**
557
555
  * Remove a directory.
@@ -560,11 +558,11 @@ class TestFileSystem {
560
558
  *
561
559
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
562
560
  */
563
- rmdirSync(path) {
561
+ rmdirSync(uri) {
564
562
  if (this.isReadonly) {
565
563
  throw (0, utils_1.createIOError)('EROFS');
566
564
  }
567
- path = this._resolve(path);
565
+ const path = this._resolve(uri.getFilePath());
568
566
  const { parent, links, node, basename } = this._walk(path, /* noFollow */ true);
569
567
  if (!parent) {
570
568
  throw (0, utils_1.createIOError)('EPERM');
@@ -615,7 +613,7 @@ class TestFileSystem {
615
613
  if (this.isReadonly) {
616
614
  throw (0, utils_1.createIOError)('EROFS');
617
615
  }
618
- const { parent, links, node, basename } = this._walk(this._resolve(path), /* noFollow */ true);
616
+ const { parent, links, node, basename } = this._walk(this._resolve(path.getFilePath()), /* noFollow */ true);
619
617
  if (!parent) {
620
618
  throw (0, utils_1.createIOError)('EPERM');
621
619
  }
@@ -700,15 +698,15 @@ class TestFileSystem {
700
698
  */
701
699
  realpathSync(path) {
702
700
  try {
703
- const { realpath } = this._walk(this._resolve(path));
704
- return realpath;
701
+ const { realpath } = this._walk(this._resolve(path.getFilePath()));
702
+ return uri_1.Uri.file(realpath);
705
703
  }
706
704
  catch (e) {
707
705
  return path;
708
706
  }
709
707
  }
710
708
  readFileSync(path, encoding = null) {
711
- const { node } = this._walk(this._resolve(path));
709
+ const { node } = this._walk(this._resolve(path.getFilePath()));
712
710
  if (!node) {
713
711
  throw (0, utils_1.createIOError)('ENOENT');
714
712
  }
@@ -726,11 +724,11 @@ class TestFileSystem {
726
724
  *
727
725
  * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
728
726
  */
729
- writeFileSync(path, data, encoding = null) {
727
+ writeFileSync(uri, data, encoding = null) {
730
728
  if (this.isReadonly) {
731
729
  throw (0, utils_1.createIOError)('EROFS');
732
730
  }
733
- const { parent, links, node: existingNode, basename } = this._walk(this._resolve(path), /* noFollow */ false);
731
+ const { parent, links, node: existingNode, basename, } = this._walk(this._resolve(uri.getFilePath()), /* noFollow */ false);
734
732
  if (!parent) {
735
733
  throw (0, utils_1.createIOError)('EPERM');
736
734
  }
@@ -753,11 +751,11 @@ class TestFileSystem {
753
751
  node.mtimeMs = time;
754
752
  node.ctimeMs = time;
755
753
  }
756
- readFile(filePath) {
757
- return Promise.resolve(this.readFileSync(filePath));
754
+ readFile(fileUri) {
755
+ return Promise.resolve(this.readFileSync(fileUri));
758
756
  }
759
- readFileText(filePath, encoding) {
760
- return Promise.resolve(this.readFileSync(filePath, encoding || 'utf8'));
757
+ readFileText(fileUri, encoding) {
758
+ return Promise.resolve(this.readFileSync(fileUri, encoding || 'utf8'));
761
759
  }
762
760
  createReadStream(path) {
763
761
  throw new Error('Not implemented in test file system.');
@@ -829,7 +827,7 @@ class TestFileSystem {
829
827
  }
830
828
  if (axis === 'descendants-or-self' || axis === 'descendants') {
831
829
  if (stats.isDirectory() && (!traversal.traverse || traversal.traverse(path, stats))) {
832
- for (const file of this.readdirSync(path)) {
830
+ for (const file of this.readdirSync(uri_1.Uri.file(path))) {
833
831
  try {
834
832
  const childpath = pathUtil.combinePaths(path, file);
835
833
  const stats = this._stat(this._walk(childpath, noFollow));
@@ -1300,7 +1298,7 @@ class TestFileSystem {
1300
1298
  throw new TypeError('Roots cannot be files.');
1301
1299
  }
1302
1300
  this.mkdirpSync(pathUtil.getDirectoryPath(path));
1303
- this.writeFileSync(path, value.data, value.encoding);
1301
+ this.writeFileSync(uri_1.Uri.file(path), value.data, value.encoding);
1304
1302
  this._applyFileExtendedOptions(path, value);
1305
1303
  }
1306
1304
  else if (value instanceof Directory) {