We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hi,我在集成ide-startup-lite的时候,发现有些时候,读取一些空文件夹的时候,会把这个文件夹识别成文件,这个问题,我已经发现并在我本地进行了解决: 读取文件夹树的时候,会把文件夹读取成文件: web-lite/file-provider/browser-fs-provider.ts
// waiting for HttpFileService ready await this.httpFileService.whenReady; const childNodes = await this.httpFileService.readDir(uri.codeUri); const ensureNodes: Promise<FileStat>[] = []; for (const node of childNodes) { if (node.children.length) { ensureNodes.push(this.createDirectory(URI.file(new Path(this.options.rootFolder).join(`${node.path}`).toString()).codeUri)); } else { ensureNodes.push(this.writeFile(URI.file(new Path(this.options.rootFolder).join(`${node.path}`).toString()).codeUri, BinaryBuffer.fromString('').buffer, {create: true, isInit: true, overwrite: false}) as Promise<FileStat>); } } try { await Promise.all(ensureNodes); } catch (err) { // console.error('node fetch failed ', err); } }
这里通过判断节点的子节点的数量来达到识别是否是文件夹的处理,会导致一些空文件夹识别成文件
The text was updated successfully, but these errors were encountered:
@jiexinkai-newbee 感谢反馈,这里使用 node.children.length 判断确实是不严谨的,可以考虑采用 node.content.type 或 node.content.mode 去判断会更加严谨,方便的话可以提交个 PR 来修复一下 ~
node.children.length
node.content.type
node.content.mode
Sorry, something went wrong.
No branches or pull requests
hi,我在集成ide-startup-lite的时候,发现有些时候,读取一些空文件夹的时候,会把这个文件夹识别成文件,这个问题,我已经发现并在我本地进行了解决:
读取文件夹树的时候,会把文件夹读取成文件:
web-lite/file-provider/browser-fs-provider.ts
这里通过判断节点的子节点的数量来达到识别是否是文件夹的处理,会导致一些空文件夹识别成文件
The text was updated successfully, but these errors were encountered: