| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 天前 | ||
| 2 天前 | ||
| 2 天前 | ||
| 2 天前 | ||
| 2 天前 | ||
| 2 天前 | ||
| 2 天前 | ||
| 2 天前 | ||
| 1 天前 | ||
| 2 天前 |
AutoShip for Visual Studio Code
A thin VS Code extension that wires the autoship CLI into the editor: live diagnostics through the AutoShip language server, on-save hooks, and a command palette for the most common operations (clean, verify, commit, run hook, open config, restart server).
The extension does not reimplement any AutoShip logic — it launches the existing autoship CLI as the LSP server (autoship lsp) and as subprocesses in the integrated terminal. Upgrade AutoShip, and the extension picks up the new behaviour automatically.
English
Features
- Live diagnostics — the AutoShip language server publishes
verifydiagnostics as you edit and on save. - On-save hooks —
[hooks] on_saveentries (clean/verify/ custom commands) are run by the LSP server ontextDocument/didSave, with debounce and glob filtering identical to the CLI. - Command palette —
AutoShip: Clean,AutoShip: Verify(current file),AutoShip: Commit,AutoShip: Run On-Save Hook,AutoShip: Show Status,AutoShip: Open Config,AutoShip: Restart Language Server. - Status bar — a single item reflects the language client state (starting / running / stopped); click to restart.
- Config editor —
AutoShip: Open Configopens.autoship.toml(or.autoship.team.toml) in the workspace, or offers to scaffold one viaautoship init. - uv workspace aware — when the workspace has a
pyproject.tomlmentioning autoship anduvis onPATH, the extension automatically invokesuv run autoshipso it works inside the repo's own uv workspace without a global install.
Requirements
- VS Code 1.80 or newer.
- The
autoshipCLI onPATH, or a uv workspace withautoshipas a member, or an explicit path set inautoship.cliPath.
Installation
From source (development)
cd editors/vscode
npm install
npm run compile
# Press F5 in VS Code to launch an Extension Development Host with the extension loaded.
Packaged .vsix
cd editors/vscode
npm install
npm run compile
npx vsce package # produces autoship-0.1.0.vsix
code --install-extension autoship-0.1.0.vsix
Configuration
Open Settings → Extensions → AutoShip or edit settings.json directly:
| Setting | Default | Description |
|---|---|---|
autoship.cliPath |
"" |
Path to the autoship executable. Leave empty to use autoship from PATH (or uv run autoship if a uv project is detected). |
autoship.useUv |
false |
Invoke uv run autoship instead of bare autoship. Auto-detected when a pyproject.toml with the autoship workspace is present. |
autoship.enableLSP |
true |
Start the AutoShip language server for diagnostics and on-save hooks. |
autoship.enableStatusBar |
true |
Show a status bar item with the current AutoShip server status. |
autoship.trace.server |
"off" |
Trace the LSP communication with the AutoShip language server (off / messages / verbose). |
Commands
| Command | Description |
|---|---|
AutoShip: Clean |
Run autoship clean --yes in the integrated terminal. |
AutoShip: Verify |
Run autoship verify against the active Python file. |
AutoShip: Commit |
Run autoship commit (interactive) in the integrated terminal. |
AutoShip: Run On-Save Hook |
Run autoship hooks run --file <active file>. |
AutoShip: Show Status |
Show the current language server state. |
AutoShip: Open Config |
Open (or create) .autoship.toml in the workspace. |
AutoShip: Restart Language Server |
Stop and restart the AutoShip language server. |
How it works
┌──────────────┐ stdio (JSON-RPC 2.0) ┌──────────────────┐
│ VS Code │ ─────────────────────▶ │ autoship lsp │
│ extension │ │ (LSP server) │
│ (LSP client)│ ◀───────────────────── │ │
└──────────────┘ publishDiagnostics └──────────────────┘
│ │
│ subprocess (terminal) │ subprocess
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ autoship clean │ │ autoship verify │
│ / verify / │ │ (per didSave) │
│ commit / hooks │ └──────────────────┘
└──────────────────┘
The extension is intentionally thin: every diagnostic, every hook, every clean rule comes from the CLI. The extension only adds the editor glue.
Troubleshooting
- Diagnostics never appear: ensure
autoship lspstarts on its own (autoship lspthen sendContent-Length-framed JSON-RPC). Checkautoship.trace.serverfor protocol errors. AutoShip: Verifydoes nothing: the command requires an active Python editor; open one and retry.uv run autoshipnot found: installuv(pip install uv) or setautoship.useUvtofalseand putautoshiponPATH.
License
MIT, same as the AutoShip CLI.
中文
功能
- 实时诊断 —— AutoShip 语言服务器在编辑和保存时发布
verify诊断。 - 保存钩子 —— LSP 服务器在
textDocument/didSave时执行[hooks] on_save条目(clean/verify/ 自定义命令),防抖与 glob 过滤与 CLI 完全一致。 - 命令面板 ——
AutoShip: Clean、AutoShip: Verify(当前文件)、AutoShip: Commit、AutoShip: Run On-Save Hook、AutoShip: Show Status、AutoShip: Open Config、AutoShip: Restart Language Server。 - 状态栏 —— 单一项目反映语言客户端状态(启动中 / 运行中 / 已停止),点击重启。
- 配置编辑器 ——
AutoShip: Open Config打开工作区中的.autoship.toml(或.autoship.team.toml),或通过autoship init创建。 - 感知 uv workspace —— 当工作区中的
pyproject.toml引用 autoship 且uv在PATH上时,扩展自动切换为uv run autoship,无需全局安装即可在本仓库的 uv workspace 内运行。
安装(从源码开发)
cd editors/vscode
npm install
npm run compile
# 在 VS Code 中按 F5 启动扩展开发宿主。
配置
打开 设置 → 扩展 → AutoShip,或直接编辑 settings.json:
| 设置 | 默认值 | 说明 |
|---|---|---|
autoship.cliPath |
"" |
autoship 可执行文件路径。留空则使用 PATH 上的 autoship(或检测到 uv 工程时使用 uv run autoship)。 |
autoship.useUv |
false |
调用 uv run autoship 而非裸 autoship。检测到 autoship 的 uv workspace 时自动启用。 |
autoship.enableLSP |
true |
启动 AutoShip 语言服务器以获取诊断与保存钩子。 |
autoship.enableStatusBar |
true |
显示反映服务器状态的状态栏项。 |
autoship.trace.server |
"off" |
跟踪与语言服务器的 LSP 通信(off / messages / verbose)。 |
工作原理
扩展非常薄:所有诊断、所有钩子、所有 clean 规则都来自 CLI,扩展只负责编辑器侧的胶水代码。语言服务器通过 autoship lsp 启动并经 stdio 走 JSON-RPC 2.0;clean / verify / commit / hooks run 在集成终端中以子进程方式运行,保留交互能力(如 commit 的编辑器)。
许可证
MIT,与 AutoShip CLI 一致。
日本語
機能
- リアルタイム診断 —— AutoShip 言語サーバーが編集時および保存時に
verify診断を公開します。 - 保存フック —— LSP サーバーが
textDocument/didSaveで[hooks] on_saveエントリ(clean/verify/ カスタムコマンド)を実行します。デバウンスと glob フィルタは CLI と完全に同一です。 - コマンドパレット ——
AutoShip: Clean、AutoShip: Verify(現在のファイル)、AutoShip: Commit、AutoShip: Run On-Save Hook、AutoShip: Show Status、AutoShip: Open Config、AutoShip: Restart Language Server。 - ステータスバー —— 言語クライアントの状態(起動中 / 実行中 / 停止済み)を反映する単一項目。クリックで再起動。
- 設定エディタ ——
AutoShip: Open Configがワークスペース内の.autoship.toml(または.autoship.team.toml)を開きます。存在しない場合はautoship initで作成を提案します。 - uv ワークスペース対応 —— ワークスペースの
pyproject.tomlが autoship を参照しuvがPATHにある場合、拡張は自動的にuv run autoshipを使用します。グローバルインストールなしでリポジトリの uv ワークスペース内で動作します。
インストール(ソースから開発)
cd editors/vscode
npm install
npm run compile
# VS Code で F5 を押すと拡張開発ホストが起動します。
設定
設定 → 拡張 → AutoShip を開くか、settings.json を直接編集してください:
| 設定 | デフォルト | 説明 |
|---|---|---|
autoship.cliPath |
"" |
autoship 実行ファイルのパス。空欄なら PATH の autoship(uv プロジェクト検出時は uv run autoship)を使用。 |
autoship.useUv |
false |
autoship の代わりに uv run autoship を呼び出します。autoship の uv ワークスペースを検出すると自動で有効化されます。 |
autoship.enableLSP |
true |
診断と保存フックのための AutoShip 言語サーバーを起動します。 |
autoship.enableStatusBar |
true |
サーバー状態を示すステータスバー項目を表示します。 |
autoship.trace.server |
"off" |
言語サーバーとの LSP 通信をトレースします(off / messages / verbose)。 |
ライセンス
MIT(AutoShip CLI と同一)。