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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Unable to Ignore Repetitive Suggestions #96

Open
ayoubelmhamdi opened this issue Apr 20, 2023 · 7 comments
Open

[Question] Unable to Ignore Repetitive Suggestions #96

ayoubelmhamdi opened this issue Apr 20, 2023 · 7 comments
Labels
question Further information is requested

Comments

@ayoubelmhamdi
Copy link
Contributor

I am unable to ignore repetitive suggestions in my editor neovim while using the Lighthub 馃挕 icon. I have noticed that two suggestions from Ruff keep appearing even though I have already considered them in the past. I believe this is due to my consistent usage of the 馃挕 which remains visible at all times, leading to the repetition of the same suggestions. Could you please provide a solution to this issue so that I can use my editor without any hindrances?

require('lspconfig').ruff_lsp.setup {
  on_attach = on_attach,
  init_options = {
    settings = {
      args = {
      ignore: {
         "Ruff: Organize Import",
         "Ruff: Fix ALL"
         --or
         1234,
         5678
        },
      },
    }
  }
}

image

@ayoubelmhamdi ayoubelmhamdi changed the title [Question] code completion ignore: [Question] Unable to Ignore Repetitive Suggestions Apr 20, 2023
@charliermarsh
Copy link
Member

Looks like this might be the same as #91 -- does that look like the same issue to you?

@charliermarsh charliermarsh added the question Further information is requested label Apr 23, 2023
@dhruvmanila
Copy link
Member

Yes, this is the same as #91.

Also, the way you would want to use the args settings it to provide the command-line arguments in the same format as mentioned in ruff check --help:

require('lspconfig').ruff_lsp.setup {
  on_attach = on_attach,
  init_options = {
    settings = {
      args = {
      	"--ignore=E501",
	  }
    }
  }
}

@ayoubelmhamdi
Copy link
Contributor Author

@dhruvmanila But these two suggestions don't have a code to ignore them
rem-1
.

@dhruvmanila
Copy link
Member

Yes, I think you're confusing code actions with rule codes. If you really want to filter these out unconditionally, you can use the filter option for vim.lsp.buf.code_action function (https://neovim.io/doc/user/lsp.html#lsp-buf).

@xuanhung1509
Copy link

I've just stumbled on the same issue. Although I can filter out those two messages with

require("lspconfig").ruff_lsp.setup({
  init_options = {
    settings = {
      fixAll = false,
      organizeImports = false,
    },
  },
})

But that also means I cannot use those two actions anymore. I'd love to have those actions implemented as an editor command (like in vscode).

image

Hopefully this will be implemented in the future.

@ayoubelmhamdi
Copy link
Contributor Author

yes. it works fine for me thank you very match.

@dhruvmanila
Copy link
Member

But that also means I cannot use those two actions anymore. I'd love to have those actions implemented as an editor command (like in vscode).

For Neovim you can define these commands similar to VSCode. Please refer to #295 (comment). You can then use a keybinding to execute that command. Hope this helps!

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

No branches or pull requests

4 participants