-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Description
Extension sample
tree-view-sample
VS Code version
1.98.1 (Universal)
What went wrong?
In the tree-view-sample, the FTP explorer can retrieve files only from the top level directory (/) of an FTP server. Attempting to retrieve files from a subdirectory failes with an error.
Steps to reproduce:
- Clone the repository.
- Open the
tree-view-sample
subdirectory in Visual Studio Code. - Since the code uses an FTP server that doesn't work anymore, edit
ftpExplorer.ts
and change the server. For example:
diff --git a/tree-view-sample/src/ftpExplorer.ts b/tree-view-sample/src/ftpExplorer.ts
index 4bb05ccd..c0218188 100644
--- a/tree-view-sample/src/ftpExplorer.ts
+++ b/tree-view-sample/src/ftpExplorer.ts
@@ -148,7 +148,7 @@ export class FtpExplorer {
constructor(context: vscode.ExtensionContext) {
/* Please note that login information is hardcoded only for this example purpose and recommended not to do it in general. */
- const ftpModel = new FtpModel('mirror.switch.ch', 'anonymous', '[email protected]');
+ const ftpModel = new FtpModel('test.rebex.net', 'anonymous', '[email protected]');
const treeDataProvider = new FtpTreeDataProvider(ftpModel);
context.subscriptions.push(vscode.workspace.registerTextDocumentContentProvider('ftp', treeDataProvider));
- Start to debug the extension.
- Go to "FTP explorer" and click on the top level
readme.txt
file. The content on the file should be displayed. - Close the
readme.txt
file tab in the editor. - In the "FTP explorer" pane, navigate to
/pub/example
and click on thereadme.txt
from this directory.
Expected behaviour: the file is retrieved and displayed just like the top level readme.txt
.
Actual behaviour: no file is displayed and the parent VSCode window displays this error in the debug console:
rejected promise not handled within 1 second: CodeExpectedError: cannot open file:///pub/example/readme.txt. Detail: Unable to read file '/pub/example/readme.txt' (Error: Unable to resolve nonexistent file '/pub/example/readme.txt')
extensionHostProcess.js:178
stack trace: CodeExpectedError: cannot open file:///pub/example/readme.txt. Detail: Unable to read file '/pub/example/readme.txt' (Error: Unable to resolve nonexistent file '/pub/example/readme.txt')
at i7e.$tryOpenDocument (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1246:8627)```
Downloading /pub/example/readme.txt
with an FTP client works.
This issue was observed on all tested FTP servers.
Repository HEAD: 46f526c
npm: 11.1.0
node: 22.14.0
Metadata
Metadata
Assignees
Labels
No labels