Skip to content

[VSCode] Extend Web IDE API with FS Operations

Extend Web IDE API

  • Add file system methods to the Web IDE's exposed API
  • Implement handlers in the Web IDE to route FS operations to BrowserFS
  • Add authentication and security checks as needed

Refer to Spike for more context and implementation details

Implementation details

// In vscode-extension-web-ide/src/main.ts
return {
  gitlabUrl: config.gitlabUrl,
  projectPath: config.projectPath,
  isTelemetryEnabled() {
    return config.telemetryEnabled || false;
  },
  // Add file system operations
  fs: {
    readFile: async (path: string) => { /* implementation */ },
    writeFile: async (path: string, content: Uint8Array) => { /* implementation */ },
    stat: async (path: string) => { /* implementation */ },
    readdir: async (path: string) => { /* implementation */ },
    unlink: async (path: string) => { /* implementation */ },
    // Additional methods as needed
  }
};

Check implementation details section in Spike for more context

Edited by Olena Horal-Koretska