Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto-completion doesn't work correctly in pkg mode #54906

Closed
matthias314 opened this issue Jun 23, 2024 · 7 comments · Fixed by JuliaLang/Pkg.jl#3959
Closed

auto-completion doesn't work correctly in pkg mode #54906

matthias314 opened this issue Jun 23, 2024 · 7 comments · Fixed by JuliaLang/Pkg.jl#3959
Milestone

Comments

@matthias314
Copy link
Contributor

On master, auto-completion doesn't work for package names in package mode. For example,

(@v1.12) pkg> st
Status `~/.julia/environments/v1.12/Project.toml`
  [0ca39b1e] Chairmarks v1.2.1

(@v1.12) pkg> rm Chair [ now press TAB ]

doesn't complete "Chair" to "Chairmarks". It works on 1.10.4 and 1.11.0-beta2.

Julia Version 1.12.0-DEV.766
Commit 9d8ecaa899d (2024-06-21 17:00 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 24 × Intel(R) Xeon(R) CPU E5-2430 0 @ 2.20GHz
  WORD_SIZE: 64
  LLVM: libLLVM-17.0.6 (ORCJIT, sandybridge)
Threads: 1 default, 0 interactive, 1 GC (on 24 virtual cores)
@KristofferC KristofferC added this to the 1.12 milestone Jun 23, 2024
@kimikage
Copy link
Contributor

kimikage commented Jun 24, 2024

It appears that REPLExt is not loaded (as a regular package extension) at startup (even though it should be loaded actually).

julia> using Pkg

julia> Base.get_extension(Pkg, :REPLExt)|>typeof
Nothing

julia> using REPL # Force reinitialization

julia> Base.get_extension(Pkg, :REPLExt)|>typeof
Module

Edit: This could be related to PR #54739 and PR #54891 (see their comments and links) .

@KristofferC
Copy link
Member

I think it is loaded (how else would there be a Pkg REPL) but it is "hidden". Those linked PRs are indeed relevant.

@IanButterworth
Copy link
Member

It works for me if I julia +nightly -ie "using Pkg"
but not if I

$ julia +nightly
julia> using Pkg
pkg>

or

$ julia +nightly
julia>]
pkg>

I think it's something to do with the require_stdlib loading mechanics being different. Perhaps part of the REPLExt initialization script assumes a module is classically loaded or something.

@IanButterworth
Copy link
Member

The problem is that this is failing to find REPLExt when Pkg is loaded via require_stdlib https://github.com/JuliaLang/Pkg.jl/blob/e6880bc9d8a04d95df6e341c76786219a4efc33f/src/REPLMode/command_declarations.jl#L5

@vtjnash
Copy link
Member

vtjnash commented Jul 21, 2024

Ah, makes sense. That is typically forbidden for packages to hook into in that way, as they are only allowed to access packages that they depend upon explicitly

@IanButterworth
Copy link
Member

Yeah, I'll try to rework it into something dispatching on a type.

@IanButterworth
Copy link
Member

Fix: JuliaLang/Pkg.jl#3959

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@vtjnash @KristofferC @IanButterworth @kimikage @matthias314 and others