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

No completions from database #7

Open
johanwk opened this issue Oct 20, 2020 · 9 comments
Open

No completions from database #7

johanwk opened this issue Oct 20, 2020 · 9 comments

Comments

@johanwk
Copy link

johanwk commented Oct 20, 2020

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?)

@theothornhill
Copy link

theothornhill commented Oct 23, 2020

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.

@yyoncho
Copy link
Member

yyoncho commented Oct 23, 2020

  1. Do you have company-mode?
  2. Can you set lsp-print-io to t and then look for textDocument/completion requests and responses?

@theothornhill
Copy link

theothornhill commented Oct 23, 2020

  1. Yes I do
  2. 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

@yyoncho
Copy link
Member

yyoncho commented Oct 23, 2020

Seems like the completion does not return anything. The issue might be:

  1. lsp-mode not sending something server specific which has changed in recent versions.
  2. 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.

@theothornhill
Copy link

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?

@yyoncho
Copy link
Member

yyoncho commented Oct 23, 2020

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)

@theothornhill
Copy link

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...

@yyoncho
Copy link
Member

yyoncho commented Oct 23, 2020

I was doing that by wrapping the server binary with a script that pipes the stdin/stdout to a file.

@johanwk
Copy link
Author

johanwk commented Nov 22, 2020

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"?

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