@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.
- package/dist/analyzer/analyzerFileInfo.d.ts +4 -3
- package/dist/analyzer/analyzerFileInfo.js.map +1 -1
- package/dist/analyzer/backgroundAnalysisProgram.d.ts +15 -14
- package/dist/analyzer/backgroundAnalysisProgram.js +38 -38
- package/dist/analyzer/backgroundAnalysisProgram.js.map +1 -1
- package/dist/analyzer/binder.js +56 -52
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/checker.js +43 -33
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/circularDependency.d.ts +3 -2
- package/dist/analyzer/circularDependency.js.map +1 -1
- package/dist/analyzer/codeFlowEngine.js +29 -36
- package/dist/analyzer/codeFlowEngine.js.map +1 -1
- package/dist/analyzer/constraintSolver.js +3 -5
- package/dist/analyzer/constraintSolver.js.map +1 -1
- package/dist/analyzer/dataClasses.js +1 -1
- package/dist/analyzer/dataClasses.js.map +1 -1
- package/dist/analyzer/declaration.d.ts +5 -3
- package/dist/analyzer/declaration.js +3 -2
- package/dist/analyzer/declaration.js.map +1 -1
- package/dist/analyzer/declarationUtils.d.ts +3 -2
- package/dist/analyzer/declarationUtils.js +14 -12
- package/dist/analyzer/declarationUtils.js.map +1 -1
- package/dist/analyzer/enums.js +1 -1
- package/dist/analyzer/enums.js.map +1 -1
- package/dist/analyzer/importResolver.d.ts +29 -25
- package/dist/analyzer/importResolver.js +300 -301
- package/dist/analyzer/importResolver.js.map +1 -1
- package/dist/analyzer/importResult.d.ts +5 -4
- package/dist/analyzer/importResult.js.map +1 -1
- package/dist/analyzer/importStatementUtils.d.ts +5 -4
- package/dist/analyzer/importStatementUtils.js +23 -22
- package/dist/analyzer/importStatementUtils.js.map +1 -1
- package/dist/analyzer/namedTuples.js +3 -3
- package/dist/analyzer/namedTuples.js.map +1 -1
- package/dist/analyzer/packageTypeReport.d.ts +7 -6
- package/dist/analyzer/packageTypeReport.js +4 -4
- package/dist/analyzer/packageTypeReport.js.map +1 -1
- package/dist/analyzer/packageTypeVerifier.js +68 -64
- package/dist/analyzer/packageTypeVerifier.js.map +1 -1
- package/dist/analyzer/parentDirectoryCache.d.ts +7 -6
- package/dist/analyzer/parentDirectoryCache.js +9 -10
- package/dist/analyzer/parentDirectoryCache.js.map +1 -1
- package/dist/analyzer/parseTreeUtils.d.ts +1 -1
- package/dist/analyzer/parseTreeUtils.js +6 -3
- package/dist/analyzer/parseTreeUtils.js.map +1 -1
- package/dist/analyzer/patternMatching.js +79 -14
- package/dist/analyzer/patternMatching.js.map +1 -1
- package/dist/analyzer/program.d.ts +27 -26
- package/dist/analyzer/program.js +162 -156
- package/dist/analyzer/program.js.map +1 -1
- package/dist/analyzer/properties.js +3 -3
- package/dist/analyzer/properties.js.map +1 -1
- package/dist/analyzer/pyTypedUtils.d.ts +3 -2
- package/dist/analyzer/pyTypedUtils.js +4 -5
- package/dist/analyzer/pyTypedUtils.js.map +1 -1
- package/dist/analyzer/pythonPathUtils.d.ts +7 -6
- package/dist/analyzer/pythonPathUtils.js +21 -23
- package/dist/analyzer/pythonPathUtils.js.map +1 -1
- package/dist/analyzer/service.d.ts +24 -23
- package/dist/analyzer/service.js +187 -183
- package/dist/analyzer/service.js.map +1 -1
- package/dist/analyzer/sourceFile.d.ts +4 -5
- package/dist/analyzer/sourceFile.js +68 -56
- package/dist/analyzer/sourceFile.js.map +1 -1
- package/dist/analyzer/sourceFileInfoUtils.js +3 -3
- package/dist/analyzer/sourceFileInfoUtils.js.map +1 -1
- package/dist/analyzer/sourceMapper.d.ts +11 -10
- package/dist/analyzer/sourceMapper.js +59 -62
- package/dist/analyzer/sourceMapper.js.map +1 -1
- package/dist/analyzer/sourceMapperUtils.d.ts +2 -1
- package/dist/analyzer/sourceMapperUtils.js +2 -2
- package/dist/analyzer/sourceMapperUtils.js.map +1 -1
- package/dist/analyzer/tracePrinter.d.ts +3 -2
- package/dist/analyzer/tracePrinter.js +21 -23
- package/dist/analyzer/tracePrinter.js.map +1 -1
- package/dist/analyzer/typeDocStringUtils.d.ts +2 -1
- package/dist/analyzer/typeDocStringUtils.js +14 -17
- package/dist/analyzer/typeDocStringUtils.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +172 -102
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeGuards.js +3 -3
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typePrinter.d.ts +2 -0
- package/dist/analyzer/typePrinter.js +48 -8
- package/dist/analyzer/typePrinter.js.map +1 -1
- package/dist/analyzer/typeStubWriter.d.ts +2 -1
- package/dist/analyzer/typeStubWriter.js +2 -2
- package/dist/analyzer/typeStubWriter.js.map +1 -1
- package/dist/analyzer/typeUtils.d.ts +4 -2
- package/dist/analyzer/typeUtils.js +16 -5
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/analyzer/typedDicts.js +4 -4
- package/dist/analyzer/typedDicts.js.map +1 -1
- package/dist/analyzer/types.d.ts +5 -4
- package/dist/analyzer/types.js +4 -4
- package/dist/analyzer/types.js.map +1 -1
- package/dist/backgroundAnalysis.d.ts +1 -2
- package/dist/backgroundAnalysis.js +6 -4
- package/dist/backgroundAnalysis.js.map +1 -1
- package/dist/backgroundAnalysisBase.d.ts +22 -20
- package/dist/backgroundAnalysisBase.js +76 -55
- package/dist/backgroundAnalysisBase.js.map +1 -1
- package/dist/backgroundThreadBase.d.ts +1 -1
- package/dist/backgroundThreadBase.js +20 -11
- package/dist/backgroundThreadBase.js.map +1 -1
- package/dist/commands/createTypeStub.js +3 -2
- package/dist/commands/createTypeStub.js.map +1 -1
- package/dist/commands/dumpFileDebugInfoCommand.js +21 -20
- package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
- package/dist/commands/quickActionCommand.js +5 -5
- package/dist/commands/quickActionCommand.js.map +1 -1
- package/dist/common/configOptions.d.ts +14 -13
- package/dist/common/configOptions.js +29 -27
- package/dist/common/configOptions.js.map +1 -1
- package/dist/common/diagnostic.d.ts +6 -5
- package/dist/common/diagnostic.js +2 -2
- package/dist/common/diagnostic.js.map +1 -1
- package/dist/common/diagnosticSink.d.ts +2 -1
- package/dist/common/diagnosticSink.js.map +1 -1
- package/dist/common/editAction.d.ts +6 -5
- package/dist/common/editAction.js +2 -2
- package/dist/common/editAction.js.map +1 -1
- package/dist/common/envVarUtils.d.ts +2 -1
- package/dist/common/envVarUtils.js +20 -28
- package/dist/common/envVarUtils.js.map +1 -1
- package/dist/common/extensibility.d.ts +19 -19
- package/dist/common/extensibility.js.map +1 -1
- package/dist/common/fileSystem.d.ts +29 -28
- package/dist/common/fileWatcher.d.ts +3 -2
- package/dist/common/fileWatcher.js.map +1 -1
- package/dist/common/fullAccessHost.d.ts +8 -7
- package/dist/common/fullAccessHost.js +21 -16
- package/dist/common/fullAccessHost.js.map +1 -1
- package/dist/common/host.d.ts +7 -6
- package/dist/common/host.js +1 -1
- package/dist/common/host.js.map +1 -1
- package/dist/common/logTracker.d.ts +2 -1
- package/dist/common/logTracker.js +4 -4
- package/dist/common/logTracker.js.map +1 -1
- package/dist/common/pathUtils.d.ts +1 -28
- package/dist/common/pathUtils.js +17 -366
- package/dist/common/pathUtils.js.map +1 -1
- package/dist/common/realFileSystem.d.ts +7 -3
- package/dist/common/realFileSystem.js +78 -60
- package/dist/common/realFileSystem.js.map +1 -1
- package/dist/common/serviceProviderExtensions.d.ts +2 -1
- package/dist/common/serviceProviderExtensions.js +5 -2
- package/dist/common/serviceProviderExtensions.js.map +1 -1
- package/dist/common/textEditTracker.d.ts +2 -1
- package/dist/common/textEditTracker.js +28 -28
- package/dist/common/textEditTracker.js.map +1 -1
- package/dist/common/textRange.d.ts +2 -1
- package/dist/common/textRange.js.map +1 -1
- package/dist/common/uri/baseUri.d.ts +51 -0
- package/dist/common/uri/baseUri.js +194 -0
- package/dist/common/uri/baseUri.js.map +1 -0
- package/dist/common/uri/emptyUri.d.ts +32 -0
- package/dist/common/uri/emptyUri.js +122 -0
- package/dist/common/uri/emptyUri.js.map +1 -0
- package/dist/common/uri/fileUri.d.ts +36 -0
- package/dist/common/uri/fileUri.js +180 -0
- package/dist/common/uri/fileUri.js.map +1 -0
- package/dist/common/uri/memoization.d.ts +3 -0
- package/dist/common/uri/memoization.js +72 -0
- package/dist/common/uri/memoization.js.map +1 -0
- package/dist/common/uri/uri.d.ts +50 -0
- package/dist/common/uri/uri.js +104 -0
- package/dist/common/uri/uri.js.map +1 -0
- package/dist/common/uri/uriUtils.d.ts +39 -0
- package/dist/common/uri/uriUtils.js +362 -0
- package/dist/common/uri/uriUtils.js.map +1 -0
- package/dist/common/uri/webUri.d.ts +36 -0
- package/dist/common/uri/webUri.js +207 -0
- package/dist/common/uri/webUri.js.map +1 -0
- package/dist/common/workspaceEditUtils.d.ts +8 -8
- package/dist/common/workspaceEditUtils.js +34 -37
- package/dist/common/workspaceEditUtils.js.map +1 -1
- package/dist/languageServerBase.d.ts +19 -22
- package/dist/languageServerBase.js +91 -95
- package/dist/languageServerBase.js.map +1 -1
- package/dist/languageService/analyzerServiceExecutor.d.ts +2 -1
- package/dist/languageService/analyzerServiceExecutor.js +14 -16
- package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
- package/dist/languageService/autoImporter.d.ts +11 -9
- package/dist/languageService/autoImporter.js +45 -44
- package/dist/languageService/autoImporter.js.map +1 -1
- package/dist/languageService/callHierarchyProvider.d.ts +3 -2
- package/dist/languageService/callHierarchyProvider.js +23 -35
- package/dist/languageService/callHierarchyProvider.js.map +1 -1
- package/dist/languageService/codeActionProvider.d.ts +2 -1
- package/dist/languageService/codeActionProvider.js +8 -10
- package/dist/languageService/codeActionProvider.js.map +1 -1
- package/dist/languageService/completionProvider.d.ts +7 -6
- package/dist/languageService/completionProvider.js +32 -30
- package/dist/languageService/completionProvider.js.map +1 -1
- package/dist/languageService/completionProviderUtils.d.ts +2 -1
- package/dist/languageService/completionProviderUtils.js +1 -1
- package/dist/languageService/completionProviderUtils.js.map +1 -1
- package/dist/languageService/definitionProvider.d.ts +4 -3
- package/dist/languageService/definitionProvider.js +26 -24
- package/dist/languageService/definitionProvider.js.map +1 -1
- package/dist/languageService/documentHighlightProvider.d.ts +3 -2
- package/dist/languageService/documentHighlightProvider.js +3 -3
- package/dist/languageService/documentHighlightProvider.js.map +1 -1
- package/dist/languageService/documentSymbolCollector.js +8 -7
- package/dist/languageService/documentSymbolCollector.js.map +1 -1
- package/dist/languageService/documentSymbolProvider.d.ts +5 -4
- package/dist/languageService/documentSymbolProvider.js +9 -11
- package/dist/languageService/documentSymbolProvider.js.map +1 -1
- package/dist/languageService/hoverProvider.d.ts +4 -3
- package/dist/languageService/hoverProvider.js +6 -5
- package/dist/languageService/hoverProvider.js.map +1 -1
- package/dist/languageService/navigationUtils.d.ts +2 -1
- package/dist/languageService/navigationUtils.js +2 -3
- package/dist/languageService/navigationUtils.js.map +1 -1
- package/dist/languageService/quickActions.d.ts +2 -1
- package/dist/languageService/quickActions.js +3 -3
- package/dist/languageService/quickActions.js.map +1 -1
- package/dist/languageService/referencesProvider.d.ts +10 -9
- package/dist/languageService/referencesProvider.js +28 -28
- package/dist/languageService/referencesProvider.js.map +1 -1
- package/dist/languageService/renameProvider.d.ts +4 -3
- package/dist/languageService/renameProvider.js +17 -18
- package/dist/languageService/renameProvider.js.map +1 -1
- package/dist/languageService/signatureHelpProvider.d.ts +3 -2
- package/dist/languageService/signatureHelpProvider.js +4 -4
- package/dist/languageService/signatureHelpProvider.js.map +1 -1
- package/dist/languageService/symbolIndexer.d.ts +2 -1
- package/dist/languageService/symbolIndexer.js +1 -1
- package/dist/languageService/symbolIndexer.js.map +1 -1
- package/dist/languageService/tooltipUtils.js +10 -4
- package/dist/languageService/tooltipUtils.js.map +1 -1
- package/dist/languageService/workspaceSymbolProvider.d.ts +4 -3
- package/dist/languageService/workspaceSymbolProvider.js +10 -11
- package/dist/languageService/workspaceSymbolProvider.js.map +1 -1
- package/dist/localization/localize.d.ts +1 -0
- package/dist/localization/localize.js +1 -0
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.en-us.json +2 -1
- package/dist/pyright.js +18 -17
- package/dist/pyright.js.map +1 -1
- package/dist/pyrightFileSystem.d.ts +13 -13
- package/dist/pyrightFileSystem.js +38 -43
- package/dist/pyrightFileSystem.js.map +1 -1
- package/dist/readonlyAugmentedFileSystem.d.ts +29 -28
- package/dist/readonlyAugmentedFileSystem.js +62 -65
- package/dist/readonlyAugmentedFileSystem.js.map +1 -1
- package/dist/server.js +21 -20
- package/dist/server.js.map +1 -1
- package/dist/tests/chainedSourceFiles.test.js +39 -30
- package/dist/tests/chainedSourceFiles.test.js.map +1 -1
- package/dist/tests/checker.test.js +31 -30
- package/dist/tests/checker.test.js.map +1 -1
- package/dist/tests/completions.test.js +7 -3
- package/dist/tests/completions.test.js.map +1 -1
- package/dist/tests/config.test.js +24 -22
- package/dist/tests/config.test.js.map +1 -1
- package/dist/tests/documentSymbolCollector.test.js +3 -2
- package/dist/tests/documentSymbolCollector.test.js.map +1 -1
- package/dist/tests/filesystem.test.js +37 -35
- package/dist/tests/filesystem.test.js.map +1 -1
- package/dist/tests/fourSlashParser.test.js +4 -4
- package/dist/tests/fourSlashParser.test.js.map +1 -1
- package/dist/tests/fourslash/hover.docstring.alias.fourslash.js +27 -11
- package/dist/tests/fourslash/hover.docstring.alias.fourslash.js.map +1 -1
- package/dist/tests/harness/fourslash/fourSlashParser.js +2 -2
- package/dist/tests/harness/fourslash/fourSlashParser.js.map +1 -1
- package/dist/tests/harness/fourslash/testLanguageService.d.ts +4 -5
- package/dist/tests/harness/fourslash/testLanguageService.js +9 -15
- package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -1
- package/dist/tests/harness/fourslash/testState.d.ts +4 -4
- package/dist/tests/harness/fourslash/testState.js +91 -51
- package/dist/tests/harness/fourslash/testState.js.map +1 -1
- package/dist/tests/harness/testAccessHost.d.ts +3 -2
- package/dist/tests/harness/testAccessHost.js +2 -1
- package/dist/tests/harness/testAccessHost.js.map +1 -1
- package/dist/tests/harness/testHost.js +13 -11
- package/dist/tests/harness/testHost.js.map +1 -1
- package/dist/tests/harness/vfs/factory.d.ts +3 -2
- package/dist/tests/harness/vfs/factory.js +5 -4
- package/dist/tests/harness/vfs/factory.js.map +1 -1
- package/dist/tests/harness/vfs/filesystem.d.ts +32 -31
- package/dist/tests/harness/vfs/filesystem.js +47 -49
- package/dist/tests/harness/vfs/filesystem.js.map +1 -1
- package/dist/tests/harness/vfs/pathValidation.js +1 -10
- package/dist/tests/harness/vfs/pathValidation.js.map +1 -1
- package/dist/tests/importResolver.test.js +81 -58
- package/dist/tests/importResolver.test.js.map +1 -1
- package/dist/tests/importStatementUtils.test.js +10 -9
- package/dist/tests/importStatementUtils.test.js.map +1 -1
- package/dist/tests/ipythonMode.test.js +12 -11
- package/dist/tests/ipythonMode.test.js.map +1 -1
- package/dist/tests/logger.test.js +2 -1
- package/dist/tests/logger.test.js.map +1 -1
- package/dist/tests/parseTreeUtils.test.js +2 -1
- package/dist/tests/parseTreeUtils.test.js.map +1 -1
- package/dist/tests/pathUtils.test.js +3 -138
- package/dist/tests/pathUtils.test.js.map +1 -1
- package/dist/tests/pyrightFileSystem.test.js +38 -34
- package/dist/tests/pyrightFileSystem.test.js.map +1 -1
- package/dist/tests/service.test.js +37 -42
- package/dist/tests/service.test.js.map +1 -1
- package/dist/tests/signatureHelp.test.js +3 -2
- package/dist/tests/signatureHelp.test.js.map +1 -1
- package/dist/tests/sourceFile.test.js +8 -7
- package/dist/tests/sourceFile.test.js.map +1 -1
- package/dist/tests/sourceMapperUtils.test.js +13 -6
- package/dist/tests/sourceMapperUtils.test.js.map +1 -1
- package/dist/tests/testState.test.js +13 -9
- package/dist/tests/testState.test.js.map +1 -1
- package/dist/tests/testStateUtils.d.ts +2 -5
- package/dist/tests/testStateUtils.js +27 -64
- package/dist/tests/testStateUtils.js.map +1 -1
- package/dist/tests/testUtils.d.ts +3 -5
- package/dist/tests/testUtils.js +15 -64
- package/dist/tests/testUtils.js.map +1 -1
- package/dist/tests/textEditUtil.test.js +4 -3
- package/dist/tests/textEditUtil.test.js.map +1 -1
- package/dist/tests/typeEvaluator1.test.js +16 -15
- package/dist/tests/typeEvaluator1.test.js.map +1 -1
- package/dist/tests/typeEvaluator2.test.js +18 -9
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +73 -62
- package/dist/tests/typeEvaluator3.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +20 -19
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/dist/tests/typeEvaluator5.test.js +28 -27
- package/dist/tests/typeEvaluator5.test.js.map +1 -1
- package/dist/tests/typePrinter.test.js +4 -3
- package/dist/tests/typePrinter.test.js.map +1 -1
- package/dist/tests/uri.test.d.ts +1 -0
- package/dist/tests/uri.test.js +695 -0
- package/dist/tests/uri.test.js.map +1 -0
- package/dist/tests/workspaceEditUtils.test.js +28 -28
- package/dist/tests/workspaceEditUtils.test.js.map +1 -1
- package/dist/tests/zipfs.test.js +11 -11
- package/dist/tests/zipfs.test.js.map +1 -1
- package/dist/workspaceFactory.d.ts +13 -14
- package/dist/workspaceFactory.js +54 -55
- package/dist/workspaceFactory.js.map +1 -1
- package/package.json +2 -2
- package/dist/common/uriParser.d.ts +0 -24
- package/dist/common/uriParser.js +0 -45
- 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
|
-
|
14
|
+
private _listener;
|
15
|
+
constructor(_paths: Uri[], _listener: FileWatcherEventHandler);
|
15
16
|
close(): void;
|
16
|
-
fireFileChange(path:
|
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(
|
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:
|
115
|
+
createFileSystemWatcher(paths: Uri[], listener: FileWatcherEventHandler): FileWatcher;
|
114
116
|
fireFileWatcherEvent(path: string, event: FileWatcherEventType): void;
|
115
|
-
getModulePath():
|
116
|
-
tmpdir():
|
117
|
-
tmpfile(options?: TmpfileOptions):
|
118
|
-
realCasePath(path:
|
119
|
-
|
120
|
-
|
121
|
-
|
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:
|
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:
|
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:
|
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:
|
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:
|
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(
|
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:
|
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:
|
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:
|
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:
|
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:
|
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(
|
266
|
-
readFile(
|
267
|
-
readFileText(
|
268
|
-
createReadStream(path:
|
269
|
-
createWriteStream(path:
|
270
|
-
copyFileSync(src:
|
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:
|
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(
|
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
|
-
|
54
|
-
|
55
|
-
this._listener(eventType, normalized);
|
52
|
+
if (this._paths.some((p) => path.startsWith(p))) {
|
53
|
+
this._listener(eventType, path);
|
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 ||
|
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(
|
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
|
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 =
|
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
|
-
|
336
|
+
isMappedUri(filepath) {
|
335
337
|
return false;
|
336
338
|
}
|
337
339
|
// Get original filepath if the given filepath is mapped.
|
338
|
-
|
340
|
+
getOriginalUri(mappedFilePath) {
|
339
341
|
return mappedFilePath;
|
340
342
|
}
|
341
343
|
// Get mapped filepath if the given filepath is mapped.
|
342
|
-
|
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
|
-
|
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(
|
561
|
+
rmdirSync(uri) {
|
564
562
|
if (this.isReadonly) {
|
565
563
|
throw (0, utils_1.createIOError)('EROFS');
|
566
564
|
}
|
567
|
-
path = this._resolve(
|
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(
|
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(
|
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(
|
757
|
-
return Promise.resolve(this.readFileSync(
|
754
|
+
readFile(fileUri) {
|
755
|
+
return Promise.resolve(this.readFileSync(fileUri));
|
758
756
|
}
|
759
|
-
readFileText(
|
760
|
-
return Promise.resolve(this.readFileSync(
|
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) {
|