-
Notifications
You must be signed in to change notification settings - Fork 203
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 code action for implementing auto-import #403
Comments
FYI, there is a vim plugin called |
Any response? I wasn't clear enough? |
Feel free to submit a pull request. If you need some inspiration, code actions are already implemented in pylsp-ruff. |
FYI: I'm ready to tackle this. I think about the following:
I think about redefining settings to: @hookimpl
def pylsp_settings() -> Dict[str, Dict[str, Dict[str, Any]]]:
# Default rope_completion to disabled
return {
"plugins": {
"rope_autoimport": {
"memory": False,
"completions": {
"enabled": False,
},
"code_actions": {
"enabled": False,
},
}
}
} @krassowski @ccordoba12 changing the settings name likely means a major release, right? I'd really keep code actions and completions under the single rope_autoimport file as both share a lot of functionalities. |
Not major but minor, i.e. from 1.8.x to 1.9.0
Sounds good to me. |
How do I enable this? I've tried both the config above (adapted to lua) and the config in the readme but I get no code-action alternative to import. |
@Lewenhaupt can you explain exactly what you did? I use this when sending the export const INITIALIZATION_OPTIONS = {
pylsp: {
plugins: {
rope_autoimport: {
memory: false,
enabled: true,
code_actions: { enabled: true },
completions: { enabled: false },
},
},
},
}; |
This is my current config. I'm using NVChad as my base config.
|
Does actvating any other plugin work? E.g. can you enable flake8? |
I'll check tonight 👍 |
Hi,
while the auto-import feature is great, it is not enough. And a code action to do import of a certain class from module could be a very good improvement.
The text was updated successfully, but these errors were encountered: