- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 190
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
improve emacs support #353
Merged
+563
−77
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5b3e588
plugin/emacs: use --stdin in flycheck
wgrr 05aff9d
plugin/emacs: support Flycheck error explainer
wgrr 54bc9eb
plugin/emacs: add Eglot support
wgrr 88874b3
plugin/emacs: add LSP Mode support
wgrr fc0b98b
plugin/emacs: add Flymake backend support
wgrr 15020fd
plugin/emacs: skip test when Emacs version is lower than 26
wgrr d7e006a
plugin/emacs: add installation steps in README for new integrations
wgrr 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
plugin/emacs: add Eglot support
This commit also ignores client notifications that would make quicklintjs to crash and accept "js" as a language_id for files, that's what Eglot uses for JavaScript. Signed-off-by: wagner riffel <[email protected]>
commit 54bc9ebd31fac7170fca963230ab30e427c610a3
There are no files selected for viewing
This file contains 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
This file contains 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,62 @@ | ||
;;; eglot-quicklintjs.el --- Eglot support for quick-lint-js -*- lexical-binding: t; -*- | ||
|
||
;;; Commentary: | ||
|
||
;; Eglot support for quick-lint-js. | ||
|
||
;; Example usage in your init.el: | ||
;; | ||
;; (require 'eglot-quicklintjs) | ||
;; | ||
;; (defun my-eglot-quicklintjs-setup () | ||
;; "Configure eglot-quicklintjs for better experience." | ||
;; | ||
;; ;; Remove the time to wait after last change before automatically checking | ||
;; ;; buffer. The default is 0.5 (500ms) | ||
;; (setq-local eglot-send-changes-idle-time 0)) | ||
;; (add-hook 'js-mode-hook #'my-eglot-quicklintjs-setup) | ||
|
||
;;; Code: | ||
|
||
(require 'eglot) | ||
|
||
(defgroup eglot-quicklintjs nil | ||
"quick-lint-js Eglot integration." | ||
:group 'eglot-quicklintjs | ||
:link '(url-link :tag "Website" "https://quick-lint-js.com")) | ||
|
||
(defcustom eglot-quicklintjs-program "quick-lint-js" | ||
"Path to quick-lint-js program to run." | ||
:group 'eglot-quicklintjs | ||
:type 'stringp) | ||
|
||
(defcustom eglot-quicklintjs-args nil | ||
"Arguments to quick-lint-js." | ||
:group 'eglot-quicklintjs | ||
:type '(repeat string)) | ||
|
||
(add-to-list 'eglot-server-programs `(js-mode . (,eglot-quicklintjs-program | ||
"--lsp-server" | ||
,@eglot-quicklintjs-args))) | ||
|
||
(provide 'eglot-quicklintjs) | ||
|
||
;; quick-lint-js finds bugs in JavaScript programs. | ||
;; Copyright (C) 2020 Matthew Glazar | ||
;; | ||
;; This file is part of quick-lint-js. | ||
;; | ||
;; quick-lint-js 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. | ||
;; | ||
;; quick-lint-js 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 quick-lint-js. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
;;; eglot-quicklintjs.el ends here |
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Indentation looks off to me. Shouldn't there be two more spaces before this line to align it with line 15?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been indenting with a script that runs emacs commad "indent-region" in the file, it does indent as you're looking, and lisp code inside emacs /lisp directory is also indented like this:
so i think it's correct according to Emacs standards