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

handlers feature doesn't work in ruff configuration #3530

Closed
Jaehaks opened this issue Dec 26, 2024 · 1 comment
Closed

handlers feature doesn't work in ruff configuration #3530

Jaehaks opened this issue Dec 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Jaehaks
Copy link

Jaehaks commented Dec 26, 2024

Description

lspconfig.ruff.setup({ -- use ruff as python linter
  on_attach = function (client, bufnr)
    -- lsp use ruff to formatter
    client.server_capabilities.documentFormattingProvider = false      -- enable vim.lsp.buf.format()
    client.server_capabilities.documentRangeFormattingProvider = false -- formatting will be used by confirm.nvim
    client.server_capabilities.hoverProvider = false                   -- use pylsp
  end,
  -- cmp_nvim_lsp default_configuration add completionProvider. ruff_lsp don't use completion
  filetype = {'python'},
  root_dir = function (fname)
    return lsp_util.root_pattern('.git')(fname) or vim.fn.getcwd()
  end,
  single_file_support = true,
  init_options = {
    settings = {
      configuration = paths.lsp.ruff.config_path,
      logFile = paths.lsp.ruff.log_path,
      logLevel = 'warn',
      organizeImports = true, -- use code action for organizeImports
      showSyntaxErrors = true, -- show syntax error diagnostics
      codeAction = {
        disableRuleComment = { enable = false }, -- show code action about rule disabling
        fixViolation = { enable = false }, -- show code action for autofix violation
      },
      format = {			-- use conform.nvim
        preview = false,
      },
      lint = {            -- it links with ruff, but lint.args are different with ruff configuration
        enable = true,
      },
    }
  },
  handlers = {
    ['textDocument/publishDiagnostics'] = vim.lsp.with(
    vim.lsp.diagnostic.on_publish_diagnostics, {
      virtual_text = false,
    }
    )
  }
})

ruff remains showing virtual text diagnostics event though I set the setting false
Image

@Jaehaks Jaehaks added the bug Something isn't working label Dec 26, 2024
@justinmk
Copy link
Member

autoclosing since Nvim version wasn't mentioned

handlers will probably be removed anyway.

@justinmk justinmk closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants