yaegassy / coc-sqlfluff

SQLFluff (A SQL linter and auto-formatter for Humans) extension for coc.nvim
https://www.npmjs.com/package/coc-sqlfluff
MIT License
28 stars 1 forks source link

Is there a way to turn this while editing a specific file? #8

Closed jjjchens235 closed 3 years ago

jjjchens235 commented 3 years ago

Hi again- been enjoying this tool very much.

Question: I know there is functionality to add to .ignore files, and you can also turn it off on specific lines. But is it possible within the file, for me to type some sort of command to disable/re-enable linting for the entire file ?

yaegassy commented 3 years ago

Hi, Try to run this command

:call CocAction('diagnosticToggle')

https://user-images.githubusercontent.com/188642/135135065-376089b0-9257-4b1a-9f0e-782f6adb6bc1.mp4

jjjchens235 commented 3 years ago

Works great, thank you!

jjjchens235 commented 2 years ago

Hey again! So the solution you posted works great, as it makes all the errors go away, but the linter is still running in the background

For bigger .sql files this is an issue because it uses a lot of CPU.

Is it possible to make the linter stop running altogether?

yaegassy commented 2 years ago

Sorry for the late reply. To completely stop the execution of linter, set the following in coc-settings.json.

coc-settings.json:

{
  "sqlfluff.lintOnOpen": false,
  "sqlfluff.lintOnChange": false,
  "sqlfluff.lintOnSave": false
}