Skip to content

feat(expert): fold multiline bitstrings - #897

Merged
doorgan merged 1 commit into
expert-lsp:mainfrom
sophiathedev:issue/146-bitstring-folding
Sep 24, 2026
Merged

doorgan merged 1 commit into
expert-lsp:mainfrom
sophiathedev:issue/146-bitstring-folding

Conversation

@sophiathedev

@sophiathedev sophiathedev commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

adds folding for multiline << ... >> literals and patterns, covering the bitstring item in #146.

reuses the existing line/closing metadata collector for anonymous functions, with no extra AST traversal. the closing >> line stays visible, matching existing block folding. single-line, empty and unclosed bitstrings are skipped; sigil contents don't produce extra bitstring folds.

includes six regression tests for literals, nested/typed segments, patterns, skipped inputs and sigil contents. three tests failed before the fix; all 31 folding tests pass after it.

validation on macOS, Elixir 1.20.3 / OTP 29.0.5, from apps/expert:

  • ERL_FLAGS='-start_epmd false -epmd_module Elixir.Forge.EPMD' mix test --warnings-as-errors — 857 passed, 12 excluded
  • mix compile --warnings-as-errors
  • mix credo --strict
  • mix dialyzer
  • mix format --check-formatted lib/expert/provider/handlers/code_folding.ex test/expert/provider/handlers/code_folding_test.exs
  • git diff --check

based directly on main, independent of #883. both touch the same folding handler, so a small rebase may be needed depending on merge order. other unchecked items in #146 are out of scope.

@doorgan doorgan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you!

@doorgan
doorgan force-pushed the issue/146-bitstring-folding branch from a903d35 to 03471ed Compare September 24, 2026 19:41
@doorgan
doorgan enabled auto-merge (squash) September 24, 2026 19:41
@doorgan
doorgan merged commit 6bbad8c into expert-lsp:main Sep 24, 2026
40 checks passed
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.

2 participants