python-lsp / python-lsp-server

Fork of the python-language-server project, maintained by the Spyder IDE team and the community
MIT License
1.9k stars 197 forks source link

Add code completions to `rope_autoimport` plugin #471

Closed tkrabel-db closed 11 months ago

tkrabel-db commented 11 months ago

Fixes #403

Testing

tkrabel-db commented 11 months ago

It's weird. Unrelated tests are failing ...

krassowski commented 11 months ago

Tests are reaching the timeout:

https://github.com/python-lsp/python-lsp-server/blob/d4fb2764ccce0737df87394dc83650fc91e91827/.github/workflows/test-linux.yml#L28

Indeed 7 minutes for pytest here seems suspicious, but there is a small chance it could be GitHub temporarily throttling for no good reason.

tkrabel-db commented 11 months ago

@krassowski I see why the test takes so long.

In any case, I do think the config should look more like

def pylsp_settings() -> Dict[str, Dict[str, Dict[str, Any]]]:
    # Default rope_completion to disabled
    return {
        "plugins": {
            "rope_autoimport": {
                "enabled": False,  # global "kill switch"
                "memory": False,
                "completions": {
                    "enabled": True, 
                },
                "code_actions": {
                    "enabled": True,
                },
            }
        }
    }

I will address this tomorrow. Need some sleep now :)

tkrabel-db commented 11 months ago

Couldn't resist @ccordoba12 @krassowski . I think my PR is ready to review now :)

ccordoba12 commented 11 months ago

@krassowski, would you like to give this one another pass? Or should I merge?