Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
kassick committed Sep 3, 2024
2 parents 3120ce6 + c36b95b commit d95123d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion clients/lsp-nix.el
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection (lambda () lsp-nix-nixd-server-path))
:major-modes '(nix-mode)
:major-modes '(nix-mode nix-ts-mode)
:server-id 'nixd-lsp
:priority -1))

Expand Down
24 changes: 24 additions & 0 deletions clients/lsp-ruby-lsp.el
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,35 @@
(if lsp-ruby-lsp-use-bundler '("bundle" "exec"))
'("ruby-lsp")))

(defun lsp-ruby-lsp--open-file (arg_hash)
"Open a file. This function is for code-lens provided by ruby-lsp-rails."
(let* ((arguments (gethash "arguments" arg_hash))
(uri (aref (aref arguments 0) 0))
(path-with-line-number (split-string (lsp--uri-to-path uri) "#L"))
(path (car path-with-line-number))
(line-number (cadr path-with-line-number)))
(find-file path)
(when line-number (forward-line (1- (string-to-number line-number))))))

(defun lsp-ruby-lsp--run-test (arg_hash)
"Run a test file. This function is for code-lens provided by ruby-lsp-rails."
(let* ((arguments (gethash "arguments" arg_hash))
(command (aref arguments 2))
(default-directory (lsp-workspace-root))
(buffer-name "*run test results*")
(buffer (progn
(when (get-buffer buffer-name) (kill-buffer buffer-name))
(generate-new-buffer buffer-name))))
(async-shell-command command buffer)))

(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection #'lsp-ruby-lsp--build-command)
:activation-fn (lsp-activate-on "ruby")
:priority -2
:action-handlers (ht ("rubyLsp.openFile" #'lsp-ruby-lsp--open-file)
("rubyLsp.runTest" #'lsp-ruby-lsp--run-test)
("rubyLsp.runTestInTerminal" #'lsp-ruby-lsp--run-test))
:server-id 'ruby-lsp-ls))

(lsp-consistency-check lsp-ruby-lsp)
Expand Down
2 changes: 1 addition & 1 deletion clients/lsp-sqls.el
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(defgroup lsp-sqls nil
"LSP support for SQL, using sqls."
:group 'lsp-mode
:link '(url-link "https://github.com/lighttiger2505/sqls")
:link '(url-link "https://github.com/sqls-server/sqls")
:package-version `(lsp-mode . "7.0"))

(defcustom lsp-sqls-server "sqls"
Expand Down
4 changes: 2 additions & 2 deletions docs/lsp-clients.json
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,8 @@
"name": "sqls",
"full-name": "SQL (sqls)",
"server-name": "sqls",
"server-url": "https://github.com/lighttiger2505/sqls",
"installation": "go install github.com/lighttiger2505/sqls@latest",
"server-url": "https://github.com/sqls-server/sqls",
"installation": "go install github.com/sqls-server/sqls@latest",
"debugger": "Not available"
},
{
Expand Down
2 changes: 1 addition & 1 deletion lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ Changes take effect only when a new session is started."
(robot-mode . "robot")
(racket-mode . "racket")
(nix-mode . "nix")
(nix-ts-mode . "Nix")
(nix-ts-mode . "nix")
(prolog-mode . "prolog")
(vala-mode . "vala")
(actionscript-mode . "actionscript")
Expand Down

0 comments on commit d95123d

Please sign in to comment.