Uh oh!
There was an error while loading. Please reload this page.
fix editor launch fallback when saved editor is unavailable - #681
fix editor launch fallback when saved editor is unavailable#681baggiiiie wants to merge 1 commit into
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Issue: Opening a file could fail when the requested editor command was no longer installed, even if another supported launcher was available in the current environment. Cause: The server launch path resolved the requested editor id directly and only discovered command availability later, so it never reconciled the request against the editors actually available on PATH. Fix: Resolve the requested editor against the current environment before building the launch command. Keep the requested editor when it is available, otherwise fall back to another supported command editor, then to the file manager. When the file manager is the only option for a line-targeted path, strip the line and column suffix and open the base file instead. Add focused server tests for the fallback behavior.
03e5044 to
46dad54Compare
What Changed
apps/server/src/open.ts:line[:column], so it opens the base file path instead of failing.apps/server/src/open.test.tsWhy
Issue #209:
Cause:
Fix:
before
before.mp4
after
after.mp4
UI Changes
No UI changes
Checklist
Note
Fix editor launch fallback when saved editor is unavailable on PATH
resolveEditorLaunchin open.ts now checks PATH at runtime to determine which editors are available, falling back to another command-based editor or the file manager when the requested editor is not found.resolveLaunchEditorto encapsulate editor selection logic, andstripLineColumnSuffixto strip:line:columnfrom paths passed to the file manager on fallback.OpenErrorwith a clear message when no supported editor command is available at all.withTempDirEnvhelper to simulate editor binaries on PATH and cover the fallback and suffix-stripping behavior.Macroscope summarized 46dad54.