sqls
sqls copied to clipboard
Formatting breaks PostgreSQL code
I'm using neovim with nanotee/sqls.nvim plugin but formatting doesn't seem to work properly.
For example, this code:
CREATE TABLE
users (
id BIGSERIAL PRIMARY KEY,
username TEXT UNIQUE NOT NULL CHECK > 8,
password TEXT NOT NULL
);
Will be formatted to:
CREATETABLEusers(
id BIGSERIALPRIMARYKEY,
usernameTEXTUNIQUENOTNULLCHECK>8,
passwordTEXTNOTNULL
);
Check whether you have two sqls LSP servers active same time.
Check whether you have two sqls LSP servers active same time.
I only have sqls for sql files
Same Problem here:
NVIM v0.8.0-1210-gd367ed9b2 Build type: Release LuaJIT 2.1.0-beta3 sqls version: 0.2.22
The only Langauge Server Attached to the session are copilot and sqls:
Running into the same issue:
After writing:
Output of LspInfo:
just ran into same issue
I have a hunch the nvim plugin is allowing the document formatting params to be their defaults, meaning InsertSpaces is false here:
type FormattingOptions struct {
TabSize float64 `json:"tabSize"`
InsertSpaces bool `json:"insertSpaces"`
TrimTrailingWhitespace bool `json:"trimTrailingWhitespace,omitempty"`
InsertFinalNewline bool `json:"insertFinalNewline,omitempty"`
TrimFinalNewlines bool `json:"trimFinalNewlines,omitempty"`
}
okay, this was actually quite silly, i had no conenctions configured because i thought the docs for the neovim plugin that wraps the underlying lsp plugin were all i needed to do.
same happening to me, breaking all queries with auto format