unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "牟 桐" <mou.tong@outlook.com>
To: Dmitry Gutov <dgutov@yandex.ru>,
	"62399@debbugs.gnu.org" <62399@debbugs.gnu.org>,
	Theodor Thornhill <theo@thornhill.no>
Subject: bug#62399: 30.0.50; eglot + csharp-ts-mode, query pattern is malformed
Date: Thu, 23 Mar 2023 16:19:59 +0000	[thread overview]
Message-ID: <SJ0P220MB067537C8EE5DC3104FB5B51697879@SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <11ee8256-a2e0-a64c-dc33-b9dab57ad552@yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 2046 bytes --]

Thanks, I tried your patch and now it works fine on my computer now.

Hope to see it got merged soon 😉

发件人: Dmitry Gutov<mailto:dgutov@yandex.ru>
发送时间: 2023年3月23日 15:57
收件人: 牟 桐<mailto:mou.tong@outlook.com>; 62399@debbugs.gnu.org<mailto:62399@debbugs.gnu.org>; Theodor Thornhill<mailto:theo@thornhill.no>
主题: Re: bug#62399: 回复: bug#62399: 30.0.50; eglot + csharp-ts-mode, query pattern is malformed

On 23/03/2023 08:25, 牟 桐 wrote:
> Ah sorry, here it is:
>
> ``` csharp-ts-mode
> Console.WriteLine("Hello, World!");
> ```
>
> (yes, just one line...)

Thanks! I guess the problem will show up with any file.

And I can repro after installing the c-sharp grammar from master.

> The lsp I’m using is `csharp-ls`, I guess it won’t affect this issue.
>
> But just in case, the way to install `csharp-ls` is
>
>     dotnet tool install csharp-ls -g

A language server was not necessary to reproduce this, but thanks.

This is the patch that worked for me:

diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
index 47cd13e7fdb..e2df08f4dae 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -832,7 +832,7 @@ csharp-ts-mode--font-lock-settings

       (constructor_declaration name: (_) @font-lock-type-face)

-     (method_declaration type: [(identifier) (void_keyword)]
@font-lock-type-face)
+     (method_declaration type: [(identifier) (predefined_type)]
@font-lock-type-face)
       (method_declaration type: (generic_name (identifier)
@font-lock-type-face))
       (method_declaration name: (_) @font-lock-function-name-face)


Looks like a change was made to the grammar fairly recently which made
(void_keyword) not valid in the above context:
https://github.com/tree-sitter/tree-sitter-c-sharp/commit/18a531d4c133d9f1b3796b9bead7681ba3382fb3

Cc'ing the author of that mode for a second opinion. But I guess we'll
need a runtime check just like we added for java-ts-mode recently.


[-- Attachment #2: Type: text/html, Size: 5469 bytes --]

  reply	other threads:[~2023-03-23 16:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23  5:59 bug#62399: 30.0.50; eglot + csharp-ts-mode, query pattern is malformed 牟 桐
2023-03-23  6:09 ` Dmitry Gutov
2023-03-23  6:25   ` bug#62399: 回复: " 牟 桐
2023-03-23  7:57     ` Dmitry Gutov
2023-03-23 16:19       ` 牟 桐 [this message]
2023-09-04 19:56       ` Stefan Kangas

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=SJ0P220MB067537C8EE5DC3104FB5B51697879@SJ0P220MB0675.NAMP220.PROD.OUTLOOK.COM \
    --to=mou.tong@outlook.com \
    --cc=62399@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=theo@thornhill.no \
    /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).