sqlfluff / vscode-sqlfluff

An extension to use the sqlfluff linter in vscode.
https://marketplace.visualstudio.com/items?itemName=dorzey.vscode-sqlfluff
MIT License
156 stars 33 forks source link

Nothing happens after I've installed #82

Open ruben-cit opened 1 year ago

ruben-cit commented 1 year ago

I've followed the installation instructions and nothing happens, either onSave or onEdit. Similar to what Anton and James raised in the reviews.

I ended up manually updating the Preferences: User Settings instead of the Preferences: Settings that is recommended (wasn't an option).

sqlfluff is installed and works from the command line.

I'm running:

Please advise!

RobertOstermann commented 1 year ago

@ruben-cit Yeah I need to update the README to be Preferences: User Settings, I didn't realize that was changed in VSCode. Do you see anything in the SQLFluff output channel?

mgreminger commented 1 year ago

I was seeing the same symptoms. When using the suggested manual configuration in the README, the sqlfluff command fails if the .sqlfluff file doesn't exist. It started working for me when I removed the following line from the settings.json:

"sqlfluff.config": "${workspaceFolder}/.sqlfluff",

ruben-cit commented 1 year ago

@mgreminger Hmmm, interesting. With the following in the settings.json:

"sqlfluff.config": "${workspaceFolder}/dbt/.sqlfluff",

I get the following error in the sqlfluff output:

FileNotFoundError: [Errno 2] No such file or directory: '/root/dbt'

Which is odd because I'm in a User directory

RobertOstermann commented 1 year ago

@ruben-cit Does specifying an exact path work? You could do that in the workspace settings instead of the global settings. Not an ideal solution, just want to see if the problem is locating the workspace folder.

AlgirdasJasinskas commented 1 year ago

Also facing similar issue, just installed sqlfluff, but nothing happened. Preferences: User Settings does not even show up in the command palette when I try to search for it. MacOS.

MinchoG commented 4 months ago

I was seeing the same symptoms. When using the suggested manual configuration in the README, the sqlfluff command fails if the .sqlfluff file doesn't exist. It started working for me when I removed the following line from the settings.json:

"sqlfluff.config": "${workspaceFolder}/.sqlfluff",

you are a lifesaver, thank you, I don't know why isn't this part of the docs - an empty .sqlfluff must be ignored and this field emptied