⏺ The CI run already completed successfully — that was the result I s… #64
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
seq-lisp-2-backport
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/seq-lisp!64
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "lsp-crashing-bug"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
…hared
above (489 Lisp tests, 8 Seq tests, 8 LSP tests all passing). The fix is
installed and ready to test in your editor. Restart Neovim and try editing a
.slisp exercise file — the LSP should no longer crash.
PR Review: LSP Crashing Bug Fix
Summary
This PR fixes a critical LSP crash by converting the
(exit)function from immediately terminating the process to returning a special error signal. The LSP'seval-all-with-errorsfunction now treats exit signals as normal completion, while the REPL and file runner properly handle them by callingos.exit.Code Quality: ✅ Excellent
Strengths:
is-exit-signal?andexit-signal-codefollow the project's naming conventionsImplementation Details:
The new exit signal pattern is elegant - it preserves the EvalResult on the stack, uses special magic strings to distinguish exit signals from real errors, and correctly handles both exit codes (0 and 1).
Potential Issues: ⚠️ Minor Concerns
1. Magic String Encoding (Low Priority)
The exit codes are encoded as magic strings
"__exit:0__"and"__exit:1__". This works but has limitations:eval-exit-with-envfunction accepts any number but only handles 0 vs non-zero(exit 42)but it's treated as(exit 1)While this is sufficient for the test suite use case (
tests/lisp/all.slisp:51), consider documenting this limitation or extending to support arbitrary exit codes if needed.2. Exit Signal Detection Pattern (Design Question)
The pattern for detecting exit signals is repeated in two locations:
src/repl.seq:61-65(eval-all-quiet)src/repl.seq:95-99(eval-all-print)This is acceptable duplication, but if more contexts need this pattern, consider a helper function like
handle-exit-or-error.3. Stack Comments for Compiler (Minor)
The "Never reaches here" comments with
dropstatements (src/repl.seq:63, 97) are for compiler stack balancing. Consider making them slightly clearer:# Unreachable: os.exit terminates. Stack balance for type checker.Security Concerns: ✅ None
"__exit:0__"as a symbol, which would not match error messages)eval-exit-with-env(src/eval.seq:2365-2371)Performance Considerations: ✅ Good
eval-err?is already trueTest Coverage: ✅ Adequate
The PR description mentions:
Verified Coverage:
tests/seq/test_lsp_features.seqtests/lisp/all.slisp:51Missing Test Coverage:
While the existing tests pass, there's no specific test for the new exit signal behavior. Consider adding a test like:
"(define x 1) (exit 0)" test-returns-okArchitecture Alignment: ✅ Excellent
This fix aligns perfectly with the documented error handling architecture (docs/ARCHITECTURE.md:177-186). The exit signal pattern extends the EvalResult principle: evaluation returns a result, execution context decides what to do.
Best Practices: ✅ Followed
Recommendations
Required:
None - this PR is ready to merge as-is.
Optional Improvements:
exitfunction's comment blockVerdict: ✅ APPROVE
This is a well-designed fix that solves the LSP crash without introducing technical debt. The separation between "evaluating exit" (returns signal) and "executing exit" (calls os.exit) is the right architectural choice. The code is clean, well-commented, and maintains the project's quality standards.
Impact:
Great work! 🚀