# Providing custom REPL PathCompletions

**URL:** <https://discourse.julialang.org/t/providing-custom-repl-pathcompletions/93515>\
**Category:** Internals & Design\
**Created:** [January 25, 2023, 3:46pm UTC](https://discourse.julialang.org/t/providing-custom-repl-pathcompletions/93515 "2023-01-25T15:46:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonasIsensee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jonasisensee/32/4704_2.png) [@JonasIsensee](https://discourse.julialang.org/u/JonasIsensee)\
**Post date:** [January 25, 2023, 3:46pm UTC](https://discourse.julialang.org/t/providing-custom-repl-pathcompletions/93515/1 "2023-01-25T15:46:15Z")

</div>

Hierarchical dataformats such as HDF5.jl and [JLD2.jl](https://github.com/JuliaIO/JLD2.jl)  
use path-like strings to refer to datasets, e.g.

```julia
julia> using JLD2
julia> f = jldopen("20200918_02_rodcell_bigdomain000012.h5")
┌ Warning: This file was not written with JLD2. Some things may not work.
└ @ JLD2 /.../.julia/dev/JLD2/src/JLD2.jl:378
JLDFile /.../20200918_02_rodcell_bigdomain000012.h5 (read-only)
 └─📂 20200918_02_rodcell_bigdomain000012
    ├─📂 completeStates
    │ ├─📂 initialState
    │ │ ├─🔢 phi
    │ │ ├─🔢 attached
    │ │ ├─📂 reg
    │ │ │ └─ ⋯ (3 more entries)
    │ │ └─ ⋯ (12 more entries)
    │ └─📂 finalState (15 entries)
    └─ ⋯ (7 more entries)

julia> f["20200918_02_rodcell_bigdomain000012/completeStates/finalState/t"]
300.0000109540947

```

It would be super useful to be able to use tab-completion when accessing these structures.  
Currently, these _path_ completions are essentially hard-coded in `REPL.REPLCompletions`  
( [julia/REPLCompletions.jl at 9b1ffbbe1bce1eaf3327535ae3e46e923e8d9aff · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/blob/9b1ffbbe1bce1eaf3327535ae3e46e923e8d9aff/stdlib/REPL/src/REPLCompletions.jl#L239) )

My [experimental PR](https://github.com/JuliaIO/JLD2.jl/pull/448) for JLD2 just overwrites this definition and the REPL will then offer tab completions for currently open files as well:

```julia
julia> "/
.config/ 20200918_02_rodcell_bigdomain000012/ bin/ boot/
etc/ home/ lib/ lib32/
...

julia> "/20200918_02_rodcell_bigdomain000012/
completeStates/ parameters/ particleType repoVersion runinfo/ snapshots/ version worldType
julia> "/20200918_02_rodcell_bigdomain000012/completeStates/
finalState/ initialState/
julia> "/20200918_02_rodcell_bigdomain000012/completeStates/

```

Of course, I can’t _just_ overwrite that function in JLD2 but if there were an official way to supply the REPL or an IDE with tab completions (for strings) that would be a real quality of life improvement in this context.
