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

REPL tab completion: some completions are missing #40356

Closed
yha opened this issue Apr 5, 2021 · 4 comments · Fixed by #54610
Closed

REPL tab completion: some completions are missing #40356

yha opened this issue Apr 5, 2021 · 4 comments · Fixed by #54610
Labels
REPL Julia's REPL (Read Eval Print Loop)

Comments

@yha
Copy link
Contributor

yha commented Apr 5, 2021

After using Flux,

julia> Flux.CU<tab>

completes to Flux.CUDAint, skipping Flux.CUDA.
Also, Flux.CUDA.all<tab> completes to Flux.CUDA.alloc, skipping Flux.CUDA.allowscalar. An additional tab shows

julia> Flux.CUDA.alloc
alloc          alloc_stats     alloc_timings   alloc_to        allocated       allocated_lock
julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-9800X CPU @ 3.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake-avx512)

Flux version is 0.12.1

@regier21
Copy link
Contributor

regier21 commented Apr 5, 2021

On your second example, allowscalar does not begin with alloc. Was this a typo on your end or am I missing something?

@yha
Copy link
Contributor Author

yha commented Apr 5, 2021

That was a mistake. Typing Flux.CUDA.all<tab> completes to alloc and an additional tab displays the list above. I will edit the original.

@Liozou
Copy link
Member

Liozou commented Dec 23, 2021

I think this may be a duplicate of #36529 (the case of REPL completion is noted in #36529 (comment)). This comes from the fact that CUDA is a separate package imported by Flux.
Since the example is a bit different (CUDA is not defined within Flux), it may be good to leave this open while the other issue is resolved; you can also check whether PR #42094 solves it.

@PetrKryslUCSD
Copy link

Is this the same thing as reported here https://discourse.julialang.org/t/where-is-sparse-ldlt/78929/2?
SparseArrays.cho does not complete to SparseArrays.cholesky.

aviatesk added a commit that referenced this issue May 29, 2024
This commit makes it possible for `names` to return `using`-ed names
as well:
```julia
julia> using Base: @assume_effects

julia> Symbol("@assume_effects") in names(@__MODULE__; usings=true)
true
```

Currently, to find all names available in a module `A`, the following
steps are needed:
1. Use `names(A; all=true, imported=true)` to get the names defined by
   `A` and the names explicitly `import`ed by `A`.
2. Use `jl_module_usings(A)` to get the list of modules `A` has
   `using`-ed and then use `names()` to get the names `export`ed by
   those modules.

This method is implemented in e.g. REPL completions, but it has a
problem: it could not get the names explicitly `using`-ed by
`using B: ...` (#36529, #40356, JuliaDebug/Infiltrator.jl/#106, etc.).

This commit adds a new keyword argument `usings::Bool=false` to
`names(A; ...)`, which, when `usings=true` is specified, returns all
names introduced by `using` in `A`.
In other words, `usings=true` not only returns explicitly `using`-ed
names but also incorporates step 2 above into the implementation of
`names`.

By using this new option, we can now use
`names(A; all=true, imported=true, usings=true)` to know all names
available in `A`, without implementing the two-fold steps on application
side.
As example application, this new feature will be used to simplify and
enhance the implementation of REPL completions.

- fixes #36529

Co-authored-by: Nathan Daly <[email protected]>
Co-authored-by: Sebastian Pfitzner <[email protected]>
aviatesk added a commit that referenced this issue May 29, 2024
This commit makes it possible for `names` to return `using`-ed names
as well:
```julia
julia> using Base: @assume_effects

julia> Symbol("@assume_effects") in names(@__MODULE__; usings=true)
true
```

Currently, to find all names available in a module `A`, the following
steps are needed:
1. Use `names(A; all=true, imported=true)` to get the names defined by
   `A` and the names explicitly `import`ed by `A`.
2. Use `jl_module_usings(A)` to get the list of modules `A` has
   `using`-ed and then use `names()` to get the names `export`ed by
   those modules.

This method is implemented in e.g. REPL completions, but it has a
problem: it could not get the names explicitly `using`-ed by
`using B: ...` (#36529, #40356, JuliaDebug/Infiltrator.jl/#106, etc.).

This commit adds a new keyword argument `usings::Bool=false` to
`names(A; ...)`, which, when `usings=true` is specified, returns all
names introduced by `using` in `A`.
In other words, `usings=true` not only returns explicitly `using`-ed
names but also incorporates step 2 above into the implementation of
`names`.

By using this new option, we can now use
`names(A; all=true, imported=true, usings=true)` to know all names
available in `A`, without implementing the two-fold steps on application
side.
As example application, this new feature will be used to simplify and
enhance the implementation of REPL completions.

- fixes #36529

Co-authored-by: Nathan Daly <[email protected]>
Co-authored-by: Sebastian Pfitzner <[email protected]>
aviatesk added a commit that referenced this issue May 29, 2024
This commit makes it possible for `names` to return `using`-ed names
as well:
```julia
julia> using Base: @assume_effects

julia> Symbol("@assume_effects") in names(@__MODULE__; usings=true)
true
```

Currently, to find all names available in a module `A`, the following
steps are needed:
1. Use `names(A; all=true, imported=true)` to get the names defined by
   `A` and the names explicitly `import`ed by `A`.
2. Use `jl_module_usings(A)` to get the list of modules `A` has
   `using`-ed and then use `names()` to get the names `export`ed by
   those modules.

This method is implemented in e.g. REPL completions, but it has a
problem: it could not get the names explicitly `using`-ed by
`using B: ...` (#36529, #40356, JuliaDebug/Infiltrator.jl/#106, etc.).

This commit adds a new keyword argument `usings::Bool=false` to
`names(A; ...)`, which, when `usings=true` is specified, returns all
names introduced by `using` in `A`.
In other words, `usings=true` not only returns explicitly `using`-ed
names but also incorporates step 2 above into the implementation of
`names`.

By using this new option, we can now use
`names(A; all=true, imported=true, usings=true)` to know all names
available in `A`, without implementing the two-fold steps on application
side.
As example application, this new feature will be used to simplify and
enhance the implementation of REPL completions.

- fixes #36529

Co-authored-by: Nathan Daly <[email protected]>
Co-authored-by: Sebastian Pfitzner <[email protected]>
aviatesk added a commit that referenced this issue May 29, 2024
This commit makes it possible for `names` to return `using`-ed names
as well:
```julia
julia> using Base: @assume_effects

julia> Symbol("@assume_effects") in names(@__MODULE__; usings=true)
true
```

Currently, to find all names available in a module `A`, the following
steps are needed:
1. Use `names(A; all=true, imported=true)` to get the names defined by
   `A` and the names explicitly `import`ed by `A`.
2. Use `jl_module_usings(A)` to get the list of modules `A` has
   `using`-ed and then use `names()` to get the names `export`ed by
   those modules.

This method is implemented in e.g. REPL completions, but it has a
problem: it could not get the names explicitly `using`-ed by
`using B: ...` (#36529, #40356, JuliaDebug/Infiltrator.jl/#106, etc.).

This commit adds a new keyword argument `usings::Bool=false` to
`names(A; ...)`, which, when `usings=true` is specified, returns all
names introduced by `using` in `A`.
In other words, `usings=true` not only returns explicitly `using`-ed
names but also incorporates step 2 above into the implementation of
`names`.

By using this new option, we can now use
`names(A; all=true, imported=true, usings=true)` to know all names
available in `A`, without implementing the two-fold steps on application
side.
As example application, this new feature will be used to simplify and
enhance the implementation of REPL completions.

- fixes #36529

Co-authored-by: Nathan Daly <[email protected]>
Co-authored-by: Sebastian Pfitzner <[email protected]>
aviatesk added a commit that referenced this issue May 29, 2024
The new feature `usings=true` added to `names` enhances REPL completions
by allowing explicitly `using`-ed names to be found.
```julia
julia> using Base: @assume_effects

julia> @assu| # completes to `@assume_effects`
```

As a result, the implementation of REPL completions has been simplified.
Additionally, it allows completion for names that are implicitly or
explicitly `using`-ed in code specifying a module explicitly, such as:
```julia
julia> module A end

julia> A.signi| # completes to `A.significand`
```

- fixes #40356
- fixes #49109
- fixes #53524
aviatesk added a commit that referenced this issue May 29, 2024
The new feature `usings=true` added to `names` enhances REPL completions
by allowing explicitly `using`-ed names to be found.
```julia
julia> using Base: @assume_effects

julia> @assu| # completes to `@assume_effects`
```

As a result, the implementation of REPL completions has been simplified.
Additionally, it allows completion for names that are implicitly or
explicitly `using`-ed in code specifying a module explicitly, such as:
```julia
julia> module A end

julia> A.signi| # completes to `A.significand`
```

- fixes #40356
- fixes #49109
- fixes #53524
aviatesk added a commit that referenced this issue May 29, 2024
The new feature `usings=true` added to `names` enhances REPL completions
by allowing explicitly `using`-ed names to be found.
```julia
julia> using Base: @assume_effects

julia> @assu| # completes to `@assume_effects`
```

As a result, the implementation of REPL completions has been simplified.
Additionally, it allows completion for names that are implicitly or
explicitly `using`-ed in code specifying a module explicitly, such as:
```julia
julia> module A end

julia> A.signi| # completes to `A.significand`
```

- fixes #40356
- fixes #49109
- fixes #53524
aviatesk added a commit that referenced this issue May 30, 2024
This commit makes it possible for `names` to return `using`-ed names
as well:
```julia
julia> using Base: @assume_effects

julia> Symbol("@assume_effects") in names(@__MODULE__; usings=true)
true
```

Currently, to find all names available in a module `A`, the following
steps are needed:
1. Use `names(A; all=true, imported=true)` to get the names defined by
   `A` and the names explicitly `import`ed by `A`.
2. Use `jl_module_usings(A)` to get the list of modules `A` has
   `using`-ed and then use `names()` to get the names `export`ed by
   those modules.

This method is implemented in e.g. REPL completions, but it has a
problem: it could not get the names explicitly `using`-ed by
`using B: ...` (#36529, #40356, JuliaDebug/Infiltrator.jl/#106, etc.).

This commit adds a new keyword argument `usings::Bool=false` to
`names(A; ...)`, which, when `usings=true` is specified, returns all
names introduced by `using` in `A`.
In other words, `usings=true` not only returns explicitly `using`-ed
names but also incorporates step 2 above into the implementation of
`names`.

By using this new option, we can now use
`names(A; all=true, imported=true, usings=true)` to know all names
available in `A`, without implementing the two-fold steps on application
side.
As example application, this new feature will be used to simplify and
enhance the implementation of REPL completions.

- fixes #36529

Co-authored-by: Nathan Daly <[email protected]>
Co-authored-by: Sebastian Pfitzner <[email protected]>
aviatesk added a commit that referenced this issue May 30, 2024
This commit makes it possible for `names` to return `using`-ed names
as well:
```julia
julia> using Base: @assume_effects

julia> Symbol("@assume_effects") in names(@__MODULE__; usings=true)
true
```

Currently, to find all names available in a module `A`, the following
steps are needed:
1. Use `names(A; all=true, imported=true)` to get the names defined by
   `A` and the names explicitly `import`ed by `A`.
2. Use `jl_module_usings(A)` to get the list of modules `A` has
   `using`-ed and then use `names()` to get the names `export`ed by
   those modules.

This method is implemented in e.g. REPL completions, but it has a
problem: it could not get the names explicitly `using`-ed by
`using B: ...` (#36529, #40356, JuliaDebug/Infiltrator.jl/#106, etc.).

This commit adds a new keyword argument `usings::Bool=false` to
`names(A; ...)`, which, when `usings=true` is specified, returns all
names introduced by `using` in `A`.
In other words, `usings=true` not only returns explicitly `using`-ed
names but also incorporates step 2 above into the implementation of
`names`.

By using this new option, we can now use
`names(A; all=true, imported=true, usings=true)` to know all names
available in `A`, without implementing the two-fold steps on application
side.
As example application, this new feature will be used to simplify and
enhance the implementation of REPL completions.

- fixes #36529

Co-authored-by: Nathan Daly <[email protected]>
Co-authored-by: Sebastian Pfitzner <[email protected]>
aviatesk added a commit that referenced this issue May 30, 2024
This commit makes it possible for `names` to return `using`-ed names
as well:
```julia
julia> using Base: @assume_effects

julia> Symbol("@assume_effects") in names(@__MODULE__; usings=true)
true
```

Currently, to find all names available in a module `A`, the following
steps are needed:
1. Use `names(A; all=true, imported=true)` to get the names defined by
   `A` and the names explicitly `import`ed by `A`.
2. Use `jl_module_usings(A)` to get the list of modules `A` has
   `using`-ed and then use `names()` to get the names `export`ed by
   those modules.

This method is implemented in e.g. REPL completions, but it has a
problem: it could not get the names explicitly `using`-ed by
`using B: ...` (#36529, #40356, JuliaDebug/Infiltrator.jl#106, etc.).

This commit adds a new keyword argument `usings::Bool=false` to
`names(A; ...)`, which, when `usings=true` is specified, returns all
names introduced by `using` in `A`.
In other words, `usings=true` not only returns explicitly `using`-ed
names but also incorporates step 2 above into the implementation of
`names`.

By using this new option, we can now use
`names(A; all=true, imported=true, usings=true)` to know all names
available in `A`, without implementing the two-fold steps on application
side.
As example application, this new feature will be used to simplify and
enhance the implementation of REPL completions.

- fixes #36529

Co-authored-by: Nathan Daly <[email protected]>
Co-authored-by: Sebastian Pfitzner <[email protected]>
aviatesk added a commit that referenced this issue May 30, 2024
The new feature `usings=true` added to `names` enhances REPL completions
by allowing explicitly `using`-ed names to be found.
```julia
julia> using Base: @assume_effects

julia> @assu| # completes to `@assume_effects`
```

As a result, the implementation of REPL completions has been simplified.
Additionally, it allows completion for names that are implicitly or
explicitly `using`-ed in code specifying a module explicitly, such as:
```julia
julia> module A end

julia> A.signi| # completes to `A.significand`
```

- fixes #40356
- fixes #49109
- fixes #53524
@giordano giordano added the REPL Julia's REPL (Read Eval Print Loop) label May 31, 2024
aviatesk added a commit that referenced this issue May 31, 2024
This commit makes it possible for `names` to return `using`-ed names
as well:
```julia
julia> using Base: @assume_effects

julia> Symbol("@assume_effects") in names(@__MODULE__; usings=true)
true
```

Currently, to find all names available in a module `A`, the following
steps are needed:
1. Use `names(A; all=true, imported=true)` to get the names defined by
   `A` and the names explicitly `import`ed by `A`.
2. Use `jl_module_usings(A)` to get the list of modules `A` has
   `using`-ed and then use `names()` to get the names `export`ed by
   those modules.

This method is implemented in e.g. REPL completions, but it has a
problem: it could not get the names explicitly `using`-ed by
`using B: ...` (#36529, #40356, JuliaDebug/Infiltrator.jl#106, etc.).

This commit adds a new keyword argument `usings::Bool=false` to
`names(A; ...)`, which, when `usings=true` is specified, returns all
names introduced by `using` in `A`.
In other words, `usings=true` not only returns explicitly `using`-ed
names but also incorporates step 2 above into the implementation of
`names`.

By using this new option, we can now use
`names(A; all=true, imported=true, usings=true)` to know all names
available in `A`, without implementing the two-fold steps on application
side.
As example application, this new feature will be used to simplify and
enhance the implementation of REPL completions.

- fixes #36529

Co-authored-by: Nathan Daly <[email protected]>
Co-authored-by: Sebastian Pfitzner <[email protected]>
aviatesk added a commit that referenced this issue May 31, 2024
This commit makes it possible for `names` to return `using`-ed names as
well:
```julia
julia> using Base: @assume_effects

julia> Symbol("@assume_effects") in names(@__MODULE__; usings=true)
true
```

Currently, to find all names available in a module `A`, the following
steps are needed:
1. Use `names(A; all=true, imported=true)` to get the names defined by
`A` and the names explicitly `import`ed by `A`.
2. Use `jl_module_usings(A)` to get the list of modules `A` has
`using`-ed and then use `names()` to get the names `export`ed by those
modules.

This method is implemented in e.g. REPL completions, but it has a
problem: it could not get the names explicitly `using`-ed by `using B:
...` (#36529, #40356, JuliaDebug/Infiltrator.jl#106, etc.).

This commit adds a new keyword argument `usings::Bool=false` to
`names(A; ...)`, which, when `usings=true` is specified, returns all
names introduced by `using` in `A`.
In other words, `usings=true` not only returns explicitly `using`-ed
names but also incorporates step 2 above into the implementation of
`names`.

By using this new option, we can now use
`names(A; all=true, imported=true, usings=true)` to know all names
available in `A`, without implementing the two-fold steps on application
side.
As example application, this new feature will be used to simplify and
enhance the implementation of REPL completions.

- fixes #36529

Co-authored-by: Nathan Daly <[email protected]>
Co-authored-by: Sebastian Pfitzner <[email protected]>
aviatesk added a commit that referenced this issue May 31, 2024
The new feature `usings=true` added to `names` enhances REPL completions
by allowing explicitly `using`-ed names to be found.
```julia
julia> using Base: @assume_effects

julia> @assu| # completes to `@assume_effects`
```

As a result, the implementation of REPL completions has been simplified.
Additionally, it allows completion for names that are implicitly or
explicitly `using`-ed in code specifying a module explicitly, such as:
```julia
julia> module A end

julia> A.signi| # completes to `A.significand`
```

- fixes #29275
- fixes #40356
- fixes #49109
- fixes #53524
aviatesk added a commit that referenced this issue May 31, 2024
…54610)

The new feature `usings=true` added to `names` enhances REPL completions
by allowing explicitly `using`-ed names to be found.
```julia
julia> using Base: @assume_effects

julia> @assu| # completes to `@assume_effects`
```

As a result, the implementation of REPL completions has been simplified.
Additionally, it allows completion for names that are implicitly or
explicitly `using`-ed in code specifying a module explicitly, such as:
```julia
julia> module A end

julia> A.signi| # completes to `A.significand`
```

- fixes #29275
- fixes #40356
- fixes #49109
- fixes #53524
lazarusA pushed a commit to lazarusA/julia that referenced this issue Jul 12, 2024
This commit makes it possible for `names` to return `using`-ed names as
well:
```julia
julia> using Base: @assume_effects

julia> Symbol("@assume_effects") in names(@__MODULE__; usings=true)
true
```

Currently, to find all names available in a module `A`, the following
steps are needed:
1. Use `names(A; all=true, imported=true)` to get the names defined by
`A` and the names explicitly `import`ed by `A`.
2. Use `jl_module_usings(A)` to get the list of modules `A` has
`using`-ed and then use `names()` to get the names `export`ed by those
modules.

This method is implemented in e.g. REPL completions, but it has a
problem: it could not get the names explicitly `using`-ed by `using B:
...` (JuliaLang#36529, JuliaLang#40356, JuliaDebug/Infiltrator.jl#106, etc.).

This commit adds a new keyword argument `usings::Bool=false` to
`names(A; ...)`, which, when `usings=true` is specified, returns all
names introduced by `using` in `A`.
In other words, `usings=true` not only returns explicitly `using`-ed
names but also incorporates step 2 above into the implementation of
`names`.

By using this new option, we can now use
`names(A; all=true, imported=true, usings=true)` to know all names
available in `A`, without implementing the two-fold steps on application
side.
As example application, this new feature will be used to simplify and
enhance the implementation of REPL completions.

- fixes JuliaLang#36529

Co-authored-by: Nathan Daly <[email protected]>
Co-authored-by: Sebastian Pfitzner <[email protected]>
lazarusA pushed a commit to lazarusA/julia that referenced this issue Jul 12, 2024
…uliaLang#54610)

The new feature `usings=true` added to `names` enhances REPL completions
by allowing explicitly `using`-ed names to be found.
```julia
julia> using Base: @assume_effects

julia> @assu| # completes to `@assume_effects`
```

As a result, the implementation of REPL completions has been simplified.
Additionally, it allows completion for names that are implicitly or
explicitly `using`-ed in code specifying a module explicitly, such as:
```julia
julia> module A end

julia> A.signi| # completes to `A.significand`
```

- fixes JuliaLang#29275
- fixes JuliaLang#40356
- fixes JuliaLang#49109
- fixes JuliaLang#53524
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants