Closed Zhomart closed 2 months ago
The examples you've given here don't support removing the module in my eyes.
Rust: it prominently shows the module first of all. When there is not enough space for the module and the type it shows only the module.
TypeScript: The module is used in the code to filter the suggestions so they all belong to the same module. In this case it is safe to only show the type.
Go: This is completion on an object rather than generally so no modules are included.
It is vital that there is a way for the programmer to be able to tell what module each item comes from. Today we show both the module and the type, with the type being in the further details section, which you have collapsed in VSCode so it does not show.
We could adopt the Rust approach where it shows the type information inline in the instance there is enough space after the module, or we could take some other approach so long as the module is always clear.
I believe gleam should show type information. This helps engineers during coding.
It seems like we can use field to show type informaiton. Let me try create PR and see if it works.
Hi @lpil, please take a look at this (https://github.com/gleam-lang/gleam/pull/3364) example. VSCode shows it nicely. What do you think?
Hello! Please reply to my comments above 🙏
The examples you've given here don't support removing the module in my eyes.
Rust: it prominently shows the module first of all. When there is not enough space for the module and the type it shows only the module.
TypeScript: The module is used in the code to filter the suggestions so they all belong to the same module. In this case it is safe to only show the type.
Go: This is completion on an object rather than generally so no modules are included.
It is vital that there is a way for the programmer to be able to tell what module each item comes from. Today we show both the module and the type, with the type being in the further details section, which you have collapsed in VSCode so it does not show.
We could adopt the Rust approach where it shows the type information inline in the instance there is enough space after the module, or we could take some other approach so long as the module is always clear.
I still think showing types inline is good for engineers. Here's an example that shows both type information and module name. What do you think?
Example implementation: https://github.com/gleam-lang/gleam/pull/3364
Sorry, I must have been unclear in my previous message. How does that present the information when there is insufficient space for both, when you are using the more detailed (default?) completion UI in VSCode, and in other editors? Thank you
VSCode:
When window is too small, this is what we get:
This is 50% of 14" screen:
This issue was open for some time, and it looks like it didn't get any support (except me :) ). I'll close it, as it looks like people prefer the current approach.
Gleam:
How other languages do:
Rust:
Typescript (only on select):
Golang (only on select):
I've created a PR to showcase this (https://github.com/gleam-lang/gleam/pull/3322), what do you think?