Skip to content

CodeBuddy

CodeBuddy 是一款轻量但功能强大的代码编辑器。Protocol Launcher 允许您生成深度链接,以便在 CodeBuddy 中打开和配置资源。

使用

提供两种使用方式:

  • 按需加载(通过子路径导入),支持 Tree Shaking,体积更小。
  • 全量导入(从根包导入),使用简单,但会包含所有应用模块。

生产环境建议使用按需加载以减小体积;快速脚本或演示可选择全量导入。

选择安装方式

按需加载
推荐使用。生产环境优化。
全量导入
使用便捷。适合快速脚本。

打开编辑器

按需加载
ts
import { open } from 'protocol-launcher/code-buddy'

const url = open()

打开文件

按需加载
ts
import { openFile } from 'protocol-launcher/code-buddy'

const url = openFile({
  path: '/etc/hosts',
  line: 1,
  column: 2,
  openInNewWindow: true,
})

打开目录

按需加载
ts
import { openFolder } from 'protocol-launcher/code-buddy'

const url = openFolder({
  path: '/etc',
  openInNewWindow: true,
})

打开远程连接

按需加载
ts
import { openRemote } from 'protocol-launcher/code-buddy'

const url = openRemote({
  type: 'ssh-remote',
  host: 'root@172.18.105.209:22',
  path: '/code/my-project',
})

打开设置

按需加载
ts
import { openSettings } from 'protocol-launcher/code-buddy'

const url = openSettings()