Skip to content

Commit

Permalink
lsp-sqls: Add lsp-sql-show-tables command (#4534)
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki authored Sep 23, 2024
1 parent f02aac0 commit e87fbdc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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.
* Change ~ruff-lsp~ to ~ruff~ for python lsp client. All ~ruff-lsp~ customizable variable change to ~ruff~. Lsp server command now is ~["ruff" "server"]~ instead of ~["ruff-lsp"]~.
* Add futhark support
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

0 comments on commit e87fbdc

Please sign in to comment.