aboutsummaryrefslogtreecommitdiffstats
path: root/elpa/lsp-mode-20220505.630/lsp-steep.el
diff options
context:
space:
mode:
Diffstat (limited to 'elpa/lsp-mode-20220505.630/lsp-steep.el')
-rw-r--r--elpa/lsp-mode-20220505.630/lsp-steep.el73
1 files changed, 73 insertions, 0 deletions
diff --git a/elpa/lsp-mode-20220505.630/lsp-steep.el b/elpa/lsp-mode-20220505.630/lsp-steep.el
new file mode 100644
index 0000000..4e0e22f
--- /dev/null
+++ b/elpa/lsp-mode-20220505.630/lsp-steep.el
@@ -0,0 +1,73 @@
+;;; lsp-steep.el --- lsp-mode for Steep -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2020 Masafumi Koba
+
+;; Author: Masafumi Koba <ybiquitous@gmail.com>
+;; Keywords: languages
+
+;; 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 client for Steep which is a Ruby type checker.
+
+;;; Code:
+
+(require 'lsp-mode)
+
+(defgroup lsp-steep nil
+ "LSP support for Steep, using the Steep language server."
+ :group 'lsp-mode
+ :link '(url-link "https://github.com/soutaro/steep"))
+
+(defcustom lsp-steep-log-level "warn"
+ "Log level of Steep."
+ :type '(choice
+ (const "fatal")
+ (const "error")
+ (const "warn")
+ (const "info")
+ (const "debug"))
+ :group 'lsp-steep)
+
+(defcustom lsp-steep-use-bundler nil
+ "Run Steep using Bunder."
+ :type 'boolean
+ :safe #'booleanp
+ :group 'lsp-steep)
+
+(defcustom lsp-steep-server-path nil
+ "Path of the Steep language server executable.
+If specified, `lsp-steep-use-bundler' is ignored."
+ :type 'file
+ :group 'lsp-steep
+ :package-version '(lsp-mode . "8.0.0"))
+
+(defun lsp-steep--build-command ()
+ "Build a command to start the Steep language server."
+ (append
+ (if (and lsp-steep-use-bundler (not lsp-steep-server-path)) '("bundle" "exec"))
+ (list (or lsp-steep-server-path "steep") "langserver" "--log-level" lsp-steep-log-level)))
+
+(lsp-register-client
+ (make-lsp-client
+ :new-connection (lsp-stdio-connection #'lsp-steep--build-command)
+ :major-modes '(ruby-mode enh-ruby-mode)
+ :priority -3
+ :server-id 'steep-ls))
+
+(lsp-consistency-check lsp-steep)
+
+(provide 'lsp-steep)
+;;; lsp-steep.el ends here