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

Autocomplete when writing new classes/modules is not very helpful #2335

Open
Earlopain opened this issue Jul 19, 2024 · 2 comments
Open

Autocomplete when writing new classes/modules is not very helpful #2335

Earlopain opened this issue Jul 19, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Earlopain
Copy link
Contributor

Earlopain commented Jul 19, 2024

Description

Reproduction steps

When typing class/module and continuing on, ruby-lsp offers existing classes/modules as autocomplete. This is a nice idea, however I find it highly annoying in basically all cases:

Aufzeichnung.2024-07-19.110648.mp4

Basically, I can't use enter in most of the cases here and have to either remember to press escape beforehand or undo the autocomplete after it happened.

I think, an ok solution may be to insert what was currently typed as the first suggestion. Or maybe to not offer third-party classes/modules here (but even then you will be at the innermost layer at one point which then will contain an identifier not yet indexed), most of the time you're not reopening third-party classes/modules. Not sure what the best thing to do is, I just know I'm unhappy with how it currently works.

@Earlopain Earlopain added the bug Something isn't working label Jul 19, 2024
@vinistock
Copy link
Member

Thank you for the report! You're right, the experience is not great when creating new classes or modules.

The team discussed this and we're slightly torn between not showing completion at all while declaring the class/module and your clever suggestion of showing the constant you're typing as a candidate.

If you're interested in contributing, we'd love to see what the experience would be like with the approach you suggested. It would be nice to also show to the user that the completion item refers to the thing they are typing at that moment and not some other declaration (maybe we can use label details for that).

@Earlopain
Copy link
Contributor Author

Yeah, I can look into how that would work with. I'm not at all familiar with that part of the code, will have to see how that goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants