summaryrefslogtreecommitdiff
path: root/.config/nvim/lsp/pyright.lua
blob: d5a139a7c27e6a5e8e20270b9bf797d8503c4c1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
return {
  cmd = { "pyright-langserver", "--stdio" },
  filetypes = { "python" },
  root_markers = {
    "pyproject.toml",
    "setup.py",
    "setup.cfg",
    "requirements.txt",
    "Pipfile",
    "pyrightconfig.json",
    ".git",
  },
  capabilities = {
    offsetEncoding = { "utf-8" },
  },
  single_file_support = true,
  settings = {
    pyright = {
      -- use ruff import organizer
      disableOrganizeImports = true,
    },
    python = {
      analysis = {
        -- ignore all files for analysis and use ruff for linting
        ignore = { '*' },
        -- diagnosticSeverityOverrides = "none",
        autoSearchPaths = true,
        useLibraryCodeForTypes = true,
        diagnosticMode = "openFilesOnly",
        -- typeCheckingMode = "off",
      },
    },
  },
}