From: Wilhelm Kirschbaum <wkirschbaum@gmail.com>
To: 64275@debbugs.gnu.org
Subject: bug#64275: 30.0.50; [PATCH] Improve sigil font-lock match for elixir-ts-mode
Date: Sat, 24 Jun 2023 22:14:17 +0200 [thread overview]
Message-ID: <87zg4od38w.fsf@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 164 bytes --]
This patch updates the sigil matching for Elixir. We don't need
to know
what the sigil is to be able to set the font. The one exception
is
regex via a sigil.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-eglot-imenu-when-the-server-does-not-support-it.patch --]
[-- Type: text/x-patch, Size: 2202 bytes --]
From 9a1389305d92f0e08d39d2ff5540cb494c012f12 Mon Sep 17 00:00:00 2001
From: Wilhelm H Kirschbaum <wkirschbaum@gmail.com>
Date: Sat, 24 Jun 2023 21:54:30 +0200
Subject: [PATCH 1/1] Fix eglot-imenu when the server does not support it
A language server might not support textDocument/documentSymbol, so we
need to check first.
* lisp/progmodes/eglot.el (eglot-imenu): Check for the
textDocument/documentSymbol capability before requesting.
---
lisp/progmodes/eglot.el | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index e2478f2dde3..265cfc88579 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3351,16 +3351,17 @@ eglot--imenu-DocumentSymbol
(defun eglot-imenu ()
"Eglot's `imenu-create-index-function'.
Returns a list as described in docstring of `imenu--index-alist'."
- (let* ((res (eglot--request (eglot--current-server-or-lose)
- :textDocument/documentSymbol
- `(:textDocument
- ,(eglot--TextDocumentIdentifier))
- :cancel-on-input non-essential))
- (head (and (cl-plusp (length res)) (elt res 0))))
- (when head
- (eglot--dcase head
- (((SymbolInformation)) (eglot--imenu-SymbolInformation res))
- (((DocumentSymbol)) (eglot--imenu-DocumentSymbol res))))))
+ (when (eglot--server-capable :textDocument/documentSymbol)
+ (let* ((res (eglot--request (eglot--current-server-or-lose)
+ :textDocument/documentSymbol
+ `(:textDocument
+ ,(eglot--TextDocumentIdentifier))
+ :cancel-on-input non-essential))
+ (head (and (cl-plusp (length res)) (elt res 0))))
+ (when head
+ (eglot--dcase head
+ (((SymbolInformation)) (eglot--imenu-SymbolInformation res))
+ (((DocumentSymbol)) (eglot--imenu-DocumentSymbol res)))))))
(cl-defun eglot--apply-text-edits (edits &optional version)
"Apply EDITS for current buffer if at VERSION, or if it's nil."
--
2.41.0
[-- Attachment #3: Type: text/plain, Size: 9 bytes --]
Wilhelm
next reply other threads:[~2023-06-24 20:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-24 20:14 Wilhelm Kirschbaum [this message]
2023-06-25 8:53 ` bug#64275: 30.0.50; [PATCH] Improve sigil font-lock match for elixir-ts-mode Basil Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-25 9:00 ` Wilhelm Kirschbaum
2023-07-29 18:31 ` Wilhelm Kirschbaum
2023-07-30 2:06 ` Dmitry Gutov
2023-07-30 7:53 ` Wilhelm Kirschbaum
2023-07-30 12:09 ` Dmitry Gutov
2023-07-31 7:22 ` Wilhelm Kirschbaum
2023-08-01 11:59 ` Dmitry Gutov
2023-08-02 6:38 ` Wilhelm Kirschbaum
2023-08-16 2:11 ` Dmitry Gutov
2023-10-07 8:46 ` Wilhelm Kirschbaum
2023-10-07 9:59 ` Wilhelm Kirschbaum
2023-10-07 10:10 ` Wilhelm Kirschbaum
2023-10-21 7:39 ` Wilhelm Kirschbaum
2023-10-26 0:27 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zg4od38w.fsf@gmail.com \
--to=wkirschbaum@gmail.com \
--cc=64275@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).