79445559

Date: 2025-02-17 13:38:57
Score: 0.5
Natty:
Report link

Solution

The problem is LSP.
Using :LspRestart works like a charm in my case.

Can try to setup auto :LspRestart on file save.
Add this to your init.lua or init.vim:

vim.api.nvim_create_autocmd("BufWritePost", {
    pattern = "*.py",
    callback = function()
        vim.cmd("LspRestart")
    end,
})

Or edit your lspconfig pyright settings:

require'lspconfig'.pyright.setup{
    settings = {
        python = {
            analysis = {
                autoSearchPaths = true,
                useLibraryCodeForTypes = true,
                diagnosticMode = "workspace",
            },
        },
    },
}

Reasons why its working on MacOS but not on EndeavourOS

According to ChatGPT:

Inotify vs. FSEvents (Linux vs. macOS)

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Tomtei