Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting issue on NixOS #153

Open
seal opened this issue May 4, 2024 · 2 comments
Open

Formatting issue on NixOS #153

seal opened this issue May 4, 2024 · 2 comments

Comments

@seal
Copy link

seal commented May 4, 2024

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

@Demianeen
Copy link

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

@ozdorova
Copy link

Try this

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

Demianeen added a commit to Demianeen/dotfiles that referenced this issue Jun 11, 2024
There is an issue with formatting after which sql becomes gibberish
sqls-server/sqls#153
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants