sqls icon indicating copy to clipboard operation
sqls copied to clipboard

Document/Add Helix support

Open H2WO4 opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. Using sqls with helix is possible; but incomplete.

Describe the solution you'd like Similarly to the individual editors plugins done for vim and others, to have more "specialized" support for Helix. Or at least document what config options are available in order to be able to "hack in" support.

Here is what works:

  • Tables and columns autocomplete (sometimes, line breaks seem to break it)
  • Tables and columns hover (markdown tables rendering is currently broken, but that comes from helix: bug report)

Here is what doesn't seems to work:

  • Keyword autocomplete
  • Tables and columns autocomplete needs to often be brought up manually and are sometimes unable to work from a "blank start" (as in you need to start typing at least 1 character for it to work)
  • Signature help
  • Commands

Describe alternatives you've considered Using the other SQL LSP, or switching editor; but neither option is a solution.

Additional context I was not able to figure out why completion doesn't work; but the reason why commands do not seems to be that the commands are registered as code actions, instead of workspace commands.

H2WO4 avatar Jul 21 '24 21:07 H2WO4

also interested in this. @H2WO4 what does your languages.toml look like right now for helix for sqls? I'm having trouble even getting that working.

mmorley0395 avatar Aug 19 '24 20:08 mmorley0395

A straightforward configuration should have sqls somewhat working.

Here's my languages.toml:

[[language]]
name = "sql"
autoformat = false
language-servers = ["sqls"]

# ...

[language-server.sqls]
command = "sqls"

You should also have a sqls/config.yml set up:

connections:
- alias: "connection-name"
  driver: "your-db"
  dataSourceName: "url://to:your@db/"

You may need to change the command field to the absolute path to the sqls executable if it is not in your $PATH.

If you need info for troubleshooting, the :log-open helix command is very useful.

H2WO4 avatar Aug 21 '24 08:08 H2WO4

You should also have a sqls/config.yml set up:

note that this is in $XDG_CONFIG_HOME not in your project

if you want to have it inside your project

[language-server.sqls]
command = "sqls"
args = ["-config","sqls.yml"]

Selion05 avatar May 26 '25 15:05 Selion05