# Implementing HDF5.jl REPL tab completion, private REPL.REPLCompletions.find\_dict\_matches

**URL:** <https://discourse.julialang.org/t/implementing-hdf5-jl-repl-tab-completion-private-repl-replcompletions-find-dict-matches/139505>\
**Category:** General Usage\
**Tags:** repl, hdf5, repl-autocomplete\
**Created:** [September 17, 2026, 1:15am UTC](https://discourse.julialang.org/t/implementing-hdf5-jl-repl-tab-completion-private-repl-replcompletions-find-dict-matches/139505 "2026-09-17T01:15:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [September 17, 2026, 1:15am UTC](https://discourse.julialang.org/t/implementing-hdf5-jl-repl-tab-completion-private-repl-replcompletions-find-dict-matches/139505/1 "2026-09-17T01:15:16Z")

</div>

I am implementing multi-level REPL path completion in HDF5.jl. The only way I have figured out how to implement multi-level completion is by overloading `REPL.REPLCompletions.find_dict_matches` which is not public. This API appears to be stable since at least Julia 1.10, but I would prefer a public API if it existed or were to exist.

**Is there any chance this could be made public or if there is a public API on the way?**

Here is my current test procedure. See the pull request below for a video demo.

```julia
begin
    using Pkg
    Pkg.activate(;temp=true)
    Pkg.add(url="https://github.com/mkitti/HDF5.jl",rev="hdf5-tree-completion")
    Pkg.add(url="https://github.com/mkitti/HDF5.jl",rev="hdf5-tree-completion", subdir="HDF5TreeCompletion")
end

begin
    using HDF5, HDF5TreeCompletion, Downloads
    url = "https://github.com/evetion/SpaceLiDAR-artifacts/releases/download/v0.3.0/ATL08_20201121151145_08920913_006_01.h5";
    fn = Downloads.download(url)
    h5 = h5open(fn)
end

```

> <https://github.com/JuliaIO/HDF5.jl/pull/1247>
>
> \## Summary
> \- \`H5DataStore \<: AbstractDict\` (#1245) only gives single-level REPL …tab completion (\`f\["\<TAB\>"\]\`), since Julia's dict-key completion resolves the receiver expression via type inference (not execution), requiring it to reduce to a \`Core.Const\` — only a bare variable can ever satisfy that, never a compound expression like \`f\["a"\]\` (a real, effectful HDF5 \`getindex\` call). So neither a single \`"/"\`-delimited path string nor chained bracket indexing (\`f\["a"\]\["b"\]\`) can decompose into multi-level completion through that path — confirmed by reading Julia 1.13's actual \`REPLCompletions.jl\` source and reproducing empirically.
> \- Adds a new, fully \*\*optional\*\* monorepo subpackage, \`HDF5TreeCompletion/\`, that overrides the internal \`REPL.REPLCompletions.find\_dict\_matches\` specifically for \`HDF5.H5DataStore\`, splitting the partial key on the last \`/\` and resolving the prefix via a real HDF5 lookup.
> \- Deliberately \*\*not\*\* bundled into HDF5.jl itself (no weakdep, no extension) since it depends on an unexported, version-fragile REPL internal — isolating it in its own package means a future Julia release restructuring that internal only needs a fix here (degrades gracefully to no multi-level matches, not an error), and users who'd rather not carry that risk simply don't install it.
> 
> This is a 4th, independent piece of the HDF5.jl v0.18 stack (alongside #1244, #1245, #1246), stacked on top of #1245 since it needs \`H5DataStore \<: AbstractDict\` to exist. Opened as \*\*draft\*\* since it's stacked on an unmerged PR — will show #1245's commit until that merges.
> 
> \## Test plan
> \- \[x\] New \`HDF5TreeCompletion/test/runtests.jl\` (own standalone \`Pkg.test()\`) exercises \`REPL.REPLCompletions.completions(...)\` directly against a real nested HDF5 file: top-level, one/two levels deep, partial trailing segment, invalid intermediate prefix (no matches, no error), and the single-match auto-close-bracket convenience behavior. All 6 pass.
> \- \[x\] Manually verified in a fresh Julia session: \`f\["gt1l/land\_segments/\<TAB\>"\]\` correctly lists nested children.

---

<div class="post-metadata">

**Author:** ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Post date:** [September 17, 2026, 2:57pm UTC](https://discourse.julialang.org/t/implementing-hdf5-jl-repl-tab-completion-private-repl-replcompletions-find-dict-matches/139505/2 "2026-09-17T14:57:36Z")

</div>

Thanks, I need this in my life!

If theres no way to do this without relying on internals I would probably still consider to use this as a drop-in package than can be loaded in interactive sessions. Would such a package require much type piracy and hacks?

(Unfortunately I have no idea regarding making this not depend on internals)
