1.65.1 • Published 4 years ago
@pkerschbaum/code-oss-file-service v1.65.1
@pkerschbaum/code-oss-file-service
VS Code (microsoft/vscode) includes a rich "FileService" and "DiskFileSystemProvider" abstraction built on top of Node.js core modules (fs, path) and Electron's shell module.
This package allows to use that abstraction as a standalone module for other projects. It is a fork of microsoft/vscode, reduced to all code parts related to FileService and DiskFileSystemProvider. The compiled output is ES6 compliant with source maps, declarations, and declaration maps included.
The following changes were made to the code:
- Minor changes in order to allow standalone usage (e.g., there was a dependency on the
product.jsonfile of microsoft/vscode, this code parts were removed). - Deleting directories recursively via the
DiskFileSystemProviderdoes not use the fast variant that first moves the target to a temporary directory and then deletes it in the background, since this introduces problems with some devices on windows, e.g. external drives and network drives. See also this commit: pkerschbaum/vscode/commit/e84f81c49f90cfebfdb0078d83b2695a2744c7c8.
See this link for all changes made to the VS Code source code.
Credits go to microsoft/vscode for their awesome work!
Usage
import { Schemas } from "@pkerschbaum/code-oss-file-service/out/vs/base/common/network";
import {
ConsoleMainLogger,
LogService,
} from "@pkerschbaum/code-oss-file-service/out/vs/platform/log/common/log";
import { FileService } from "@pkerschbaum/code-oss-file-service/out/vs/platform/files/common/fileService";
import { DiskFileSystemProvider } from "@pkerschbaum/code-oss-file-service/out/vs/platform/files/node/diskFileSystemProvider";
const logger = new ConsoleMainLogger();
const logService = new LogService(logger);
const fileService = new FileService(logService);
const diskFileSystemProvider = new DiskFileSystemProvider(logService);
fileService.registerProvider(Schemas.file, diskFileSystemProvider);
// fileService is ready for use here