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

feat: Add lsp-sql-show-tables command to lsp-sqls #4534

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.org
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Add support for C# via the [[https://github.com/dotnet/roslyn/tree/main/src/LanguageServer][Roslyn language server]].
* Add basic support for [[https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_pullDiagnostics][pull diagnostics]] requests.
* Add ~lsp-flush-delayed-changes-before-next-message~ customization point to enforce throttling document change notifications.
* Add ~lsp-sql-show-tables~ command.
* Fix bug in ~rust-analyzer.check.features~ configuration via ~lsp-rust-checkonsave-features~ Emacs setting: we were defaulting to ~[]~, but ~rust-analyzer~ defaults to inheriting the value from ~rust-analyzer.cargo.features~. The bug resulted in code hidden behind features not getting type checked when those features were enabled by setting ~rust-analyzer.cargo.features~ via the ~lsp-rust-features~ Emacs setting.

** 9.0.0
Expand Down
9 changes: 9 additions & 0 deletions clients/lsp-sqls.el
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ use the current region if set, otherwise the entire buffer."
"workspace/executeCommand"
(list :command "showConnections" :timeout lsp-sqls-timeout))))

(defun lsp-sql-show-tables (&optional _command)
"Show tables."
(interactive)
(lsp-sqls--show-results
(lsp-request
"workspace/executeCommand"
(list :command "showTables" :timeout lsp-sqls-timeout))))

(defun lsp-sql-switch-database (&optional _command)
"Switch database."
(interactive)
Expand Down Expand Up @@ -176,6 +184,7 @@ use the current region if set, otherwise the entire buffer."
("showDatabases" #'lsp-sql-show-databases)
("showSchemas" #'lsp-sql-show-schemas)
("showConnections" #'lsp-sql-show-connections)
("showTables" #'lsp-sql-show-tables)
("switchDatabase" #'lsp-sql-switch-database)
("switchConnections" #'lsp-sql-switch-connection))
:server-id 'sqls
Expand Down
Loading