emacs-lsp / lsp-mssql

lsp-mode :heart: MSSQL Server
https://emacs-lsp.github.io/lsp-mssql
MIT License
34 stars 7 forks source link

Connection error #10

Closed OrionRandD closed 2 years ago

OrionRandD commented 2 years ago

I installed it in emacs-doom When I open a *.sql file and issue: M-x lsp M-x lsp-mssql-connect

I get this error: lsp--send-request-async: The connected server(s) does not support method connection/connect.

This is my config:

(add-load-path! "~/.emacs.d/local-repo/lsp-mssql") (require 'lsp-mssql) (add-hook 'sql-mode-hook 'lsp)

(setq lsp-mssql-connections [(:server "localhost" :database "" :user "SA" :password "demoPWD2")])

yyoncho commented 2 years ago

Can you do M-x lsp-describe-session after M-x lsp?

OrionRandD commented 2 years ago

[X] /home/vagner/Documents/programming_courses/sql_course [X] /home/vagner/Documents/programming_courses/C_course/c_programs_examples_Mega-Reddy [X] /home/vagner/Documents/programming_courses/cs50-Harvard

yyoncho commented 2 years ago

Then what happens after M-x lsp? Seems like there is no connection to the language server

OrionRandD commented 2 years ago

Then what happens after M-x lsp? Seems like there is no connection to the language server

LSP :: File /home/vagner/Documents/programming_courses/sql_course/test.sql is in blacklisted directory /home/vagner/ LSP :: test.sql not in project or it is blacklisted.

It says that it is blacklisted /home/vagner/ which is my $HOME but it shows up there that [X] /home/vagner/Documents/programming_courses/sql_course is in the lsp project???!!!

yyoncho commented 2 years ago

M-x lsp-workspace-folder-remove, delete home entry and try M-x lsp again.

yyoncho commented 2 years ago

lsp-workspace-blacklist-remove is the right function name

OrionRandD commented 2 years ago

lsp-workspace-blacklist-remove is the right function name

Seems to work now. But some directives should be in UPPER-CASE I believe...

OrionRandD commented 2 years ago

lsp-workspace-blacklist-remove is the right function name

It is funny because the server is connected, but the modeline says it is disconnected https://imgur.com/hjqctmt.png I´d like to get rid of this modeline misleading message: SQL Server disconnected in my modeline...

yyoncho commented 2 years ago

Then run lsp-mssql-connect. The language server is connected, but the language server is not connected to the sql server....

OrionRandD commented 2 years ago

Then run lsp-mssql-connect. The language server is connected, but the language server is not connected to the sql server....

LSP :: sql:124808 initialized successfully in folders: (/home/vagner/Documents/programming_courses/sql_course) LSP :: Failed to connect with the following error error number: 0 A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server) Auto-saving...

daveloyall commented 2 years ago

@OrionRandD, that error A network-related or instance-specific [...] is the standard error message that MS SQL Server clients throw when no response is received when the client tries to connect to the user-supplied host and port. For example: database-server.yourcompany.com, TCP port 1433 (the default).

Did you customize the values listed here to match your local environment?

(setq lsp-mssql-connections
[(:server "localhost"
:database ""
:user "SA"
:password "demoPWD2")])

The values listed there will instruct the LSP to attempt to connect to the default port (tcp 1433) on localhost (aka 127.0.0.1, which means "self", so: the same computer the client is running on). Do you have MS SQL Server or SQL Server Express installed and running on your computer?

OrionRandD commented 2 years ago

@OrionRandD, that error A network-related or instance-specific [...] is the standard error message that MS SQL Server clients throw when no response is received when the client tries to connect to the user-supplied host and port. For example: database-server.yourcompany.com, TCP port 1433 (the default).

Did you customize the values listed here to match your local environment?

(setq lsp-mssql-connections
[(:server "localhost"
:database ""
:user "SA"
:password "demoPWD2")])

The values listed there will instruct the LSP to attempt to connect to the default port (tcp 1433) on localhost (aka 127.0.0.1, which means "self", so: the same computer the client is running on). Do you have MS SQL Server or SQL Server Express installed and running on your computer?

I think what I am missing is MS sql-server itself. As I can see here: https://computingforgeeks.com/how-to-install-ms-sql-on-ubuntu/ But, since I do not use ubuntu I cannot test it. Thx for replying anyway...