sqlfluff / vscode-sqlfluff

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

SQLFluff Formatting Failed. #109

Open skaylie opened 1 year ago

skaylie commented 1 year ago

hi @RobertOstermann,

my dev environment got wiped out and i'm having difficulty getting vscode sqlfluff to work again. ugh. :headbang:

i think i've gotten past getting my executable path set up properly, but now when i try to format a document a blue dash flits across the top of the editor window and an error pops up that just says "SQLFluff Formatting Failed." and no further explanation. none of the dynamic functionality is working either. how can i tell why the formatting is failing? i don't see "SQLFluff Debug Extension" anymore, so i can't really get any clues as to what's going wrong.

scott

RobertOstermann commented 1 year ago

oof thats unfortunate. Checking the SQLFluff output channel is usually the easiest place to see why something is failing.

As for SQLFluff Debug not showing anymore, that is a mistake by me. I should have that showing for all the sqlfluff.format.languages values, but I mistakenly only am enabling it when the language setting has context menu items showing. Not sure when I will push another release to fix that, for now setting up your sqlfluff.format.languages like this should do the trick.

{
  "sqlfluff.format.languages": [
    {
      "language": "sql",
      "preserveLeadingWhitespace": false,
      // Enables SQLFLuff Debug command for this language
      "contextMenuFormatOptions": true
    },
    "sql-bigquery",
    "jinja-sql",
    "postgres",
    "snowflake-sql"
  ],
}