54 lines · plain
1;;; mlir-lsp-clinet.el --- LSP clinet for the MLIR.2 3;; Copyright (C) 2022 The MLIR Authors.4;;5;; Licensed under the Apache License, Version 2.0 (the "License");6;; you may not use this file except in compliance with the License.7;; You may obtain a copy of the License at8;;9;; http://www.apache.org/licenses/LICENSE-2.010;;11;; Unless required by applicable law or agreed to in writing, software12;; distributed under the License is distributed on an "AS IS" BASIS,13;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14;; See the License for the specific language governing permissions and15;; limitations under the License.16 17;; Version: 0.1.018 19;;; Commentary:20 21;; LSP clinet to use with `mlir-mode' that uses `mlir-lsp-server' or any22;; user made compatible server.23 24;;; Code:25(require 'lsp-mode)26 27(defgroup lsp-mlir nil28 "LSP support for MLIR."29 :group 'lsp-mode30 :link '(url-link "https://mlir.llvm.org/docs/Tools/MLIRLSP/"))31 32 33(defcustom lsp-mlir-server-executable "mlir-lsp-server"34 "Command to start the mlir language server."35 :group 'lsp-mlir36 :risky t37 :type 'file)38 39 40(defun lsp-mlir-setup ()41 "Setup the LSP client for MLIR."42 (add-to-list 'lsp-language-id-configuration '(mlir-mode . "mlir"))43 44 (lsp-register-client45 (make-lsp-client46 :new-connection (lsp-stdio-connection (lambda () lsp-mlir-server-executable))47 :activation-fn (lsp-activate-on "mlir")48 :priority -149 :server-id 'mlir-lsp)))50 51 52(provide 'mlir-lsp-client)53;;; mlir-lsp-client.el ends here54