-
Notifications
You must be signed in to change notification settings - Fork 15k
[emacs][lsp][tblgen] add tblgen-lsp-server support for emacs lsp-mode #76337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b530c6d
add tblgen-lsp-server support for lsp-mode
b600402
Merge branch 'main' of github.com:mgcsysinfcat/llvm-project
de97d69
Merge branch 'llvm:main' into main
mgcsysinfcat b6a554c
Merge branch 'llvm:main' into main
mgcsysinfcat 373f45f
Merge branch 'main' into main
mgcsysinfcat bda8214
Update mlir/utils/emacs/tblgen-lsp.el
mgcsysinfcat 7735afb
Update mlir/utils/emacs/tblgen-lsp.el
mgcsysinfcat eb9a2b1
Update mlir/utils/emacs/tblgen-lsp.el
mgcsysinfcat cdb6c4c
Update mlir/utils/emacs/tblgen-lsp.el
mgcsysinfcat 676b06c
Update mlir/utils/emacs/tblgen-lsp.el
mgcsysinfcat 7940272
Rename tblgen-lsp.el to tblgen-lsp-client.el to follow mlir-lsp-clien…
mgcsysinfcat edc188c
Update mlir/utils/emacs/tblgen-lsp-client.el
mgcsysinfcat e2f3395
Update mlir/utils/emacs/tblgen-lsp-client.el
mgcsysinfcat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| ;;; tblgen-lsp.el --- Description -*- lexical-binding: t; -*- | ||
| ;; | ||
| ;; Package-Requires: ((emacs "24.3")) | ||
| ;; | ||
| ;; This file is not part of GNU Emacs. | ||
| ;; | ||
| ;;; Commentary: | ||
| ;; LSP client to use with `tablegen-mode' that uses `tblgen-lsp-server' or any | ||
| ;; user made compatible server. | ||
| ;; | ||
| ;; | ||
| ;;; Code: | ||
| (require 'lsp-mode) | ||
|
|
||
| (defgroup lsp-tblgen nil | ||
| "LSP support for Tablegen." | ||
| :group 'lsp-mode | ||
| :link '(url-link "https://mlir.llvm.org/docs/Tools/MLIRLSP/")) | ||
|
|
||
| (defcustom lsp-tblgen-server-executable "tblgen-lsp-server" | ||
| "Command to start the mlir language server." | ||
| :group 'lsp-tblgen | ||
| :risky t | ||
| :type 'file) | ||
|
|
||
|
|
||
| (defcustom lsp-tblgen-server-args "" | ||
| "Args of LSP client for TableGen, for example '--tablegen-compilation-database=.../build/tablegen_compile_commands.yml'" | ||
| :group 'lsp-tblgen | ||
| :risky t | ||
| :type 'file) | ||
|
|
||
| (defun lsp-tblgen-setup () | ||
| "Setup the LSP client for TableGen." | ||
| (add-to-list 'lsp-language-id-configuration '(tablegen-mode . "tablegen")) | ||
|
|
||
| (lsp-register-client | ||
| (make-lsp-client | ||
| :new-connection (lsp-stdio-connection (lambda () (cons lsp-tblgen-server-executable (split-string-shell-command lsp-tblgen-server-args)))) | ||
| :activation-fn (lsp-activate-on "tablegen") | ||
| :priority -1 | ||
| :server-id 'tblgen-lsp))) | ||
|
|
||
| (provide 'tblgen-lsp) | ||
| ;;; tblgen-lsp.el ends here | ||
mgcsysinfcat marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.