Repository navigation
Changed
-
The index carries each file path once — definitions and refs repeated the file's absolute path on every row: 122 characters across 3.9 million refs on a large monorepo, plus a second copy inside the path index, which together were more than half the database. Both tables now hold an integer
file_idintofiles.idx_refs_function_kindwent with it — no query leads withfunction, so SQLite never chose it, and it cost 80 MB and a share of every rebuild. This is what the index version bump pays for: an index built by an earlier version is rebuilt once, on first start -
initand the server share one cold-build pipeline — both built an index from nothing and each had its own implementation.initparsed on every core and wrote a single bulk transaction with the indexes dropped; the server walked serially, parsed one file at a time and committed a transaction per file against live indexes. On a 10,000-file corpus that was 4.441s against the shared pipeline's 1.088s, for identical rows. The server now reaches the same pipeline, under the empty-index check where its own build already lived -
Less work for the single SQLite writer — a cold index is bound by the one writer rather than by parsing: on a 70,000-file monorepo the parse workers use about 12s of CPU across 15 cores while the writer needs 4.6s, so the pipeline ran at the speed of one core. Refs are now deduped in the parse workers, which have the CPU to spare — a
@specrepeatingString.t()wrote one identical row per occurrence, 59,792 of them on that monorepo, and every one was invisible to every query. Bulk inserts are batched into multi-row statements, and the two prefix lookups use a range rather than aLIKEthat SQLite could not turn into an index range
Fixed
-
A
\line continuation inside a heredoc cut the file short — a backslash at the end of a line inside a"""heredoc drops the newline from the content, but the line it ends is still a line, and a closing"""on the next one still closes the heredoc. The scanner consumed the escaped newline and carried on without testing that next line for the delimiter, so the heredoc never closed and the rest of the file was scanned as string content: every definition and reference below it was silently missing, the same failure as the#{flag?}and comment-in-interpolation bugs with a third trigger. Interpolation is not needed to hit it — a plain wrapped log message is enough. On a 70,000-file monorepo this recovered 1,409 definitions across 36 files, one of them losing 31 of its 33 functions; on a 4,000-file project, 402 -
A module rename deleted the module when its file path did not change — the conventional path is the module's last segment, snake_cased, inside the directory the file already sits in, and
camelToSnakefolds an acronym into its capitalised form:ABTestandAbTestare bothab_test, as areHTTPClientandHttpClient. Normalising that casing is an ordinary rename, and it computed a "new" path equal to the old one, wrote the file there and then removed the old path — removing the file it had just written. The module was gone, with only the reply's edits to the other files left pointing at it. A file whose conventional path is unchanged is now left where it is and has its contents rewritten in place, and no rename operation is sent to the client for a path that is not moving -
A comment inside
#{}cut the file short — a comment written in a multi-line interpolation runs to the end of its line, so a}or a"in its text is inert. The tokenizer read them as real delimiters, closed the interpolation at the brace and the string at the quote, and then scanned the rest of the file as string content: every definition and reference below was lost, the same silent failure as the#{flag?}bug. Found while building deep-nesting regression tests, and older than the interpolation work above -
Code inside
#{}was invisible to the index — a string literal was read as one opaque token, so every module reference and every call written inside an interpolation was missing."<#{Config.admin_url(slug)}|#{slug}>"gave no go-to-definition, no hover and no find-references, and — worse — a module or function rename rewrote every ordinary call site while leaving the interpolated ones pointing at a name that no longer existed. The tokenizer now records the code inside#{}in a stream of its own, kept beside the file's tokens rather than mixed into them, so string literals still count as one token for@docextraction and for block-depth tracking, and ado/end/fninside an interpolation cannot be miscounted. Strings, charlists, heredocs and interpolating (lowercase) sigils such as~sand~rare covered, nested interpolation included ("outer #{"inner #{x}"}"); an uppercase sigil stays raw text, as Elixir reads it. Parsing the whole of a 70,000-file monorepo costs about 2% more for this. A rename also reaches an interpolated call written through an alias injected byuse, where the short name has no alias line of its own in the file -
Everything after
#{flag?}fell out of the index — a predicate name inside a string interpolation ends in?, which also opens a char literal in Elixir (?a). The tokenizer read the?ofIO.puts("...(DRY RUN: #{dry_run?})...")the second way, so it swallowed the interpolation's closing brace and scanned the whole rest of the file as string content: every definition and reference below that line was silently missing from the index. One real file lost 150 lines' worth, and a module rename left itsRepo.insert!calls behind because nothing knew they existed. A?straight after a name now ends that name, and a char literal in operand position still tokenizes as one -
Rename missed call sites reached through an alias injected by
use— a module whose__using__block declaresalias MyApp.Repoputs that short name in the scope of every module that uses it, so those files writeRepo.insert(...)with no alias line of their own. The index holds such a site under the bareRepo, which a lookup forMyApp.Repocannot see, and renaming the module rewrote theuselines while leaving every one of those calls pointing at a module that no longer existed. On a 1,500-file project the rename went from 694 sites to 1,368, with nothing but comments left mentioning the old name. The injecting module is found from the renamed module's own references — thealiasline inside a__using__body is itself an indexed reference — so a rename that injects nothing pays one small query, and go-to-references now finds these call sites for a function too. Aliases injected through anExUnit.CaseTemplate(using dorather thandefmacro __using__) are included, which is how test files reach theirs.usecalls are paired with their exact modules, alias state, token order and lexical branches, including blocks that open or close later on the same line -
Renaming a
withclause's argument renamed the wrong binding — a clause's expression is evaluated before that clause's own pattern binds, so thesitein{:ok, site} <- authorize(site)names what the previous clause bound. Renaming it reached forward into the second pattern, the later^sitepin and thedoblock, which all belong to the binding being introduced on that same line. The occurrences of a clause's binding now stop at the next pattern that binds the name anew; a pinned pattern ({:ok, ^site} <-) binds nothing, so it and the body still follow the earlier binding, and a pin in the first clause names the outer binding as it should -
Positions were wrong on any line containing a non-ASCII character — LSP counts
Position.characterin UTF-16 code units, and Dexter counted UTF-8 bytes. The two agree only while a line stays ASCII, so one accented character, bullet or emoji to the left of the cursor was enough to break go-to-definition, hover, references, completion and signature help. Worse, ranges were emitted in bytes too, so an editor applying a rename replaced a span shifted off the identifier and silently corrupted the source. Columns are now converted in both directions, on every client -
Module rename left the old file behind — renaming a module from the file that defines it moved that file on disk while the editor still held the buffer, so the next save recreated the old file with the new module name and the project no longer compiled (
cannot define module X because it is currently being defined in ...). Open files are now moved by the editor, through arenameresource operation in the reply, and the server touches neither path -
Typespec mentions counted as calls — a module reference written in a typespec, such as
Ecto.Schema.schema()in@spec put_meta(Ecto.Schema.schema(), meta), names a type but was indexed as a call. It therefore turned up in find-references for the macro of that name, and go-to-definition and hover on it described the macro. Typespec references now carry their own kind: a lookup for a function leaves them out, and a lookup for a type keeps only those. Inside a typespec, definition and hover prefer the type; outside one they prefer the function. Typespec context ends at the declaration's real statement boundary instead of leaking into later expressions. Same-file bare type uses (@type t :: schema | embedded) are reported alongside the indexed references, and a type parameter (thetin@type wrapper(t) :: t) still resolves to its occurrences -
A type won over a same-named function — in a module that declares both, such as
Ecto.Schemawith@type schemaabovedefmacro schema/2, go-to-definition and hover on a bare call landed on the type, because the buffer scan returned whichever came first in the file. Functions now win outside a typespec, types win inside one (@type,@spec,@callbackand their continuation lines), and either kind is still found when only it exists -
Private namesakes offered as definition targets — go-to-definition on a call reaching another module (an explicit remote call, or a bare call imported through
use) offered the module's private helper of the same name next to the public one.Ecto.Schemaexportsdefmacro field/3and keeps adefp field/4, sofield :email, :stringin a schema gave two targets. Private definitions are now dropped when the call site sits outside the defining module and a public namesake exists; a module's own private functions, private helpers injected by a__using__block, and modules with no public namesake are unaffected -
Aliases built on other aliases —
alias SharedLib.Accountsfollowed byalias Accounts.Users,alias Accounts.{Tokens, Roles}, orrequire Accounts.Macros, as: Mkept the short prefix (Accounts.Users) instead of resolving to the canonical module, so definition, hover and references missed the target. The leading segment of an alias/require line is now expanded through the aliases already in scope, in both the index parser and the open-document parser -
Phoenix's
use MyAppWeb, :controllerresolved nothing — ausethat dispatches on an atom reaches its aliases and imports through a__using__that branches on that atom and splices in a quoted helper, so everything a controller, view or LiveView inherits that way was invisible: no completion, no go-to-definition, no hover and no find-references for any of it. The dispatch atom and its options are now carried through nestedusechains, quoted local helpers such asunquote(html_helpers())are followed, and quoted and tuple dispatch atoms are both handled. Dispatch parsing is scoped per module, so each module in a multi-module file resolves its own -
require Mod, as: Nameinside__using__— an alias injected by arequire ... , as:in aquote doblock (directly, or through a delegatedusing_block/1helper) was dropped, so modules thatusethe injector could not resolve the short name -
Grouped aliases were not renamed —
alias Old.{A, B}(and therequire/importforms) kept pointing at the old module after a module rename, and in open buffers the shared prefix was rewritten once per member (Old→NewNewNew...) -
The formatter's BEAM server warned on every start — a binary pattern that uses an already-bound variable as its size must pin it (
binary-size(^size)). Without the pin, Elixir 1.19 and later print a deprecation warning through the server's stderr capture each time it starts, and the message says it is to become an error. Both patterns inbeam_server.exsare pinned