diff options
Diffstat (limited to 'elpa/lsp-mode-20220505.630/lsp-sorbet.el')
-rw-r--r-- | elpa/lsp-mode-20220505.630/lsp-sorbet.el | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/elpa/lsp-mode-20220505.630/lsp-sorbet.el b/elpa/lsp-mode-20220505.630/lsp-sorbet.el new file mode 100644 index 0000000..58040a7 --- /dev/null +++ b/elpa/lsp-mode-20220505.630/lsp-sorbet.el @@ -0,0 +1,59 @@ +;;; lsp-sorbet.el --- Sorbet server configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 + +;; Author: Christopher Wilson <chris@sencjw.com> +;; Keywords: + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; lsp-sorbet client + +;;; Code: + +(require 'lsp-mode) + +(defgroup lsp-sorbet nil + "LSP support for Ruby, using the Sorbet language server." + :group 'lsp-mode + :link '(url-link "https://github.com/sorbet/sorbet") + :package-version '(lsp-mode . "8.0.0")) + +(defcustom lsp-sorbet-use-bundler nil + "Run sorbet under bundler" + :type 'boolean + :group 'lsp-sorbet + :package-version '(lsp-mode . "8.0.0")) + +(defun lsp-sorbet--build-command () + "Build sorbet command" + (let ((lsp-command '("srb" "typecheck" "--lsp" "--disable-watchman"))) + (if lsp-sorbet-use-bundler + (append '("bundle" "exec") lsp-command) + lsp-command))) + +(lsp-register-client + (make-lsp-client + :new-connection (lsp-stdio-connection + #'lsp-sorbet--build-command) + :priority -2 + :major-modes '(ruby-mode enh-ruby-mode) + :server-id 'sorbet-ls)) + +(lsp-consistency-check lsp-sorbet) + +(provide 'lsp-sorbet) +;;; lsp-sorbet.el ends here |