-
Notifications
You must be signed in to change notification settings - Fork 5
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
Refactorings when cursor on name #7
Comments
Hi @climbus, thanks for trying out this project. Can you elaborate a bit by providing a sample code that you're trying to work with, and where your cursor is when invoking codeaction-selected? A screenshot displaying these is probably going to be quite useful here. |
Code Action is context sensitive and the options that are available is based on what you select. Any problems with this filtering is almost definitely on rope-pylsp at this point as it is pylsp-rope that filters the valid CodeActions. I've re-used some part of rope code for some of the more complex condition checking and when it's trivial to do so, but currently this can still be a bit hit and miss (some actions that are shown may not be valid, and some actions that are actually valid may not be shown). This part of pylsp-rope is something that definitely still needs improvement. Additionally, some code actions like extract method refactoring are currently always displayed even in contexts that doesn't make sense because the validation logic for that action isn't implemented yet. Given that, the LSP client in use might also be partly responsible for some of these issues. It seems like in Vim, different LSP clients behave differently when you don't visually select something when triggering CodeAction, and even when you visually select the selection range they send may be different depending on which function you have mapped to invoke code action on that client. I've documented the setup that I used for testing here, which I found to work. |
Description
When run codeaction-selected with cursor on method invocation, it shows only extract method refactoring.
When visual select function name, it shows many refactorings.
I don't know if the problem is with rope-pylsp, python-lsp-server or coc.
coc-pyright shows many refactoring on cursor.
Details
Logs for invocation with cursor on method name
The text was updated successfully, but these errors were encountered: