BasicAutoloads.jl icon indicating copy to clipboard operation
BasicAutoloads.jl copied to clipboard

autocomplete

Open aplavin opened this issue 1 year ago • 2 comments

I wonder if BasicAutoloads could add registered symbols to REPL autocomplete? So that they could be tab-completed same as already available symbols. The goal is to make it is seamless as possible – should be convenient!

aplavin avatar Oct 10 '24 11:10 aplavin

Oh, that would be quite cool.

LilithHafner avatar Oct 10 '24 21:10 LilithHafner

I couldn't figure out a sensible way to do this. Declaring globals registers for autocompletion but then those globals mask the symbols loaded with using.

julia> @test_no# does not autocomplete
ERROR: LoadError: UndefVarError: `@test_no` not defined in `Main`
Suggestion: check for spelling errors or missing imports.
in expression starting at REPL[1]:1

julia> global var"@test_nowarn"

julia> @test_nowarn # Does autocomplete
ERROR: LoadError: UndefVarError: `@test_nowarn` not defined in `Main`
Suggestion: add an appropriate import or assignment. This global was declared but not assigned.
in expression starting at REPL[3]:1

julia> using Test
WARNING: using Test.@test_nowarn in module Main conflicts with an existing identifier.

julia> @test_nowarn
ERROR: LoadError: UndefVarError: `@test_nowarn` not defined in `Main`
Suggestion: add an appropriate import or assignment. This global was declared but not assigned.
Hint: a global variable of this name also exists in Test.
in expression starting at REPL[5]:1

A hook in REPL would make this much easier.

LilithHafner avatar Oct 10 '24 22:10 LilithHafner

Figured it out! Coming out now in 1.0.4.

LilithHafner avatar Dec 04 '24 03:12 LilithHafner