lsp-mssql
lsp-mssql copied to clipboard
No completions from database
I have installed lsp-mssql (from melpa), in Emacs 27.1 on Windows 10.
This works: I can connect to the database, there is syntax checking for the SQL, and I can execute queries and see the results. All this is already useful.
However, there is no completion (is that what "intellisense" means?) for table names or field names. Any hints on how to get this working?
(Command lsp-describe-session shows red diamonds on my buffer file name, and on 'Capabilities'. Something is obviously missing, but where to look? On startup there's a message "Python3 not found", but does this matter for completion?)
Same issue here. Everything but completion seems to work.
Where do I start to debug this? Edit: I get completions from native sql functions, but not identifiers from the DB I am working on.
- Do you have company-mode?
- Can you set lsp-print-io to t and then look for textDocument/completion requests and responses?
- Yes I do
- See https://paste.sr.ht/~theothornhill/5cc9b67fc7cf7bbb6eda36078970db3fda186289 - I've snipped some work info
I use lsp-mode for many languages: C#, elm, F#, JS/TS etc, and they all work fine with completion, both native keywords and more complex cases.
I can add that:
- Running queries work fine
- Showing the treemacs thing and connecting works fine
- Looking at schemas and all that work fine
Seems like the completion does not return anything. The issue might be:
- lsp-mode not sending something server specific which has changed in recent versions.
- You not triggering the completion in the expected position.
If memory serves me right the completion was working if you do:
SELECT | FROM TABLE_FOO
with the cursor being on |
.
If it is 1. then we need to compare the traffic between vscode extension and the server and emacs and the server.
I tried with your example there, and also some other places in both emacs and vs code, and vs code completes fine all over. My guess is that it's (1.)
What is the best next step to figure out what's wrong?
Collect the logs from both vscode/emacs from start to hitting the bug(as minimal as possible) and then find out what is missing on emacs side. (I am away from dev work for some time)
The vscode version doesn't seem to have a trace.server
option, so I have no Idea at all for how to find that log unfortunately. Cannot find it referenced anywhere...
I was doing that by wrapping the server binary with a script that pipes the stdin/stdout to a file.
I was doing that by wrapping the server binary with a script that pipes the stdin/stdout to a file.
I'd be happy to try this, but don't know where to start. You don't happen to have a pointer, to a recipe for a suitable "wrapper script"?