Open david-christiansen opened 5 days ago
Isn't there also the idea floating around of a change to name resolution, so that if open A
, then A.B.f
works as B.f
for b : B
? So that namespace can add selective dot notation to other types?
That language change would indeed introduce a third way to remedy this!
Description
When a library transitively imports the Lean language server, then various functions that it defines in the
IO.FS.Stream
namespace show up in completion results for streams. In fact, they make up the majority of these completion results!This could easily hit a user who's downstream of Verso or Alloy, both of which define their own LSP handlers.
Context
This came up when working on the IO chapter of the reference manual, but it's not a blocker in the slightest.
Steps to Reproduce
#check IO.FS.Stream.
and invoke completion.import Lean
as the first line of the fileExpected behavior:
I would expect that the completions were unchanged.
Actual behavior:
The majority of the completions list has to do with JSON-RPC and LSP, giving the impression that this is the purpose of
IO.FS.Stream
.Suggestions
I think this could be solved in two ways in the language server:
Get those functions out of the namespace. This would make the experience of working on the LSP server a bit worse, because dot-completion would no longer select those functions.
Define
abbref LspStream := IO.FS.Stream
and then put the functions in theLSPStream
namespace. This would spare downstream users from seeing them, and also perhaps make it marginally more clear which role a given stream plays.Versions
"4.15.0-nightly-2024-11-19"
, on live.lean-lang.org.Impact
I think this is a papercut at worst.
Add :+1: to issues you consider important. If others are impacted by this issue, please ask them to add :+1: to it.