-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Add placeholders for all class instance methods #3017
Comments
I'd like to give it a try and some help would be more than welcome 😉 |
@batkot Thank advance for your interest! If I do this, I'll first display all methods in code action and then give them a tidy look for users. Please feel free to let me know if you meet any troubles! |
Finally I managed to find some time to work on this (sorry for delay).
Not sure if I'm getting you right, but what I was able to quickly hack is single (well make it 2, counting I'm wondering if some kind of action (or lens?) for adding placeholders for not implemented methods even when minimal requirements are meet would be useful? E.g. creating placeholder for |
Hi again. Time for monthly update, I guess 😅
What kind of secondary list are we talking about? Some kind of "expandable/searchable submenu" or just appending additional items (one per not implemented method)? I'm not sure how to achieve the former (if it's possible, I'd love some directions) and the latter can result in pretty big code action lists (e.g. list of 34 items for |
The first one I think. I don't know what is in vscode(I tried to go through the lsp doc but found nothing), but some other language servers have this. At least we can have only one code action to add unnecessary methods once, though people won't use it very often. |
I did some digging and as you said it looks like LSP doesn't support any kind of CodeAction groupings/filtering. I found this issue for LSP extension, that HLS might support. However it seems a bit forgotten and it's not supported by vscode (and probably other IDEs) by default, so it's probably not worth it. Other LSPs implement their own ux in vscode extensions (e.g. Java, Rust. Roslyn*). *This one is probably for VS. One low hanging fruit, that kind of works, would be to use different Implement minimal requirements in QuickFixes Implement any missing method in Source Action Context Menu: However it still gets messy for Foldable. I'd just drop the Downside is that other clients might not group CodeActions by their Kind (e.g. CoC): Sorry for lengthy post. TL;DR: We have few options:
Both 1. and 2. are VSCode centric and could lead to CodeAction spam in other IDEs, but that could probably be mitigated by configuration/clientCapabilities 🤔 Edit: But, as said, it would require either custom code action handling or custom action that does all the funky stuff (similiar to import) and breaking/extending LSP contract. |
Option 2 looks better to me. Any suggestion? @michaelpj |
Option 2 seems to me like a lot of work for the benefit of being able to insert placeholders for only a subset of class methods. And the fact that it won't work and will have actively bad UX in non-VSCode clients seems pretty bad to me. So I'd probably go with option 3 for now. |
In #2920, we've got all class instance methods and dropped them immediately. So it's not hard to pick them up and supply
add placeholder for xxx
even if they are not the minimal requirements.The main point is how to display these code actions properly because there may be so many items. Reference: #2920 (comment)
I'm willing to offer help if someone plans to pick this:)
The text was updated successfully, but these errors were encountered: