Skip to content

fix(lsp): restore create_class writes when lsp is off - #532

Merged
akiojin merged 2 commits into
developfrom
work/issue-531
Oct 24, 2026
Merged

akiojin merged 2 commits into
developfrom
work/issue-531

Conversation

@akiojin

@akiojin akiojin commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • UNITY_CLI_LSP_MODE=off の create_class が「requires LSP」で失敗する回帰を修正し、v0.18.1 と同じ直接保存を復元します。
  • auto / required / 未設定は既存の LSP 書き込み経路と結果フィールドを維持します。

Changes

  • src/tooling/local_tools.rs: off の場合だけ親ディレクトリを作成してテンプレートを保存し、success / path / content を返します。既存の名前・パス検証と既存ファイル拒否を再利用します。
  • src/tooling/local_tools.rs: off の直接保存、既存ファイル拒否、パス指定、MonoBehaviour / ScriptableObject の UnityEngine using を回帰テストで検証します。他の LSP 書き込みツールの off 時エラーも既存テストで維持します。
  • tests/csharp_post_write.rs: 既存の CLI 統合テストを auto / required / 未設定の3モードに拡張し、LSP の backend / applied / changedFiles と生成内容を確認します。
  • README.md / CHANGELOG.md: off の例外動作と Unreleased の互換性回復を記載します。
  • .gwt/work/events/: この実装の最終 Work 記録を同梱します。

Testing

canonical verify.run: PASS、record vrr-9a98d0c910544163b0f1741291ae631d、対象 commit 1d03ecb。

  • cargo fmt --all -- --check
  • cargo +stable clippy --all-targets -- -D warnings
  • cargo test --all-targets -- --test-threads=1 — 単体575件およびWindowsで実行可能な統合テストが成功。
  • cargo run -- skills lint --severity error
  • dotnet test lsp/Server.Tests.csproj — 846件成功。
  • bun x markdownlint-cli README.md --config .markdownlint.json --ignore-path .markdownlintignore
  • Linux: cargo test --manifest-path .cache/issue-531/unix-source/Cargo.toml --test csharp_post_write create_class -- --test-threads=1 — Git commit の隔離スナップショットで3モードの CLI 統合テストが成功。Windowsのcore.autocrlfによるshebangのCRLFは、snapshot内のPython fixtureをGitのLF原本にして切り分けました。製品コードへの追加変更はありません。
  • RED → GREEN: 新テストは修正前に create_csharp_file requires LSP で失敗し、修正後の create_class 関連7件が成功。

主な回帰シナリオ:

  • create_class_writes_directly_when_lsp_is_off
  • create_class_lsp_off_preserves_unityengine_using_and_path_override
  • create_class_rejects_existing_file
  • lsp_write_tools_require_lsp_mode
  • create_class_writes_through_lsp_and_keeps_output_shape

Launch mode: autonomous
User Verification Result: n/a (autonomous)
Agent Visual Check: n/a (no UI surface)

PR Readiness

  • State: Ready for review
  • Releaseable slice: yes — Issue fix(lsp): restore direct file writes for create_class when UNITY_CLI_LSP_MODE=off #531 の互換性回復と回帰テスト・ドキュメントが揃っています。
  • Known blockers: None
  • Remaining acceptance: None for implementation. required CI と develop への反映を確認するまで Issue の AC は未完了として扱い、マージ後に base を再監査します。

Closing Issues

Closes #531

Related Issues / Links

Checklist

  • Tests added/updated
  • Lint/format passed (cargo clippy, cargo fmt; svelte-check は UI 変更がないため対象外)
  • Documentation updated
  • Migration/backfill: n/a — データ・スキーマ変更なし
  • CHANGELOG impact considered

Context

原因は create_class が LSP モードにかかわらず local_lsp_write(create_csharp_file) を呼んでいたことです。

PM default ruling (override available): off の create_class だけを直接保存へ戻します。他のモードと他の書き込みツールの挙動は変えず、Issue の受け入れ基準を満たす最小変更に限定しました。

Agent: ミヤビ・ホンダ (Codex)

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 156bc847-ccf3-4b26-bc03-814ae1a08a14

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@akiojin
akiojin enabled auto-merge October 24, 2026 18:48
@akiojin
akiojin merged commit 0404bbc into develop Oct 24, 2026
21 checks passed
@akiojin
akiojin deleted the work/issue-531 branch October 24, 2026 19:08
@akiojin

akiojin commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

ミヤビ・ホンダ: develop への配信を確認しました。

origin/develop=0404bbc0b1b7ccb893ccdead8402069ebcc9df31 は検証済み HEAD 1d03ecb を包含し、変更した4製品ファイルも一致しています。最新 canonical verify.run vrr-9a98d0c910544163b0f1741291ae631d は全6コマンドPASS、CIは19成功・2対象外・失敗0です。Issue #531 の AC-1〜5 を更新済みです。

User Verification Result: n/a (autonomous)
Agent Visual Check: n/a (no UI surface)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant