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 does not insert imports #557

Open
sblask opened this issue May 9, 2024 · 0 comments
Open

Autocomplete does not insert imports #557

sblask opened this issue May 9, 2024 · 0 comments

Comments

@sblask
Copy link

sblask commented May 9, 2024

I think I have autocomplete set up in Neovim so it should work:

lspconfig["pylsp"].setup({
    on_attach = function(_client, buffer)
        setup_format_on_save(buffer)
    end,
    settings = {
        pylsp = {
            plugins = {
                jedi_completion = {
                    enabled = false,
                },
                rope_completion = {
                    enabled = true,
                },
                rope_autoimport = {
                    enabled = true,
                    completions = {
                        enabled = true,
                    },
                    code_actions = {
                        enabled = true,
                    },
                },
            },
        },
    },
})

and rope is installed alongside python-lsp-server:

$ ~/.opt/pylsp/bin/pip freeze
docstring-to-markdown==0.15
jedi==0.19.1
packaging==24.0
parso==0.8.3
platformdirs==4.2.1
pluggy==1.4.0
python-lsp-jsonrpc==1.1.2
python-lsp-server==1.11.0
pytoolconfig==1.3.1
rope==1.13.0
ujson==5.9.0

If I for example type typ followed by ctrl-x ctrl-o I get a completion menu:

Screenshot 2024-05-10 at 1 40 37 AM

Choosing types from the menu does complete the word, but I don't get an import for types. I couldn't find anything in the logs. Is there anything I am missing? Code actions are not available either, but that's another story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant