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

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 (345) 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 +56 -52
  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 +29 -36
  13. package/dist/analyzer/codeFlowEngine.js.map +1 -1
  14. package/dist/analyzer/constraintSolver.js +3 -5
  15. package/dist/analyzer/constraintSolver.js.map +1 -1
  16. package/dist/analyzer/dataClasses.js +1 -1
  17. package/dist/analyzer/dataClasses.js.map +1 -1
  18. package/dist/analyzer/declaration.d.ts +5 -3
  19. package/dist/analyzer/declaration.js +3 -2
  20. package/dist/analyzer/declaration.js.map +1 -1
  21. package/dist/analyzer/declarationUtils.d.ts +3 -2
  22. package/dist/analyzer/declarationUtils.js +14 -12
  23. package/dist/analyzer/declarationUtils.js.map +1 -1
  24. package/dist/analyzer/enums.js +1 -1
  25. package/dist/analyzer/enums.js.map +1 -1
  26. package/dist/analyzer/importResolver.d.ts +29 -25
  27. package/dist/analyzer/importResolver.js +300 -301
  28. package/dist/analyzer/importResolver.js.map +1 -1
  29. package/dist/analyzer/importResult.d.ts +5 -4
  30. package/dist/analyzer/importResult.js.map +1 -1
  31. package/dist/analyzer/importStatementUtils.d.ts +5 -4
  32. package/dist/analyzer/importStatementUtils.js +23 -22
  33. package/dist/analyzer/importStatementUtils.js.map +1 -1
  34. package/dist/analyzer/namedTuples.js +3 -3
  35. package/dist/analyzer/namedTuples.js.map +1 -1
  36. package/dist/analyzer/packageTypeReport.d.ts +7 -6
  37. package/dist/analyzer/packageTypeReport.js +4 -4
  38. package/dist/analyzer/packageTypeReport.js.map +1 -1
  39. package/dist/analyzer/packageTypeVerifier.js +68 -64
  40. package/dist/analyzer/packageTypeVerifier.js.map +1 -1
  41. package/dist/analyzer/parentDirectoryCache.d.ts +7 -6
  42. package/dist/analyzer/parentDirectoryCache.js +9 -10
  43. package/dist/analyzer/parentDirectoryCache.js.map +1 -1
  44. package/dist/analyzer/parseTreeUtils.d.ts +1 -1
  45. package/dist/analyzer/parseTreeUtils.js +6 -3
  46. package/dist/analyzer/parseTreeUtils.js.map +1 -1
  47. package/dist/analyzer/patternMatching.js +79 -14
  48. package/dist/analyzer/patternMatching.js.map +1 -1
  49. package/dist/analyzer/program.d.ts +27 -26
  50. package/dist/analyzer/program.js +162 -156
  51. package/dist/analyzer/program.js.map +1 -1
  52. package/dist/analyzer/properties.js +3 -3
  53. package/dist/analyzer/properties.js.map +1 -1
  54. package/dist/analyzer/pyTypedUtils.d.ts +3 -2
  55. package/dist/analyzer/pyTypedUtils.js +4 -5
  56. package/dist/analyzer/pyTypedUtils.js.map +1 -1
  57. package/dist/analyzer/pythonPathUtils.d.ts +7 -6
  58. package/dist/analyzer/pythonPathUtils.js +21 -23
  59. package/dist/analyzer/pythonPathUtils.js.map +1 -1
  60. package/dist/analyzer/service.d.ts +24 -23
  61. package/dist/analyzer/service.js +187 -183
  62. package/dist/analyzer/service.js.map +1 -1
  63. package/dist/analyzer/sourceFile.d.ts +4 -5
  64. package/dist/analyzer/sourceFile.js +68 -56
  65. package/dist/analyzer/sourceFile.js.map +1 -1
  66. package/dist/analyzer/sourceFileInfoUtils.js +3 -3
  67. package/dist/analyzer/sourceFileInfoUtils.js.map +1 -1
  68. package/dist/analyzer/sourceMapper.d.ts +11 -10
  69. package/dist/analyzer/sourceMapper.js +59 -62
  70. package/dist/analyzer/sourceMapper.js.map +1 -1
  71. package/dist/analyzer/sourceMapperUtils.d.ts +2 -1
  72. package/dist/analyzer/sourceMapperUtils.js +2 -2
  73. package/dist/analyzer/sourceMapperUtils.js.map +1 -1
  74. package/dist/analyzer/tracePrinter.d.ts +3 -2
  75. package/dist/analyzer/tracePrinter.js +21 -23
  76. package/dist/analyzer/tracePrinter.js.map +1 -1
  77. package/dist/analyzer/typeDocStringUtils.d.ts +2 -1
  78. package/dist/analyzer/typeDocStringUtils.js +14 -17
  79. package/dist/analyzer/typeDocStringUtils.js.map +1 -1
  80. package/dist/analyzer/typeEvaluator.js +172 -102
  81. package/dist/analyzer/typeEvaluator.js.map +1 -1
  82. package/dist/analyzer/typeGuards.js +3 -3
  83. package/dist/analyzer/typeGuards.js.map +1 -1
  84. package/dist/analyzer/typePrinter.d.ts +2 -0
  85. package/dist/analyzer/typePrinter.js +48 -8
  86. package/dist/analyzer/typePrinter.js.map +1 -1
  87. package/dist/analyzer/typeStubWriter.d.ts +2 -1
  88. package/dist/analyzer/typeStubWriter.js +2 -2
  89. package/dist/analyzer/typeStubWriter.js.map +1 -1
  90. package/dist/analyzer/typeUtils.d.ts +4 -2
  91. package/dist/analyzer/typeUtils.js +16 -5
  92. package/dist/analyzer/typeUtils.js.map +1 -1
  93. package/dist/analyzer/typedDicts.js +4 -4
  94. package/dist/analyzer/typedDicts.js.map +1 -1
  95. package/dist/analyzer/types.d.ts +5 -4
  96. package/dist/analyzer/types.js +4 -4
  97. package/dist/analyzer/types.js.map +1 -1
  98. package/dist/backgroundAnalysis.d.ts +1 -2
  99. package/dist/backgroundAnalysis.js +6 -4
  100. package/dist/backgroundAnalysis.js.map +1 -1
  101. package/dist/backgroundAnalysisBase.d.ts +22 -20
  102. package/dist/backgroundAnalysisBase.js +76 -55
  103. package/dist/backgroundAnalysisBase.js.map +1 -1
  104. package/dist/backgroundThreadBase.d.ts +1 -1
  105. package/dist/backgroundThreadBase.js +20 -11
  106. package/dist/backgroundThreadBase.js.map +1 -1
  107. package/dist/commands/createTypeStub.js +3 -2
  108. package/dist/commands/createTypeStub.js.map +1 -1
  109. package/dist/commands/dumpFileDebugInfoCommand.js +21 -20
  110. package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
  111. package/dist/commands/quickActionCommand.js +5 -5
  112. package/dist/commands/quickActionCommand.js.map +1 -1
  113. package/dist/common/configOptions.d.ts +14 -13
  114. package/dist/common/configOptions.js +29 -27
  115. package/dist/common/configOptions.js.map +1 -1
  116. package/dist/common/diagnostic.d.ts +6 -5
  117. package/dist/common/diagnostic.js +2 -2
  118. package/dist/common/diagnostic.js.map +1 -1
  119. package/dist/common/diagnosticSink.d.ts +2 -1
  120. package/dist/common/diagnosticSink.js.map +1 -1
  121. package/dist/common/editAction.d.ts +6 -5
  122. package/dist/common/editAction.js +2 -2
  123. package/dist/common/editAction.js.map +1 -1
  124. package/dist/common/envVarUtils.d.ts +2 -1
  125. package/dist/common/envVarUtils.js +20 -28
  126. package/dist/common/envVarUtils.js.map +1 -1
  127. package/dist/common/extensibility.d.ts +19 -19
  128. package/dist/common/extensibility.js.map +1 -1
  129. package/dist/common/fileSystem.d.ts +29 -28
  130. package/dist/common/fileWatcher.d.ts +3 -2
  131. package/dist/common/fileWatcher.js.map +1 -1
  132. package/dist/common/fullAccessHost.d.ts +8 -7
  133. package/dist/common/fullAccessHost.js +21 -16
  134. package/dist/common/fullAccessHost.js.map +1 -1
  135. package/dist/common/host.d.ts +7 -6
  136. package/dist/common/host.js +1 -1
  137. package/dist/common/host.js.map +1 -1
  138. package/dist/common/logTracker.d.ts +2 -1
  139. package/dist/common/logTracker.js +4 -4
  140. package/dist/common/logTracker.js.map +1 -1
  141. package/dist/common/pathUtils.d.ts +1 -28
  142. package/dist/common/pathUtils.js +17 -366
  143. package/dist/common/pathUtils.js.map +1 -1
  144. package/dist/common/realFileSystem.d.ts +7 -3
  145. package/dist/common/realFileSystem.js +78 -60
  146. package/dist/common/realFileSystem.js.map +1 -1
  147. package/dist/common/serviceProviderExtensions.d.ts +2 -1
  148. package/dist/common/serviceProviderExtensions.js +5 -2
  149. package/dist/common/serviceProviderExtensions.js.map +1 -1
  150. package/dist/common/textEditTracker.d.ts +2 -1
  151. package/dist/common/textEditTracker.js +28 -28
  152. package/dist/common/textEditTracker.js.map +1 -1
  153. package/dist/common/textRange.d.ts +2 -1
  154. package/dist/common/textRange.js.map +1 -1
  155. package/dist/common/uri/baseUri.d.ts +51 -0
  156. package/dist/common/uri/baseUri.js +194 -0
  157. package/dist/common/uri/baseUri.js.map +1 -0
  158. package/dist/common/uri/emptyUri.d.ts +32 -0
  159. package/dist/common/uri/emptyUri.js +122 -0
  160. package/dist/common/uri/emptyUri.js.map +1 -0
  161. package/dist/common/uri/fileUri.d.ts +36 -0
  162. package/dist/common/uri/fileUri.js +180 -0
  163. package/dist/common/uri/fileUri.js.map +1 -0
  164. package/dist/common/uri/memoization.d.ts +3 -0
  165. package/dist/common/uri/memoization.js +72 -0
  166. package/dist/common/uri/memoization.js.map +1 -0
  167. package/dist/common/uri/uri.d.ts +50 -0
  168. package/dist/common/uri/uri.js +104 -0
  169. package/dist/common/uri/uri.js.map +1 -0
  170. package/dist/common/uri/uriUtils.d.ts +39 -0
  171. package/dist/common/uri/uriUtils.js +362 -0
  172. package/dist/common/uri/uriUtils.js.map +1 -0
  173. package/dist/common/uri/webUri.d.ts +36 -0
  174. package/dist/common/uri/webUri.js +207 -0
  175. package/dist/common/uri/webUri.js.map +1 -0
  176. package/dist/common/workspaceEditUtils.d.ts +8 -8
  177. package/dist/common/workspaceEditUtils.js +34 -37
  178. package/dist/common/workspaceEditUtils.js.map +1 -1
  179. package/dist/languageServerBase.d.ts +19 -22
  180. package/dist/languageServerBase.js +91 -95
  181. package/dist/languageServerBase.js.map +1 -1
  182. package/dist/languageService/analyzerServiceExecutor.d.ts +2 -1
  183. package/dist/languageService/analyzerServiceExecutor.js +14 -16
  184. package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
  185. package/dist/languageService/autoImporter.d.ts +11 -9
  186. package/dist/languageService/autoImporter.js +45 -44
  187. package/dist/languageService/autoImporter.js.map +1 -1
  188. package/dist/languageService/callHierarchyProvider.d.ts +3 -2
  189. package/dist/languageService/callHierarchyProvider.js +23 -35
  190. package/dist/languageService/callHierarchyProvider.js.map +1 -1
  191. package/dist/languageService/codeActionProvider.d.ts +2 -1
  192. package/dist/languageService/codeActionProvider.js +8 -10
  193. package/dist/languageService/codeActionProvider.js.map +1 -1
  194. package/dist/languageService/completionProvider.d.ts +7 -6
  195. package/dist/languageService/completionProvider.js +32 -30
  196. package/dist/languageService/completionProvider.js.map +1 -1
  197. package/dist/languageService/completionProviderUtils.d.ts +2 -1
  198. package/dist/languageService/completionProviderUtils.js +1 -1
  199. package/dist/languageService/completionProviderUtils.js.map +1 -1
  200. package/dist/languageService/definitionProvider.d.ts +4 -3
  201. package/dist/languageService/definitionProvider.js +26 -24
  202. package/dist/languageService/definitionProvider.js.map +1 -1
  203. package/dist/languageService/documentHighlightProvider.d.ts +3 -2
  204. package/dist/languageService/documentHighlightProvider.js +3 -3
  205. package/dist/languageService/documentHighlightProvider.js.map +1 -1
  206. package/dist/languageService/documentSymbolCollector.js +8 -7
  207. package/dist/languageService/documentSymbolCollector.js.map +1 -1
  208. package/dist/languageService/documentSymbolProvider.d.ts +5 -4
  209. package/dist/languageService/documentSymbolProvider.js +9 -11
  210. package/dist/languageService/documentSymbolProvider.js.map +1 -1
  211. package/dist/languageService/hoverProvider.d.ts +4 -3
  212. package/dist/languageService/hoverProvider.js +6 -5
  213. package/dist/languageService/hoverProvider.js.map +1 -1
  214. package/dist/languageService/navigationUtils.d.ts +2 -1
  215. package/dist/languageService/navigationUtils.js +2 -3
  216. package/dist/languageService/navigationUtils.js.map +1 -1
  217. package/dist/languageService/quickActions.d.ts +2 -1
  218. package/dist/languageService/quickActions.js +3 -3
  219. package/dist/languageService/quickActions.js.map +1 -1
  220. package/dist/languageService/referencesProvider.d.ts +10 -9
  221. package/dist/languageService/referencesProvider.js +28 -28
  222. package/dist/languageService/referencesProvider.js.map +1 -1
  223. package/dist/languageService/renameProvider.d.ts +4 -3
  224. package/dist/languageService/renameProvider.js +17 -18
  225. package/dist/languageService/renameProvider.js.map +1 -1
  226. package/dist/languageService/signatureHelpProvider.d.ts +3 -2
  227. package/dist/languageService/signatureHelpProvider.js +4 -4
  228. package/dist/languageService/signatureHelpProvider.js.map +1 -1
  229. package/dist/languageService/symbolIndexer.d.ts +2 -1
  230. package/dist/languageService/symbolIndexer.js +1 -1
  231. package/dist/languageService/symbolIndexer.js.map +1 -1
  232. package/dist/languageService/tooltipUtils.js +10 -4
  233. package/dist/languageService/tooltipUtils.js.map +1 -1
  234. package/dist/languageService/workspaceSymbolProvider.d.ts +4 -3
  235. package/dist/languageService/workspaceSymbolProvider.js +10 -11
  236. package/dist/languageService/workspaceSymbolProvider.js.map +1 -1
  237. package/dist/localization/localize.d.ts +1 -0
  238. package/dist/localization/localize.js +1 -0
  239. package/dist/localization/localize.js.map +1 -1
  240. package/dist/localization/package.nls.en-us.json +2 -1
  241. package/dist/pyright.js +18 -17
  242. package/dist/pyright.js.map +1 -1
  243. package/dist/pyrightFileSystem.d.ts +13 -13
  244. package/dist/pyrightFileSystem.js +38 -43
  245. package/dist/pyrightFileSystem.js.map +1 -1
  246. package/dist/readonlyAugmentedFileSystem.d.ts +29 -28
  247. package/dist/readonlyAugmentedFileSystem.js +62 -65
  248. package/dist/readonlyAugmentedFileSystem.js.map +1 -1
  249. package/dist/server.js +21 -20
  250. package/dist/server.js.map +1 -1
  251. package/dist/tests/chainedSourceFiles.test.js +39 -30
  252. package/dist/tests/chainedSourceFiles.test.js.map +1 -1
  253. package/dist/tests/checker.test.js +31 -30
  254. package/dist/tests/checker.test.js.map +1 -1
  255. package/dist/tests/completions.test.js +7 -3
  256. package/dist/tests/completions.test.js.map +1 -1
  257. package/dist/tests/config.test.js +24 -22
  258. package/dist/tests/config.test.js.map +1 -1
  259. package/dist/tests/documentSymbolCollector.test.js +3 -2
  260. package/dist/tests/documentSymbolCollector.test.js.map +1 -1
  261. package/dist/tests/filesystem.test.js +37 -35
  262. package/dist/tests/filesystem.test.js.map +1 -1
  263. package/dist/tests/fourSlashParser.test.js +4 -4
  264. package/dist/tests/fourSlashParser.test.js.map +1 -1
  265. package/dist/tests/fourslash/hover.docstring.alias.fourslash.js +27 -11
  266. package/dist/tests/fourslash/hover.docstring.alias.fourslash.js.map +1 -1
  267. package/dist/tests/harness/fourslash/fourSlashParser.js +2 -2
  268. package/dist/tests/harness/fourslash/fourSlashParser.js.map +1 -1
  269. package/dist/tests/harness/fourslash/testLanguageService.d.ts +4 -5
  270. package/dist/tests/harness/fourslash/testLanguageService.js +9 -15
  271. package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -1
  272. package/dist/tests/harness/fourslash/testState.d.ts +4 -4
  273. package/dist/tests/harness/fourslash/testState.js +91 -51
  274. package/dist/tests/harness/fourslash/testState.js.map +1 -1
  275. package/dist/tests/harness/testAccessHost.d.ts +3 -2
  276. package/dist/tests/harness/testAccessHost.js +2 -1
  277. package/dist/tests/harness/testAccessHost.js.map +1 -1
  278. package/dist/tests/harness/testHost.js +13 -11
  279. package/dist/tests/harness/testHost.js.map +1 -1
  280. package/dist/tests/harness/vfs/factory.d.ts +3 -2
  281. package/dist/tests/harness/vfs/factory.js +5 -4
  282. package/dist/tests/harness/vfs/factory.js.map +1 -1
  283. package/dist/tests/harness/vfs/filesystem.d.ts +32 -31
  284. package/dist/tests/harness/vfs/filesystem.js +47 -49
  285. package/dist/tests/harness/vfs/filesystem.js.map +1 -1
  286. package/dist/tests/harness/vfs/pathValidation.js +1 -10
  287. package/dist/tests/harness/vfs/pathValidation.js.map +1 -1
  288. package/dist/tests/importResolver.test.js +81 -58
  289. package/dist/tests/importResolver.test.js.map +1 -1
  290. package/dist/tests/importStatementUtils.test.js +10 -9
  291. package/dist/tests/importStatementUtils.test.js.map +1 -1
  292. package/dist/tests/ipythonMode.test.js +12 -11
  293. package/dist/tests/ipythonMode.test.js.map +1 -1
  294. package/dist/tests/logger.test.js +2 -1
  295. package/dist/tests/logger.test.js.map +1 -1
  296. package/dist/tests/parseTreeUtils.test.js +2 -1
  297. package/dist/tests/parseTreeUtils.test.js.map +1 -1
  298. package/dist/tests/pathUtils.test.js +3 -138
  299. package/dist/tests/pathUtils.test.js.map +1 -1
  300. package/dist/tests/pyrightFileSystem.test.js +38 -34
  301. package/dist/tests/pyrightFileSystem.test.js.map +1 -1
  302. package/dist/tests/service.test.js +37 -42
  303. package/dist/tests/service.test.js.map +1 -1
  304. package/dist/tests/signatureHelp.test.js +3 -2
  305. package/dist/tests/signatureHelp.test.js.map +1 -1
  306. package/dist/tests/sourceFile.test.js +8 -7
  307. package/dist/tests/sourceFile.test.js.map +1 -1
  308. package/dist/tests/sourceMapperUtils.test.js +13 -6
  309. package/dist/tests/sourceMapperUtils.test.js.map +1 -1
  310. package/dist/tests/testState.test.js +13 -9
  311. package/dist/tests/testState.test.js.map +1 -1
  312. package/dist/tests/testStateUtils.d.ts +2 -5
  313. package/dist/tests/testStateUtils.js +27 -64
  314. package/dist/tests/testStateUtils.js.map +1 -1
  315. package/dist/tests/testUtils.d.ts +3 -5
  316. package/dist/tests/testUtils.js +15 -64
  317. package/dist/tests/testUtils.js.map +1 -1
  318. package/dist/tests/textEditUtil.test.js +4 -3
  319. package/dist/tests/textEditUtil.test.js.map +1 -1
  320. package/dist/tests/typeEvaluator1.test.js +16 -15
  321. package/dist/tests/typeEvaluator1.test.js.map +1 -1
  322. package/dist/tests/typeEvaluator2.test.js +18 -9
  323. package/dist/tests/typeEvaluator2.test.js.map +1 -1
  324. package/dist/tests/typeEvaluator3.test.js +73 -62
  325. package/dist/tests/typeEvaluator3.test.js.map +1 -1
  326. package/dist/tests/typeEvaluator4.test.js +20 -19
  327. package/dist/tests/typeEvaluator4.test.js.map +1 -1
  328. package/dist/tests/typeEvaluator5.test.js +28 -27
  329. package/dist/tests/typeEvaluator5.test.js.map +1 -1
  330. package/dist/tests/typePrinter.test.js +4 -3
  331. package/dist/tests/typePrinter.test.js.map +1 -1
  332. package/dist/tests/uri.test.d.ts +1 -0
  333. package/dist/tests/uri.test.js +695 -0
  334. package/dist/tests/uri.test.js.map +1 -0
  335. package/dist/tests/workspaceEditUtils.test.js +28 -28
  336. package/dist/tests/workspaceEditUtils.test.js.map +1 -1
  337. package/dist/tests/zipfs.test.js +11 -11
  338. package/dist/tests/zipfs.test.js.map +1 -1
  339. package/dist/workspaceFactory.d.ts +13 -14
  340. package/dist/workspaceFactory.js +54 -55
  341. package/dist/workspaceFactory.js.map +1 -1
  342. package/package.json +2 -2
  343. package/dist/common/uriParser.d.ts +0 -24
  344. package/dist/common/uriParser.js +0 -45
  345. package/dist/common/uriParser.js.map +0 -1
@@ -0,0 +1,3 @@
1
+ export declare function cacheProperty(): (target: any, functionName: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
2
+ export declare function cacheMethodWithNoArgs(): (target: any, functionName: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
3
+ export declare function cacheStaticFunc(): (target: any, functionName: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ /*
3
+ * memoization.ts
4
+ * Copyright (c) Microsoft Corporation.
5
+ * Licensed under the MIT license.
6
+ *
7
+ * Decorators used to memoize the result of a function call.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.cacheStaticFunc = exports.cacheMethodWithNoArgs = exports.cacheProperty = void 0;
11
+ // Cache for static method results.
12
+ const staticCache = new Map();
13
+ // Caches the results of a getter property.
14
+ function cacheProperty() {
15
+ return function (target, functionName, descriptor) {
16
+ const originalMethod = descriptor.get;
17
+ descriptor.get = function (...args) {
18
+ // Call the function once to get the result.
19
+ const result = originalMethod.apply(this, args);
20
+ // Then we replace the original function with one that just returns the result.
21
+ Object.defineProperty(this, functionName, {
22
+ get() {
23
+ return result;
24
+ },
25
+ });
26
+ return result;
27
+ };
28
+ return descriptor;
29
+ };
30
+ }
31
+ exports.cacheProperty = cacheProperty;
32
+ // Caches the results of method that takes no args.
33
+ // This situation can be optimized because the parameters are always the same.
34
+ function cacheMethodWithNoArgs() {
35
+ return function (target, functionName, descriptor) {
36
+ const originalMethod = descriptor.value;
37
+ descriptor.value = function (...args) {
38
+ // Call the function once to get the result.
39
+ const result = originalMethod.apply(this, args);
40
+ // Then we replace the original function with one that just returns the result.
41
+ this[functionName] = () => {
42
+ // Note that this poses a risk. The result is passed by reference, so if the caller
43
+ // modifies the result, it will modify the cached result.
44
+ return result;
45
+ };
46
+ return result;
47
+ };
48
+ return descriptor;
49
+ };
50
+ }
51
+ exports.cacheMethodWithNoArgs = cacheMethodWithNoArgs;
52
+ // Create a decorator to cache the results of a static method.
53
+ function cacheStaticFunc() {
54
+ return function cacheStaticFunc_Fast(target, functionName, descriptor) {
55
+ const originalMethod = descriptor.value;
56
+ descriptor.value = function (...args) {
57
+ const key = `${functionName}+${args.map((a) => a === null || a === void 0 ? void 0 : a.toString()).join(',')}`;
58
+ let cachedResult;
59
+ if (!staticCache.has(key)) {
60
+ cachedResult = originalMethod.apply(this, args);
61
+ staticCache.set(key, cachedResult);
62
+ }
63
+ else {
64
+ cachedResult = staticCache.get(key);
65
+ }
66
+ return cachedResult;
67
+ };
68
+ return descriptor;
69
+ };
70
+ }
71
+ exports.cacheStaticFunc = cacheStaticFunc;
72
+ //# sourceMappingURL=memoization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoization.js","sourceRoot":"","sources":["../../../../src/common/uri/memoization.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,mCAAmC;AACnC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAe,CAAC;AAE3C,2CAA2C;AAC3C,SAAgB,aAAa;IACzB,OAAO,UAAU,MAAW,EAAE,YAAoB,EAAE,UAA8B;QAC9E,MAAM,cA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AC,CAAM,EAAE,EAAE,CAAC,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/E,IAAI,YAAiB,CAAC;YACtB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBACvB,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBAChD,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;aACtC;iBAAM;gBACH,YAAY,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aACvC;YACD,OAAO,YAAY,CAAC;QACxB,CAAC,CAAC;QACF,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC;AAhBD,0CAgBC"}
@@ -0,0 +1,50 @@
1
+ export interface Uri {
2
+ readonly key: string;
3
+ readonly scheme: string;
4
+ readonly fileName: string;
5
+ readonly lastExtension: string;
6
+ readonly root: Uri;
7
+ readonly packageUri: Uri;
8
+ readonly packageStubUri: Uri;
9
+ readonly initPyUri: Uri;
10
+ readonly initPyiUri: Uri;
11
+ readonly pytypedUri: Uri;
12
+ readonly fileNameWithoutExtension: string;
13
+ readonly isCaseSensitive: boolean;
14
+ isEmpty(): boolean;
15
+ toString(): string;
16
+ toUserVisibleString(): string;
17
+ isRoot(): boolean;
18
+ isChild(parent: Uri): boolean;
19
+ isLocal(): boolean;
20
+ isUntitled(): boolean;
21
+ equals(other: Uri | undefined): boolean;
22
+ startsWith(other: Uri | undefined): boolean;
23
+ pathStartsWith(name: string): boolean;
24
+ pathEndsWith(name: string): boolean;
25
+ pathIncludes(include: string): boolean;
26
+ matchesRegex(regex: RegExp): boolean;
27
+ addPath(extra: string): Uri;
28
+ getDirectory(): Uri;
29
+ getRootPathLength(): number;
30
+ getPathLength(): number;
31
+ combinePaths(...paths: string[]): Uri;
32
+ getRelativePath(child: Uri): string | undefined;
33
+ getPathComponents(): readonly string[];
34
+ getPath(): string;
35
+ getFilePath(): string;
36
+ getRelativePathComponents(to: Uri): readonly string[];
37
+ getShortenedFileName(maxDirLength?: number): string;
38
+ stripExtension(): Uri;
39
+ stripAllExtensions(): Uri;
40
+ replaceExtension(ext: string): Uri;
41
+ addExtension(ext: string): Uri;
42
+ hasExtension(ext: string): boolean;
43
+ }
44
+ export declare namespace Uri {
45
+ function file(path: string, isCaseSensitive?: boolean, checkRelative?: boolean): Uri;
46
+ function empty(): Uri;
47
+ function fromJsonObj(jsonObj: any): any;
48
+ function parse(value: string | undefined, isCaseSensitive: boolean): Uri;
49
+ function isUri(thing: any): thing is Uri;
50
+ }
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ /*
3
+ * uri.ts
4
+ * Copyright (c) Microsoft Corporation.
5
+ * Licensed under the MIT license.
6
+ *
7
+ * URI namespace for storing and manipulating URIs.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.Uri = void 0;
11
+ const vscode_uri_1 = require("vscode-uri");
12
+ const pathUtils_1 = require("../pathUtils");
13
+ const emptyUri_1 = require("./emptyUri");
14
+ const fileUri_1 = require("./fileUri");
15
+ const webUri_1 = require("./webUri");
16
+ // Returns just the fsPath path portion of a vscode URI.
17
+ function getFilePath(uri) {
18
+ let filePath;
19
+ // Compute the file path ourselves. The vscode.URI class doesn't
20
+ // treat UNC shares with a single slash as UNC paths.
21
+ // https://github.com/microsoft/vscode-uri/blob/53e4ca6263f2e4ddc35f5360c62bc1b1d30f27dd/src/uri.ts#L567
22
+ if (uri.authority && uri.path[0] === '/' && uri.path.length === 1) {
23
+ filePath = `//${uri.authority}${uri.path}`;
24
+ }
25
+ else {
26
+ // Otherwise use the vscode.URI version
27
+ filePath = uri.fsPath;
28
+ }
29
+ // If this is a DOS-style path with a drive letter, remove
30
+ // the leading slash.
31
+ if (filePath.match(/^\/[a-zA-Z]:\//)) {
32
+ filePath = filePath.slice(1);
33
+ }
34
+ // vscode.URI normalizes the path to use the correct path separators.
35
+ // We need to do the same.
36
+ if (process.platform === 'win32') {
37
+ filePath = filePath.replace(/\//g, '\\');
38
+ }
39
+ return filePath;
40
+ }
41
+ // Function called to normalize input URIs. This gets rid of '..' and '.' in the path.
42
+ // It also removes any '/' on the end of the path.
43
+ // This is slow but should only be called when the URI is first created.
44
+ function normalizeUri(uri) {
45
+ // Make sure the drive letter is lower case. This
46
+ // is consistent with what VS code does for URIs.
47
+ let originalString = vscode_uri_1.URI.isUri(uri) ? uri.toString() : uri;
48
+ const parsed = vscode_uri_1.URI.isUri(uri) ? uri : vscode_uri_1.URI.parse(uri);
49
+ if (parsed.scheme === 'file') {
50
+ // The Vscode.URI parser makes sure the drive is lower cased.
51
+ originalString = parsed.toString();
52
+ }
53
+ // Original URI may not have resolved all the `..` in the path, so remove them.
54
+ // Note: this also has the effect of removing any trailing slashes.
55
+ const finalURI = vscode_uri_1.Utils.resolvePath(parsed);
56
+ const finalString = finalURI.path.length !== parsed.path.length ? finalURI.toString() : originalString;
57
+ return { uri: finalURI, str: finalString };
58
+ }
59
+ var Uri;
60
+ (function (Uri) {
61
+ function file(path, isCaseSensitive = true, checkRelative = false) {
62
+ // Fix path if we're checking for relative paths and this is not a rooted path.
63
+ path = checkRelative && !(0, pathUtils_1.isRootedDiskPath)(path) ? (0, pathUtils_1.combinePaths)(process.cwd(), path) : path;
64
+ // If this already starts with 'file:', then we can
65
+ // parse it normally. It's actually a uri string. Otherwise parse it as a file path.
66
+ const normalized = path.startsWith('file:') ? normalizeUri(path) : normalizeUri(vscode_uri_1.URI.file(path));
67
+ // Turn the path into a file URI.
68
+ return fileUri_1.FileUri.createFileUri(getFilePath(normalized.uri), normalized.uri.query, normalized.uri.fragment, normalized.str, isCaseSensitive);
69
+ }
70
+ Uri.file = file;
71
+ function empty() {
72
+ return emptyUri_1.EmptyUri.instance;
73
+ }
74
+ Uri.empty = empty;
75
+ function fromJsonObj(jsonObj) {
76
+ if (fileUri_1.FileUri.isFileUri(jsonObj)) {
77
+ return fileUri_1.FileUri.fromJsonObj(jsonObj);
78
+ }
79
+ if (webUri_1.WebUri.isWebUri(jsonObj)) {
80
+ return webUri_1.WebUri.fromJsonObj(jsonObj);
81
+ }
82
+ return jsonObj;
83
+ }
84
+ Uri.fromJsonObj = fromJsonObj;
85
+ function parse(value, isCaseSensitive) {
86
+ if (!value) {
87
+ return Uri.empty();
88
+ }
89
+ // Normalize the value here. This gets rid of '..' and '.' in the path. It also removes any
90
+ // '/' on the end of the path.
91
+ const normalized = normalizeUri(value);
92
+ if (normalized.uri.scheme === 'file') {
93
+ return fileUri_1.FileUri.createFileUri(getFilePath(normalized.uri), normalized.uri.query, normalized.uri.fragment, normalized.str, isCaseSensitive);
94
+ }
95
+ // Web URIs are always case sensitive.
96
+ return webUri_1.WebUri.createWebUri(normalized.uri.scheme, normalized.uri.authority, normalized.uri.path, normalized.uri.query, normalized.uri.fragment, normalized.str);
97
+ }
98
+ Uri.parse = parse;
99
+ function isUri(thing) {
100
+ return !!thing && typeof thing._key === 'string';
101
+ }
102
+ Uri.isUri = isUri;
103
+ })(Uri || (exports.Uri = Uri = {}));
104
+ //# sourceMappingURL=uri.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uri.js","sourceRoot":"","sources":["../../../../src/common/uri/uri.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,2CAAwC;AACxC,4CAA8D;AAC9D,yCAAsC;AACtC,uCAAoC;AACpC,qCAAkC;AAkGlC,wDAAwD;AACxD,SAAS,WAAW,CAAC,GAAQ;IACzB,IAAI,QAA4B,CAAC;IAEjC,gEAAgE;IAChE,qDAAqD;IACrD,wGAAwG;IACxG,IAAI,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QAC/D,QAAQ,GAAG,KAAK,GAAG,CAAC,S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C;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IARe,eAAW,cAQ1B,CAAA;IAED,SAAgB,KAAK,CAAC,KAAyB,EAAE,eAAwB;QACrE,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,GAAG,CAAC,KAAK,EAAE,CAAC;SACtB;QAED,2FAA2F;QAC3F,8BAA8B;QAC9B,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE;YAClC,OAAO,iBAAO,CAAC,aAAa,CACxB,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,EAC3B,UAAU,CAAC,GAAG,CAAC,KAAK,EACpB,UAAU,CAAC,GAAG,CAAC,QAAQ,EACvB,UAAU,CAAC,GAAG,EACd,eAAe,CAClB,CAAC;SACL;QAED,sCAAsC;QACtC,OAAO,eAAM,CAAC,YAAY,CACtB,UAAU,CAAC,GAAG,CAAC,MAAM,EACrB,UAAU,CAAC,GAAG,CAAC,SAAS,EACxB,UAAU,CAAC,GAAG,CAAC,IAAI,EACnB,UAAU,CAAC,GAAG,CAAC,KAAK,EACpB,UAAU,CAAC,GAAG,CAAC,QAAQ,EACvB,UAAU,CAAC,GAAG,CACjB,CAAC;IACN,CAAC;IA3Be,SAAK,QA2BpB,CAAA;IAED,SAAgB,KAAK,CAAC,KAAU;QAC5B,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;IACrD,CAAC;IAFe,SAAK,QAEpB,CAAA;AACL,CAAC,EAjEgB,GAAG,mBAAH,GAAG,QAiEnB"}
@@ -0,0 +1,39 @@
1
+ /// <reference types="node" />
2
+ import type { Dirent } from 'fs';
3
+ import { FileSystem, ReadOnlyFileSystem, Stats, TempFile } from '../fileSystem';
4
+ import { Uri } from './uri';
5
+ export interface FileSpec {
6
+ wildcardRoot: Uri;
7
+ regExp: RegExp;
8
+ hasDirectoryWildcard: boolean;
9
+ }
10
+ export declare namespace FileSpec {
11
+ function is(value: any): value is FileSpec;
12
+ function isInPath(uri: Uri, paths: FileSpec[]): boolean;
13
+ function matchesIncludeFileRegex(uri: Uri, isFile?: boolean): boolean;
14
+ function matchIncludeFileSpec(includeRegExp: RegExp, exclude: FileSpec[], uri: Uri, isFile?: boolean): boolean;
15
+ }
16
+ export interface FileSystemEntries {
17
+ files: Uri[];
18
+ directories: Uri[];
19
+ }
20
+ export declare function forEachAncestorDirectory(directory: Uri, callback: (directory: Uri) => Uri | undefined): Uri | undefined;
21
+ export declare function makeDirectories(fs: FileSystem, dir: Uri, startingFrom: Uri): void;
22
+ export declare function getFileSize(fs: ReadOnlyFileSystem, uri: Uri): number;
23
+ export declare function fileExists(fs: ReadOnlyFileSystem, uri: Uri): boolean;
24
+ export declare function directoryExists(fs: ReadOnlyFileSystem, uri: Uri): boolean;
25
+ export declare function isDirectory(fs: ReadOnlyFileSystem, uri: Uri): boolean;
26
+ export declare function isFile(fs: ReadOnlyFileSystem, uri: Uri, treatZipDirectoryAsFile?: boolean): boolean;
27
+ export declare function tryStat(fs: ReadOnlyFileSystem, uri: Uri): Stats | undefined;
28
+ export declare function tryRealpath(fs: ReadOnlyFileSystem, uri: Uri): Uri | undefined;
29
+ export declare function getFileSystemEntries(fs: ReadOnlyFileSystem, uri: Uri): FileSystemEntries;
30
+ export declare function getFileSystemEntriesFromDirEntries(dirEntries: Dirent[], fs: ReadOnlyFileSystem, uri: Uri): FileSystemEntries;
31
+ export declare function setTestingMode(underTest: boolean): void;
32
+ export declare function getWildcardRegexPattern(root: Uri, fileSpec: string): string;
33
+ export declare function getWildcardRoot(root: Uri, fileSpec: string): Uri;
34
+ export declare function hasPythonExtension(uri: Uri): boolean;
35
+ export declare function getFileSpec(root: Uri, fileSpec: string): FileSpec;
36
+ export declare function isFileSystemCaseSensitive(fs: FileSystem, tmp: TempFile | undefined): boolean;
37
+ export declare function isFileSystemCaseSensitiveInternal(fs: FileSystem, tmp: TempFile): boolean;
38
+ export declare function deduplicateFolders(listOfFolders: Uri[][]): Uri[];
39
+ export declare function getRootUri(isCaseSensitive: boolean): Uri | undefined;
@@ -0,0 +1,362 @@
1
+ "use strict";
2
+ /*
3
+ * uriUtils.ts
4
+ * Copyright (c) Microsoft Corporation.
5
+ * Licensed under the MIT license.
6
+ *
7
+ * Utility functions for manipulating URIs.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.getRootUri = exports.deduplicateFolders = exports.isFileSystemCaseSensitiveInternal = exports.isFileSystemCaseSensitive = exports.getFileSpec = exports.hasPythonExtension = exports.getWildcardRoot = exports.getWildcardRegexPattern = exports.setTestingMode = exports.getFileSystemEntriesFromDirEntries = exports.getFileSystemEntries = exports.tryRealpath = exports.tryStat = exports.isFile = exports.isDirectory = exports.directoryExists = exports.fileExists = exports.getFileSize = exports.makeDirectories = exports.forEachAncestorDirectory = exports.FileSpec = void 0;
11
+ const crypto_1 = require("../crypto");
12
+ const pathUtils_1 = require("../pathUtils");
13
+ const uri_1 = require("./uri");
14
+ let _fsCaseSensitivity = undefined;
15
+ let _underTest = false;
16
+ const _includeFileRegex = /\.pyi?$/;
17
+ var FileSpec;
18
+ (function (FileSpec) {
19
+ function is(value) {
20
+ const candidate = value;
21
+ return candidate && !!candidate.wildcardRoot && !!candidate.regExp;
22
+ }
23
+ FileSpec.is = is;
24
+ function isInPath(uri, paths) {
25
+ return !!paths.find((p) => uri.matchesRegex(p.regExp));
26
+ }
27
+ FileSpec.isInPath = isInPath;
28
+ function matchesIncludeFileRegex(uri, isFile = true) {
29
+ return isFile ? uri.matchesRegex(_includeFileRegex) : true;
30
+ }
31
+ FileSpec.matchesIncludeFileRegex = matchesIncludeFileRegex;
32
+ function matchIncludeFileSpec(includeRegExp, exclude, uri, isFile = true) {
33
+ if (uri.matchesRegex(includeRegExp)) {
34
+ if (!FileSpec.isInPath(uri, exclude) && FileSpec.matchesIncludeFileRegex(uri, isFile)) {
35
+ return true;
36
+ }
37
+ }
38
+ return false;
39
+ }
40
+ FileSpec.matchIncludeFileSpec = matchIncludeFileSpec;
41
+ })(FileSpec || (exports.FileSpec = FileSpec = {}));
42
+ function forEachAncestorDirectory(directory, callback) {
43
+ while (true) {
44
+ const result = callback(directory);
45
+ if (result !== undefined) {
46
+ return result;
47
+ }
48
+ const parentPath = directory.getDirectory();
49
+ if (parentPath.equals(directory)) {
50
+ return undefined;
51
+ }
52
+ directory = parentPath;
53
+ }
54
+ }
55
+ exports.forEachAncestorDirectory = forEachAncestorDirectory;
56
+ // Creates a directory hierarchy for a path, starting from some ancestor path.
57
+ function makeDirectories(fs, dir, startingFrom) {
58
+ if (!dir.startsWith(startingFrom)) {
59
+ return;
60
+ }
61
+ const pathComponents = dir.getPathComponents();
62
+ const relativeToComponents = startingFrom.getPathComponents();
63
+ let curPath = startingFrom;
64
+ for (let i = relativeToComponents.length; i < pathComponents.length; i++) {
65
+ curPath = curPath.combinePaths(pathComponents[i]);
66
+ if (!fs.existsSync(curPath)) {
67
+ fs.mkdirSync(curPath);
68
+ }
69
+ }
70
+ }
71
+ exports.makeDirectories = makeDirectories;
72
+ function getFileSize(fs, uri) {
73
+ const stat = tryStat(fs, uri);
74
+ if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
75
+ return stat.size;
76
+ }
77
+ return 0;
78
+ }
79
+ exports.getFileSize = getFileSize;
80
+ function fileExists(fs, uri) {
81
+ return fileSystemEntryExists(fs, uri, 0 /* FileSystemEntryKind.File */);
82
+ }
83
+ exports.fileExists = fileExists;
84
+ function directoryExists(fs, uri) {
85
+ return fileSystemEntryExists(fs, uri, 1 /* FileSystemEntryKind.Directory */);
86
+ }
87
+ exports.directoryExists = directoryExists;
88
+ function isDirectory(fs, uri) {
89
+ var _a, _b;
90
+ return (_b = (_a = tryStat(fs, uri)) === null || _a === void 0 ? void 0 : _a.isDirectory()) !== null && _b !== void 0 ? _b : false;
91
+ }
92
+ exports.isDirectory = isDirectory;
93
+ function isFile(fs, uri, treatZipDirectoryAsFile = false) {
94
+ var _a, _b;
95
+ const stats = tryStat(fs, uri);
96
+ if (stats === null || stats === void 0 ? void 0 : stats.isFile()) {
97
+ return true;
98
+ }
99
+ if (!treatZipDirectoryAsFile) {
100
+ return false;
101
+ }
102
+ return (_b = (_a = stats === null || stats === void 0 ? void 0 : stats.isZipDirectory) === null || _a === void 0 ? void 0 : _a.call(stats)) !== null && _b !== void 0 ? _b : false;
103
+ }
104
+ exports.isFile = isFile;
105
+ function tryStat(fs, uri) {
106
+ try {
107
+ if (fs.existsSync(uri)) {
108
+ return fs.statSync(uri);
109
+ }
110
+ }
111
+ catch (e) {
112
+ return undefined;
113
+ }
114
+ return undefined;
115
+ }
116
+ exports.tryStat = tryStat;
117
+ function tryRealpath(fs, uri) {
118
+ try {
119
+ return fs.realCasePath(uri);
120
+ }
121
+ catch (e) {
122
+ return undefined;
123
+ }
124
+ }
125
+ exports.tryRealpath = tryRealpath;
126
+ function getFileSystemEntries(fs, uri) {
127
+ try {
128
+ return getFileSystemEntriesFromDirEntries(fs.readdirEntriesSync(uri), fs, uri);
129
+ }
130
+ catch (e) {
131
+ return { files: [], directories: [] };
132
+ }
133
+ }
134
+ exports.getFileSystemEntries = getFileSystemEntries;
135
+ // Sorts the entires into files and directories, including any symbolic links.
136
+ function getFileSystemEntriesFromDirEntries(dirEntries, fs, uri) {
137
+ const entries = dirEntries.sort((a, b) => {
138
+ if (a.name < b.name) {
139
+ return -1;
140
+ }
141
+ else if (a.name > b.name) {
142
+ return 1;
143
+ }
144
+ else {
145
+ return 0;
146
+ }
147
+ });
148
+ const files = [];
149
+ const directories = [];
150
+ for (const entry of entries) {
151
+ // This is necessary because on some file system node fails to exclude
152
+ // "." and "..". See https://github.com/nodejs/node/issues/4002
153
+ if (entry.name === '.' || entry.name === '..') {
154
+ continue;
155
+ }
156
+ const entryUri = uri.combinePaths(entry.name);
157
+ if (entry.isFile()) {
158
+ files.push(entryUri);
159
+ }
160
+ else if (entry.isDirectory()) {
161
+ directories.push(entryUri);
162
+ }
163
+ else if (entry.isSymbolicLink()) {
164
+ const stat = tryStat(fs, entryUri);
165
+ if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
166
+ files.push(entryUri);
167
+ }
168
+ else if (stat === null || stat === void 0 ? void 0 : stat.isDirectory()) {
169
+ directories.push(entryUri);
170
+ }
171
+ }
172
+ }
173
+ return { files, directories };
174
+ }
175
+ exports.getFileSystemEntriesFromDirEntries = getFileSystemEntriesFromDirEntries;
176
+ function setTestingMode(underTest) {
177
+ _underTest = underTest;
178
+ }
179
+ exports.setTestingMode = setTestingMode;
180
+ // Transforms a relative file spec (one that potentially contains
181
+ // escape characters **, * or ?) and returns a regular expression
182
+ // that can be used for matching against.
183
+ function getWildcardRegexPattern(root, fileSpec) {
184
+ const absolutePath = root.combinePaths(fileSpec);
185
+ const pathComponents = Array.from(absolutePath.getPathComponents());
186
+ const escapedSeparator = (0, pathUtils_1.getRegexEscapedSeparator)('/');
187
+ const doubleAsteriskRegexFragment = `(${escapedSeparator}[^${escapedSeparator}][^${escapedSeparator}]*)*?`;
188
+ const reservedCharacterPattern = new RegExp(`[^\\w\\s${escapedSeparator}]`, 'g');
189
+ // Strip the directory separator from the root component.
190
+ if (pathComponents.length > 0) {
191
+ pathComponents[0] = (0, pathUtils_1.stripTrailingDirectorySeparator)(pathComponents[0]);
192
+ }
193
+ let regExPattern = '';
194
+ let firstComponent = true;
195
+ for (let component of pathComponents) {
196
+ if (component === '**') {
197
+ regExPattern += doubleAsteriskRegexFragment;
198
+ }
199
+ else {
200
+ if (!firstComponent) {
201
+ component = escapedSeparator + component;
202
+ }
203
+ regExPattern += component.replace(reservedCharacterPattern, (match) => {
204
+ if (match === '*') {
205
+ return `[^${escapedSeparator}]*`;
206
+ }
207
+ else if (match === '?') {
208
+ return `[^${escapedSeparator}]`;
209
+ }
210
+ else {
211
+ // escaping anything that is not reserved characters - word/space/separator
212
+ return '\\' + match;
213
+ }
214
+ });
215
+ firstComponent = false;
216
+ }
217
+ }
218
+ return regExPattern;
219
+ }
220
+ exports.getWildcardRegexPattern = getWildcardRegexPattern;
221
+ // Returns the topmost path that contains no wildcard characters.
222
+ function getWildcardRoot(root, fileSpec) {
223
+ const absolutePath = root.combinePaths(fileSpec);
224
+ // make a copy of the path components so we can modify them.
225
+ const pathComponents = Array.from(absolutePath.getPathComponents());
226
+ let wildcardRoot = absolutePath.root;
227
+ // Remove the root component.
228
+ if (pathComponents.length > 0) {
229
+ pathComponents.shift();
230
+ }
231
+ for (const component of pathComponents) {
232
+ if (component === '**') {
233
+ break;
234
+ }
235
+ else {
236
+ if (/[*?]/.test(component)) {
237
+ break;
238
+ }
239
+ wildcardRoot = wildcardRoot.combinePaths(component);
240
+ }
241
+ }
242
+ return wildcardRoot;
243
+ }
244
+ exports.getWildcardRoot = getWildcardRoot;
245
+ function hasPythonExtension(uri) {
246
+ return uri.hasExtension('.py') || uri.hasExtension('.pyi');
247
+ }
248
+ exports.hasPythonExtension = hasPythonExtension;
249
+ function getFileSpec(root, fileSpec) {
250
+ let regExPattern = getWildcardRegexPattern(root, fileSpec);
251
+ const escapedSeparator = (0, pathUtils_1.getRegexEscapedSeparator)('/');
252
+ regExPattern = `^(${regExPattern})($|${escapedSeparator})`;
253
+ const regExp = new RegExp(regExPattern, root.isCaseSensitive ? undefined : 'i');
254
+ const wildcardRoot = getWildcardRoot(root, fileSpec);
255
+ const hasDirectoryWildcard = (0, pathUtils_1.isDirectoryWildcardPatternPresent)(fileSpec);
256
+ return {
257
+ wildcardRoot,
258
+ regExp,
259
+ hasDirectoryWildcard,
260
+ };
261
+ }
262
+ exports.getFileSpec = getFileSpec;
263
+ var FileSystemEntryKind;
264
+ (function (FileSystemEntryKind) {
265
+ FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File";
266
+ FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory";
267
+ })(FileSystemEntryKind || (FileSystemEntryKind = {}));
268
+ function fileSystemEntryExists(fs, uri, entryKind) {
269
+ try {
270
+ const stat = fs.statSync(uri);
271
+ switch (entryKind) {
272
+ case 0 /* FileSystemEntryKind.File */:
273
+ return stat.isFile();
274
+ case 1 /* FileSystemEntryKind.Directory */:
275
+ return stat.isDirectory();
276
+ default:
277
+ return false;
278
+ }
279
+ }
280
+ catch (e) {
281
+ return false;
282
+ }
283
+ }
284
+ const isFileSystemCaseSensitiveMap = new WeakMap();
285
+ function isFileSystemCaseSensitive(fs, tmp) {
286
+ if (!_underTest && _fsCaseSensitivity !== undefined) {
287
+ return _fsCaseSensitivity;
288
+ }
289
+ if (!isFileSystemCaseSensitiveMap.has(fs)) {
290
+ _fsCaseSensitivity = tmp ? isFileSystemCaseSensitiveInternal(fs, tmp) : false;
291
+ isFileSystemCaseSensitiveMap.set(fs, _fsCaseSensitivity);
292
+ }
293
+ return !!isFileSystemCaseSensitiveMap.get(fs);
294
+ }
295
+ exports.isFileSystemCaseSensitive = isFileSystemCaseSensitive;
296
+ function isFileSystemCaseSensitiveInternal(fs, tmp) {
297
+ let filePath = undefined;
298
+ try {
299
+ // Make unique file name.
300
+ let name;
301
+ let mangledFilePath;
302
+ do {
303
+ name = `${(0, crypto_1.randomBytesHex)(21)}-a`;
304
+ filePath = tmp.tmpdir().combinePaths(name);
305
+ mangledFilePath = tmp.tmpdir().combinePaths(name.toUpperCase());
306
+ } while (fs.existsSync(filePath) || fs.existsSync(mangledFilePath));
307
+ fs.writeFileSync(filePath, '', 'utf8');
308
+ // If file exists, then it is insensitive.
309
+ return !fs.existsSync(mangledFilePath);
310
+ }
311
+ catch (e) {
312
+ return false;
313
+ }
314
+ finally {
315
+ if (filePath) {
316
+ // remove temp file created
317
+ try {
318
+ fs.unlinkSync(filePath);
319
+ }
320
+ catch (e) {
321
+ /* ignored */
322
+ }
323
+ }
324
+ }
325
+ }
326
+ exports.isFileSystemCaseSensitiveInternal = isFileSystemCaseSensitiveInternal;
327
+ function deduplicateFolders(listOfFolders) {
328
+ const foldersToWatch = new Map();
329
+ listOfFolders.forEach((folders) => {
330
+ folders.forEach((p) => {
331
+ if (foldersToWatch.has(p.key)) {
332
+ // Bail out on exact match.
333
+ return;
334
+ }
335
+ for (const existing of foldersToWatch) {
336
+ // ex) p: "/user/test" existing: "/user"
337
+ if (p.startsWith(existing[1])) {
338
+ // We already have the parent folder in the watch list
339
+ return;
340
+ }
341
+ // ex) p: "/user" folderToWatch: "/user/test"
342
+ if (existing[1].startsWith(p)) {
343
+ // We found better one to watch. replace.
344
+ foldersToWatch.delete(existing[0]);
345
+ foldersToWatch.set(p.key, p);
346
+ return;
347
+ }
348
+ }
349
+ foldersToWatch.set(p.key, p);
350
+ });
351
+ });
352
+ return [...foldersToWatch.values()];
353
+ }
354
+ exports.deduplicateFolders = deduplicateFolders;
355
+ function getRootUri(isCaseSensitive) {
356
+ if (global.__rootDirectory) {
357
+ return uri_1.Uri.file(global.__rootDirectory, isCaseSensitive);
358
+ }
359
+ return undefined;
360
+ }
361
+ exports.getRootUri = getRootUri;
362
+ //# sourceMappingURL=uriUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uriUtils.js","sourceRoot":"","sources":["../../../../src/common/uri/uriUtils.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAIH,sCAA2C;AAE3C,4CAIsB;AACtB,+BAA4B;AAE5B,IAAI,kBAAkB,GAAwB,SAAS,CAAC;AACxD,IAAI,UAAU,GAAY,KAAK,CAAC;AAkBhC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAEpC,IAAiB,QAAQ,CAsBxB;AAtBD,WAAiB,QAAQ;IACrB,SAAgB,EAAE,CAAC,KAAU;QACzB,MAAM,SAAS,GAAa,KAAiB,CAAC;QAC9C,OAAO,SAAS,IAAI,CAAC,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC;IACvE,CAAC;IAHe,WAAE,KAGjB,CAAA;IACD,SAAgB,QAAQ,CAAC,GAAQ,EAAE,KAAiB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