Skip to content

LSP autocomplete not working in python #125

Open
@mixtli

Description

@mixtli

For some reason, whenever I open a normal python project, LSP autocomplete works fine. For example, if I type:

foo = []
foo.

I see all the standard list methods from LSP in addition to my snippets, etc.

But when running nvim leetcode.nvim, autocomplete only shows snippets.

LspInfo shows that pyright is attached.

I do see this over and over in the Lsp log:
[ERROR][2024-08-29 15:14:55] ...lsp/handlers.lua:623 'File or directory "/" does not exist.'

Any idea why this might be?

Activity

mixtli

mixtli commented on Aug 29, 2024

@mixtli
Author

So, I solved this by finding the leetcode state dir and running:
touch pyrightconfig.json.

It seems initializing the directory as a git repo also works.

I'm not sure how to make this automatic.. But I think a lot of things depend on the root being a git repo to work, so maybe the plugin should just initialize the state repo to a git repo if git is installed? Maybe it's outside the scope of this plugin, but I do think it's confusing for users. It took me way too long to figure this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mixtli

        Issue actions

          LSP autocomplete not working in python · Issue #125 · kawre/leetcode.nvim