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

Many fields not available in (REPL) autocomplete #660

Open
fonsp opened this issue Jan 4, 2021 · 6 comments
Open

Many fields not available in (REPL) autocomplete #660

fonsp opened this issue Jan 4, 2021 · 6 comments

Comments

@fonsp
Copy link
Member

fonsp commented Jan 4, 2021

If I type HTTP.UR in the Julia REPL and press TAB, nothing comes up. This can make HTTP.jl difficult to use.

The same for:
URIs, URI, Router, @register, splitpath, unescapeuri, queryparams, and more

@chris-b1
Copy link
Contributor

I think something like JuliaLang/julia#38162 would be necessary to fix this. It proposes "scoped" exports, so that names like Router could marked as API without being brought in as names by using

@fonsp
Copy link
Member Author

fonsp commented Mar 15, 2021

I think that this is something different. Normally autocomplete also shows fields that are not exported:

julia> module Example
       x1 = 1
       x2 = 2
       export x1
       end
Main.Example

julia> using .Example

julia> Example.x

x1 x2

But indeed, it looks like the problem is that these fields are not included in names(HTTP, all=true):

julia> :Router  names(HTTP, all=true)
false

julia> HTTP.Router
HTTP.Handlers.Router

julia> :URI  names(HTTP, all=true)
false

julia> HTTP.URI
URIs.URI

@quinnj
Copy link
Member

quinnj commented May 27, 2022

@fonsp, could you post an update here? Is there something actionable for HTTP.jl or URIs.jl here? I'm happy to dig in, but just want to know if you have a better idea of the context/issue here and what we would need to do and where.

@quinnj
Copy link
Member

quinnj commented Jun 16, 2022

I'm not sure there's anything we can do here in HTTP.jl apart from getting rid of all submodules and just defining everything in a single HTTP module, but that seems quite heavy-handed and gives up a lot of clean separation we have.

@quinnj quinnj closed this as completed Jun 16, 2022
@fredrikekre
Copy link
Member

Could make everything that is public API available in the HTTP module, and the rest in an Internals module. Doesn't have to mean code has to be organized that much, see e.g. https://github.com/fredrikekre/Canvas.jl

@quinnj
Copy link
Member

quinnj commented Jun 22, 2022

That's true and actually probably wouldn't be too hard. I think we would just want to look at the existing submodules and what they export and then define those names at the top-level HTTP module, then wrap everything else in an Internals module. Or maybe we don't even need the Internals module, since we already have all these submodules where they can just import the public API methods/structs to provide the functionality.

Anyone want to have a go at implementing this? If not, I can get around to it in the next little while.

@quinnj quinnj reopened this Jun 22, 2022
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

No branches or pull requests

4 participants