-
-
Notifications
You must be signed in to change notification settings - Fork 698
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
LSP: Show auto-complete types instead of the module names #3323
Comments
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. |
Hello! Please reply to my comments above 🙏 |
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: #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 |
Gleam:
![image](https://private-user-images.githubusercontent.com/830536/342078295-40cac882-f8d8-4373-96f1-662e67c11833.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExODk2MDEsIm5iZiI6MTcyMTE4OTMwMSwicGF0aCI6Ii84MzA1MzYvMzQyMDc4Mjk1LTQwY2FjODgyLWY4ZDgtNDM3My05NmYxLTY2MmU2N2MxMTgzMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzE3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxN1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typescript (only on select):
![image](https://private-user-images.githubusercontent.com/830536/342079147-b5af248e-0474-404b-997d-bae4bc575539.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExODk2MDEsIm5iZiI6MTcyMTE4OTMwMSwicGF0aCI6Ii84MzA1MzYvMzQyMDc5MTQ3LWI1YWYyNDhlLTA0NzQtNDA0Yi05OTdkLWJhZTRiYzU3NTUzOS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzE3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxN1QwNDA4MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04NWFlOTUyZmNmYTA4ZWQ2Yzc4MTcxNzc3ZDI1Mzk3Nzk2MDhhZTA3MmQxM2M5Y2ViOWI4NmQ4YzUwN2NlMzI4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.MgzWQLG9nyB5ijvtyDzdicDyYXLNQlFqa_AYyhU-WRw)
Golang (only on select):
![image](https://private-user-images.githubusercontent.com/830536/342079095-be483fa3-d948-413c-894b-e99ada3afa60.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExODk2MDEsIm5iZiI6MTcyMTE4OTMwMSwicGF0aCI6Ii84MzA1MzYvMzQyMDc5MDk1LWJlNDgzZmEzLWQ5NDgtNDEzYy04OTRiLWU5OWFkYTNhZmE2MC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzE3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxN1QwNDA4MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hMDYyODUxZWRjYmVjMjNlNTI3ZDZlOWE0YTJkYzc0ZmQ5NDU5ZTBkYzEwZDcyMmY2ZDk3MmY4ZDE4MWZjODIyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Zt293KN7-dL9ShBc9QsTdqUaLQfjrm40jnlKZGRESro)
I've created a PR to showcase this (#3322), what do you think?
The text was updated successfully, but these errors were encountered: