Repository navigation
Language Server: Implement Completion Provider - #1368
Merged
Merged
Conversation
commit: |
🌿 Interactive Playground and Documentation PreviewA preview deployment has been built for this pull request. Try out the changes live in the interactive playground: 🌱 Grown from commit ✅ Preview deployment has been cleaned up. |
marcoroth
marked this pull request as ready for review
March 27, 2026 19:50
marcoroth
force-pushed
the
language-server-completion-provider
branch
from
March 27, 2026 20:05
80c8f42 to
6875413
Compare
…registry The hand-written `action_view_helpers.ts` this branch imported was deleted in #1611, which replaced it with the generated helper registry in `@herb-tools/core`. Merging `main` was textually clean but left the completion provider importing a file that no longer exists, so the package failed to build. Source helper completions from `getHelperEntries()` instead, keeping only public helpers and deduplicating by name (the registry exposes aliased entries under several keys). This grows the completion list from 7 hand-maintained helpers to 227, and each item now carries the registry description alongside the documentation link. Also fix completion context detection inside multi-line ERB tags: the cursor offset was derived from `position.character` minus the content start column, which only holds when the tag starts and ends on the same line. It now goes through document offsets, so <%= link_to "Home", tag.d %> completes HTML tag names rather than helpers.
Three follow-ups on the completion provider: Don't list every view helper for a bare `<% %>`. That tag is usually control flow, so 197 unfiltered helpers is noise. `<%= %>` exists to output a value and still offers the full list immediately; `<% %>` waits until there is a prefix to filter on, which keeps `<% content_for` and friends working. Preselect a single item per list. The LSP allows at most one, and left it to the client to pick when several were marked, so every common tag (and every helper) competing for it made the choice arbitrary. Mark the entry that sorts first instead.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HTML tag names completion
CleanShot.2026-03-27.at.20.44.04.mp4
ActionView Tag helpers
CleanShot.2026-03-27.at.20.48.44.mp4
tag.divcompletionCleanShot.2026-03-27.at.20.46.21.mp4
content_tagcompletionCleanShot.2026-03-27.at.20.48.00.mp4
HTML character reference completion
CleanShot.2026-03-27.at.20.33.12.mp4
Related #1282