sqls icon indicating copy to clipboard operation
sqls copied to clipboard

Formatting issue on NixOS

Open will-x86 opened this issue 1 year ago • 2 comments
trafficstars

Describe the bug Sqls removes whitespace on save etc.

Formats in an "incorrect" way

To Reproduce Steps to reproduce the behavior:

  1. Open neovim
  2. Save file

Expected behavior image On this code I expect nothing to happen

What actually happens: image

Versions (please complete the following information):

  • OS Version: NixOS 23.11.6621
  • sqls Version: 0.2.28 ( Same thing happens on 0.2.22 )

Additional context My config:

 require'lspconfig'.sqls.setup{
      cmd = { "/run/current-system/sw/bin/sqls", "-config", "~/.config/sqls/config.yml"}
}

Have also tried:

 require'lspconfig'.sqls.setup{
      cmd = { "/run/current-system/sw/bin/sqls", "-config", "~/.config/sqls/config.yml"}
  on_attach = function(client, bufnr)
    require('sqls').on_attach(client, bufnr) -- require sqls.nvim
  end
}

and

 require'lspconfig'.sqls.setup{
      --cmd = { "/run/current-system/sw/bin/sqls", "-config", "~/.config/sqls/config.yml"}
  on_attach = function(client, bufnr)
    require('sqls').on_attach(client, bufnr) -- require sqls.nvim
  end
}

Config file:

lowercaseKeywords: false

I am installed the package via nix config ( unstable and stable tried ) not through mason ( as this leads to path issues ) ?

Nvim version 0.9.4

will-x86 avatar May 04 '24 14:05 will-x86

Same error on MacOS 14.4.1 (23E224) and sqls 0.2.28. The same error was on Nvim version 0.9.4 and on NVIM v0.10.0-dev-3119+gc7958356b. Config the same as in OP

Demianeen avatar May 13 '24 06:05 Demianeen

Try this

            on_attach = function(client, bufnr)
              --
              client.server_capabilities.documentFormattingProvider = false
              client.server_capabilities.documentRangeFormattingProvider = false
              --
            end,

ozdorova avatar May 27 '24 11:05 ozdorova