Skip to content

Fix depth detection and respect formatting config - #4

Merged
JesseHerrick merged 2 commits into
open-source-releasefrom
fix-depth-detection-and-formatting
Apr 9, 2026
Merged

Fix depth detection and respect formatting config#4
JesseHerrick merged 2 commits into
open-source-releasefrom
fix-depth-detection-and-formatting

Conversation

@JesseHerrick

@JesseHerrick JesseHerrick commented Apr 8, 2026

Copy link
Copy Markdown
Member

Note

Medium Risk
Touches core Elixir parsing used for alias scoping, reference extraction, and folding ranges, so subtle depth-detection regressions could affect navigation features. Disabling WillSaveWaitUntil reduces behavior on save but is straightforward and covered by updated tests.

Overview
Fixes Elixir scope/depth tracking by switching module-stack popping from indent-based heuristics to block depth counting that understands both do..end and multi-line fn..end, while ignoring false do/end tokens in comments, strings, and heredocs via new helpers like CheckHeredoc, StripCommentsAndStrings, IsEnd, and OpensBlock.

Updates LSP features to use the same stripped-token logic for alias scoping (ExtractAliasesInScope) and folding range detection, and disables WillSaveWaitUntil formatting (capability flag off and handler returns nil), leaving formatting to textDocument/formatting. Adds regression tests for fn blocks, heredocs, and trailing fn patterns, and updates the server test to expect no edits on will-save.

Reviewed by Cursor Bugbot for commit a599cf7. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cd0162e. Configure here.

Comment thread internal/parser/parser.go
@JesseHerrick
JesseHerrick merged commit 8543c29 into open-source-release Apr 9, 2026
4 checks passed
remotecom pushed a commit that referenced this pull request Apr 9, 2026
Apparently GitHub just lets you merge a PR into a PR that has already
been merged rather than automatically updating the base. This adds back
the merged PRs
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