Void-AI IDE


这个仓库是 Void 的开源代码库,Void 是一款开源的 Cursor 替代编辑器。以下是对该仓库的详细介绍:

项目概述

  • 简介Void 允许用户在代码库上使用 AI 代理、进行检查点和可视化更改,并且可以本地集成任何模型或主机。它直接向提供商发送消息,不会保留用户数据。
  • 来源Void 是基于 vscode 仓库的一个分支。

项目结构

仓库的主要文件夹和文件结构如下:

.editorconfig
.eslint-ignore
.git-blame-ignore-revs
.gitattributes
.gitignore
.lsifrc.json
.mailmap
.mention-bot
.npmrc
.nvmrc
.voidrules
.vscode-test.js
CodeQL.yml
HOW_TO_CONTRIBUTE.md
LICENSE-VS-Code.txt
LICENSE.txt
README.md
ThirdPartyNotices.txt
VOID_CODEBASE_GUIDE.md
cglicenses.json
cgmanifest.json
eslint.config.js
gulpfile.js
package-lock.json
package.json
product.json
.github/
 ...
...
.idx/
 ...
.eslint-plugin-local/
 ...
.config/
 ...
.vscode/
 ...
.devcontainer/
 ...
cli/
 ...
build/
 ...
remote/
 ...
extensions/
 ...

核心功能代码

从提供的代码片段来看,项目涉及多个核心功能模块,以下是一些关键功能和相关代码文件的概述:

存储服务

  • NativeWorkbenchStorageService:在 void/src/vs/workbench/services/storage/electron-sandbox/storageService.ts 中定义,继承自 RemoteStorageService,负责管理工作台的存储服务,处理用户数据配置文件的更改事件。
export class NativeWorkbenchStorageService extends RemoteStorageService {
    constructor(
        workspace: IAnyWorkspaceIdentifier | undefined,
        private readonly userDataProfileService: IUserDataProfileService,
        userDataProfilesService: IUserDataProfilesService,
        mainProcessService: IMainProcessService,
        environmentService: IEnvironmentService
    ) {
        super(workspace, { currentProfile: userDataProfileService.currentProfile, defaultProfile: userDataProfilesService.defaultProfile }, mainProcessService, environmentService);
        this.registerListeners();
    }
    private registerListeners(): void {
        this._register(this.userDataProfileService.onDidChangeCurrentProfile(e => e.join(this.switchToProfile(e.profile))));
    }
}
  • SQLiteStorageDatabase:在 void/src/vs/base/parts/storage/node/storage.ts 中定义,实现了 IStorageDatabase 接口,使用 SQLite 数据库进行存储操作,包括数据的读取、更新、优化和关闭等功能。

存储主服务

  • ApplicationStorageMainWorkspaceStorageMain:在 void/src/vs/platform/storage/electron-main/storageMain.ts 中定义,分别负责应用程序和工作区的存储管理,包括初始化、数据读写、关闭等操作。

存储 IPC 通信

  • StorageDatabaseChannel:在 void/src/vs/platform/storage/electron-main/storageIpc.ts 中定义,处理存储相关的 IPC 通信,包括监听存储变化事件和处理远程调用请求。

参与贡献

  • 贡献指南:可以查看项目的 Project BoardHOW_TO_CONTRIBUTE 来了解如何开始为项目做贡献。
  • 交流渠道:欢迎参加 Discord 频道的每周例会,也可以在 Discord 服务器中与开发者交流,或者通过邮箱 hello@voideditor.com 联系。

参考资料

  • 代码库指南:可以参考 VOID_CODEBASE_GUIDE 来了解代码库的结构和使用方法。

官网