GNU bug report logs - #75580
30.0.93; statements inside string interpolation for csharp modes are fontified incorrectly

Previous Next

Package: emacs;

Reported by: Sami Batuhan Basmaz Ölmez <sb.basmazolmez <at> gmail.com>

Date: Wed, 15 Jan 2025 14:37:01 UTC

Severity: minor

Found in version 30.0.93

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75580 in the body.
You can then email your comments to 75580 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#75580; Package emacs. (Wed, 15 Jan 2025 14:37:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sami Batuhan Basmaz Ölmez <sb.basmazolmez <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 15 Jan 2025 14:37:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sami Batuhan Basmaz Ölmez <sb.basmazolmez <at> gmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 30.0.93;
  statements inside string interpolation for csharp modes
 are fontified incorrectly
Date: Wed, 15 Jan 2025 08:02:50 +0000
[Message part 1 (text/plain, inline)]
An interpolated string `$"string content {myFunction(myVariable)}
another string content"` are highlighted incorrectly as expressions
inside brackets are also fontified with string face for csharp-mode and
csharp-ts-mode. They should be fontified like statements.
Interpolation occurs inside curly braces.


In GNU Emacs 30.0.93 (build 1, x86_64-w64-mingw32) of 2024-12-23
Repository revision: 68bcabf58afddb377d172857ce7648ad3ff09618
Repository branch: worktree
Windowing system distributor 'Microsoft Corp.', version 10.0.19045
System Description: Microsoft Windows 10 Pro (v10.0.2009.19045.5371)

Configured using:
 'configure --prefix=C:/msys64/mingw64/ --without-compress-install
 --without-dbus --with-tree-sitter --with-rsvg --without-imagemagick
 --without-gsettings --with-mailutils --with-native-compilation
 --with-modules --with-wide-int 'CFLAGS=-O3 -ffast-math
 -frename-registers -funroll-loops -mtune=native -march=native
 -fomit-frame-pointer -fallow-store-data-races
 -fno-semantic-interposition -floop-parallelize-all
 -ftree-parallelize-loops=4 -fno-finite-math-only''

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1252

Major mode: C#

Minor modes in effect:
  windmove-mode: t
  tab-bar-echo-area-mode: t
  lsp-diagnostics-mode: t
  lsp-headerline-breadcrumb-mode: t
  lsp-modeline-workspace-status-mode: t
  lsp-modeline-diagnostics-mode: t
  lsp-lens-mode: t
  lsp-ui-mode: t
  lsp-ui-doc-mode: t
  lsp-ui-sideline-mode: t
  flycheck-mode: t
  treemacs-filewatch-mode: t
  treemacs-follow-mode: t
  treemacs-git-mode: t
  treemacs-fringe-indicator-mode: t
  lsp-completion-mode: t
  lsp-semantic-tokens-mode: t
  lsp-inlay-hints-mode: t
  lsp-managed-mode: t
  lsp-mode: t
  display-line-numbers-mode: t
  rainbow-delimiters-mode: t
  colorful-mode: t
  jinx-mode: t
  org-remark-global-tracking-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  vertico-multiform-mode: t
  vertico-mode: t
  global-treesit-auto-mode: t
  treesit-explore-mode: t
  projectile-mode: t
  meow-global-mode: t
  meow-mode: t
  meow-normal-mode: t
  meow-esc-mode: t
  dirvish-override-dired-mode: t
  corfu-popupinfo-mode: t
  corfu-history-mode: t
  global-corfu-mode: t
  corfu-mode: t
  which-key-mode: t
  marginalia-mode: t
  spacious-padding-mode: t
  parrot-mode: t
  nyan-mode: t
  nerd-icons-completion-mode: t
  global-hl-todo-mode: t
  hl-todo-mode: t
  doom-modeline-mode: t
  global-auto-revert-mode: t
  electric-pair-mode: t
  file-painter-global-mode: t
  repeat-mode: t
  savehist-mode: t
  recentf-mode: t
  save-place-mode: t
  global-beacon-fast-mode: t
  beacon-fast-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  minibuffer-regexp-mode: t
  size-indication-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Memory information:
((conses 16 1305305 2175637) (symbols 48 61953 15)
 (strings 32 401939 75182) (string-bytes 1 12092377)
 (vectors 16 96100) (vector-slots 8 1212741 1026826)
 (floats 8 820 15766) (intervals 56 23422 7039) (buffers 992 31))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75580; Package emacs. (Thu, 16 Jan 2025 15:43:01 GMT) Full text and rfc822 format available.

Message #8 received at 75580 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sami Batuhan Basmaz Ölmez <sb.basmazolmez <at> gmail.com>,
 Yuan Fu <casouri <at> gmail.com>
Cc: 75580 <at> debbugs.gnu.org
Subject: Re: bug#75580: 30.0.93;
 statements inside string interpolation for csharp modes
 are fontified incorrectly
Date: Thu, 16 Jan 2025 17:42:13 +0200
> From: Sami Batuhan Basmaz Ölmez <sb.basmazolmez <at> gmail.com>
> Date: Wed, 15 Jan 2025 08:02:50 +0000
> 
> An interpolated string `$"string content {myFunction(myVariable)}
> another string content"` are highlighted incorrectly as expressions
> inside brackets are also fontified with string face for csharp-mode and
> csharp-ts-mode. They should be fontified like statements.
> Interpolation occurs inside curly braces.

Thank, but could you please post a minimal C# source file that
exhibits this behavior?

Yuan, any comments about this?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75580; Package emacs. (Sat, 18 Jan 2025 07:58:01 GMT) Full text and rfc822 format available.

Message #11 received at 75580 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Jostein Kjønigsen <jostein <at> kjonigsen.net>,
 75580 <at> debbugs.gnu.org,
 Sami Batuhan Basmaz Ölmez <sb.basmazolmez <at> gmail.com>,
 Theodor Thornhill <theo <at> thornhill.no>
Subject: Re: bug#75580: 30.0.93; statements inside string interpolation for
 csharp modes are fontified incorrectly
Date: Fri, 17 Jan 2025 23:56:51 -0800

> On Jan 16, 2025, at 7:42 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Sami Batuhan Basmaz Ölmez <sb.basmazolmez <at> gmail.com>
>> Date: Wed, 15 Jan 2025 08:02:50 +0000
>> 
>> An interpolated string `$"string content {myFunction(myVariable)}
>> another string content"` are highlighted incorrectly as expressions
>> inside brackets are also fontified with string face for csharp-mode and
>> csharp-ts-mode. They should be fontified like statements.
>> Interpolation occurs inside curly braces.
> 
> Thank, but could you please post a minimal C# source file that
> exhibits this behavior?
> 
> Yuan, any comments about this?

The direct cause is that the font-lock rules for strings have :override flag, and string face is applied on the whole string, overriding whatever fontification the function invocation had. But the string rule has :override for a reason, the Theo and Jostein should know more.

Yuan



Severity set to 'minor' from 'normal' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 21 Jan 2025 02:28:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75580; Package emacs. (Sat, 01 Feb 2025 11:44:02 GMT) Full text and rfc822 format available.

Message #16 received at 75580 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: jostein <at> kjonigsen.net, 75580 <at> debbugs.gnu.org, sb.basmazolmez <at> gmail.com,
 theo <at> thornhill.no
Subject: Re: bug#75580: 30.0.93; statements inside string interpolation for
 csharp modes are fontified incorrectly
Date: Sat, 01 Feb 2025 13:42:54 +0200
Ping! Theo and Jostein, could you please comment?

> From: Yuan Fu <casouri <at> gmail.com>
> Date: Fri, 17 Jan 2025 23:56:51 -0800
> Cc: Sami Batuhan Basmaz Ölmez <sb.basmazolmez <at> gmail.com>,
>  75580 <at> debbugs.gnu.org,
>  Theodor Thornhill <theo <at> thornhill.no>,
>  Jostein Kjønigsen <jostein <at> kjonigsen.net>
> 
> 
> 
> > On Jan 16, 2025, at 7:42 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> > 
> >> From: Sami Batuhan Basmaz Ölmez <sb.basmazolmez <at> gmail.com>
> >> Date: Wed, 15 Jan 2025 08:02:50 +0000
> >> 
> >> An interpolated string `$"string content {myFunction(myVariable)}
> >> another string content"` are highlighted incorrectly as expressions
> >> inside brackets are also fontified with string face for csharp-mode and
> >> csharp-ts-mode. They should be fontified like statements.
> >> Interpolation occurs inside curly braces.
> > 
> > Thank, but could you please post a minimal C# source file that
> > exhibits this behavior?
> > 
> > Yuan, any comments about this?
> 
> The direct cause is that the font-lock rules for strings have :override flag, and string face is applied on the whole string, overriding whatever fontification the function invocation had. But the string rule has :override for a reason, the Theo and Jostein should know more.
> 
> Yuan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75580; Package emacs. (Sat, 01 Feb 2025 16:36:01 GMT) Full text and rfc822 format available.

Message #19 received at 75580 <at> debbugs.gnu.org (full text, mbox):

From: Jostein Kjønigsen <jostein <at> fastmail.fm>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: jostein <at> kjonigsen.net, Yuan Fu <casouri <at> gmail.com>,
 sb.basmazolmez <at> gmail.com, theo <at> thornhill.no, 75580 <at> debbugs.gnu.org
Subject: Re: bug#75580: 30.0.93;
 statements inside string interpolation for csharp modes are fontified
 incorrectly
Date: Sat, 1 Feb 2025 13:06:19 +0100
I don’t remember exactly why things ended up the way they did to be honest. 

I tried tweaking around with the rules to see if I could get better results, but ended up with different kinds of regressions. 

Fixing this will take a little effort, and recently my attention was at resolving and closing 2 simpler bugs, just to get them out of the way. 

With those 2 out of the way, I might have more time to invest in this one.  

--
Jostein Kjønigsen
https://jostein.kjønigsen.net

> On 1 Feb 2025, at 12:43, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> Ping! Theo and Jostein, could you please comment?
> 
>> From: Yuan Fu <casouri <at> gmail.com>
>> Date: Fri, 17 Jan 2025 23:56:51 -0800
>> Cc: Sami Batuhan Basmaz Ölmez <sb.basmazolmez <at> gmail.com>,
>> 75580 <at> debbugs.gnu.org,
>> Theodor Thornhill <theo <at> thornhill.no>,
>> Jostein Kjønigsen <jostein <at> kjonigsen.net>
>> 
>> 
>> 
>>>> On Jan 16, 2025, at 7:42 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>>> 
>>>> From: Sami Batuhan Basmaz Ölmez <sb.basmazolmez <at> gmail.com>
>>>> Date: Wed, 15 Jan 2025 08:02:50 +0000
>>>> 
>>>> An interpolated string `$"string content {myFunction(myVariable)}
>>>> another string content"` are highlighted incorrectly as expressions
>>>> inside brackets are also fontified with string face for csharp-mode and
>>>> csharp-ts-mode. They should be fontified like statements.
>>>> Interpolation occurs inside curly braces.
>>> 
>>> Thank, but could you please post a minimal C# source file that
>>> exhibits this behavior?
>>> 
>>> Yuan, any comments about this?
>> 
>> The direct cause is that the font-lock rules for strings have :override flag, and string face is applied on the whole string, overriding whatever fontification the function invocation had. But the string rule has :override for a reason, the Theo and Jostein should know more.
>> 
>> Yuan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75580; Package emacs. (Sat, 01 Feb 2025 21:22:02 GMT) Full text and rfc822 format available.

Message #22 received at 75580 <at> debbugs.gnu.org (full text, mbox):

From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: Jostein Kjønigsen <jostein <at> fastmail.fm>,
 Eli Zaretskii <eliz <at> gnu.org>
Cc: jostein <at> kjonigsen.net, Yuan Fu <casouri <at> gmail.com>,
 sb.basmazolmez <at> gmail.com, theo <at> thornhill.no, 75580 <at> debbugs.gnu.org
Subject: Re: bug#75580: 30.0.93; statements inside string interpolation for
 csharp modes are fontified incorrectly
Date: Sat, 1 Feb 2025 22:20:54 +0100
[Message part 1 (text/plain, inline)]
On 2/1/25 13:06, Jostein Kjønigsen wrote:
> I don’t remember exactly why things ended up the way they did to be honest.
>
> I tried tweaking around with the rules to see if I could get better results, but ended up with different kinds of regressions.

I had time for a little effort. :)

Attached is a pretty minimal patch which seems to work for me. I've 
guarded the changes behind a grammar-check, but I must admit I'm not 
sure if that is needed or not.

Basically I remove the override, and add more specific rules for the 
parts which goes "missing" without it.

Anyone have any opinions on the form of patch? Anyone want to do any 
additional testing?

Let me know! If not, I guess Eli you can install this at your own leisure.

--
Jostein
[0001-lisp-progmodes-csharp-mode.el-Improve-string-interpo.patch (text/x-patch, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 08 Feb 2025 10:57:02 GMT) Full text and rfc822 format available.

Notification sent to Sami Batuhan Basmaz Ölmez <sb.basmazolmez <at> gmail.com>:
bug acknowledged by developer. (Sat, 08 Feb 2025 10:57:02 GMT) Full text and rfc822 format available.

Message #27 received at 75580-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
Cc: theo <at> thornhill.no, casouri <at> gmail.com, jostein <at> fastmail.fm,
 sb.basmazolmez <at> gmail.com, 75580-done <at> debbugs.gnu.org
Subject: Re: bug#75580: 30.0.93; statements inside string interpolation for
 csharp modes are fontified incorrectly
Date: Sat, 08 Feb 2025 12:55:33 +0200
> Date: Sat, 1 Feb 2025 22:20:54 +0100
> Cc: Yuan Fu <casouri <at> gmail.com>, sb.basmazolmez <at> gmail.com,
>  75580 <at> debbugs.gnu.org, theo <at> thornhill.no, jostein <at> kjonigsen.net
> From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
> 
> On 2/1/25 13:06, Jostein Kjønigsen wrote:
> > I don’t remember exactly why things ended up the way they did to be honest.
> >
> > I tried tweaking around with the rules to see if I could get better results, but ended up with different kinds of regressions.
> 
> I had time for a little effort. :)
> 
> Attached is a pretty minimal patch which seems to work for me. I've 
> guarded the changes behind a grammar-check, but I must admit I'm not 
> sure if that is needed or not.
> 
> Basically I remove the override, and add more specific rules for the 
> parts which goes "missing" without it.
> 
> Anyone have any opinions on the form of patch? Anyone want to do any 
> additional testing?
> 
> Let me know! If not, I guess Eli you can install this at your own leisure.

Thanks, installed on the master branch, and closing the bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75580; Package emacs. (Sat, 08 Feb 2025 16:40:03 GMT) Full text and rfc822 format available.

Message #30 received at 75580 <at> debbugs.gnu.org (full text, mbox):

From: Jostein Kjønigsen <jostein <at> fastmail.fm>
To: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
Cc: Yuan Fu <casouri <at> gmail.com>, theo <at> thornhill.no, 75580 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>, sb.basmazolmez <at> gmail.com, jostein <at> kjonigsen.net
Subject: Re: bug#75580: 30.0.93;
 statements inside string interpolation for csharp modes are fontified
 incorrectly
Date: Sat, 8 Feb 2025 11:22:52 +0100
I guess there were no objections?

Eli, can you install this patch?

--
Jostein Kjønigsen
https://jostein.kjønigsen.net

> On 1 Feb 2025, at 22:20, Jostein Kjønigsen <jostein <at> secure.kjonigsen.net> wrote:
> 
> On 2/1/25 13:06, Jostein Kjønigsen wrote:
>> I don’t remember exactly why things ended up the way they did to be honest.
>> 
>> I tried tweaking around with the rules to see if I could get better results, but ended up with different kinds of regressions.
> 
> I had time for a little effort. :)
> 
> Attached is a pretty minimal patch which seems to work for me. I've guarded the changes behind a grammar-check, but I must admit I'm not sure if that is needed or not.
> 
> Basically I remove the override, and add more specific rules for the parts which goes "missing" without it.
> 
> Anyone have any opinions on the form of patch? Anyone want to do any additional testing?
> 
> Let me know! If not, I guess Eli you can install this at your own leisure.
> 
> --
> Jostein
> <0001-lisp-progmodes-csharp-mode.el-Improve-string-interpo.patch>





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75580; Package emacs. (Wed, 12 Feb 2025 04:44:01 GMT) Full text and rfc822 format available.

Message #33 received at 75580-done <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Sami Batuhan Basmaz Ölmez <sb.basmazolmez <at> gmail.com>,
 75580-done <at> debbugs.gnu.org,
 Jostein Kjønigsen <jostein <at> fastmail.fm>,
 Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>,
 theo <at> thornhill.no
Subject: Re: bug#75580: 30.0.93; statements inside string interpolation for
 csharp modes are fontified incorrectly
Date: Tue, 11 Feb 2025 20:43:22 -0800

> On Feb 8, 2025, at 2:55 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> Date: Sat, 1 Feb 2025 22:20:54 +0100
>> Cc: Yuan Fu <casouri <at> gmail.com>, sb.basmazolmez <at> gmail.com,
>> 75580 <at> debbugs.gnu.org, theo <at> thornhill.no, jostein <at> kjonigsen.net
>> From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
>> 
>> On 2/1/25 13:06, Jostein Kjønigsen wrote:
>>> I don’t remember exactly why things ended up the way they did to be honest.
>>> 
>>> I tried tweaking around with the rules to see if I could get better results, but ended up with different kinds of regressions.
>> 
>> I had time for a little effort. :)
>> 
>> Attached is a pretty minimal patch which seems to work for me. I've 
>> guarded the changes behind a grammar-check, but I must admit I'm not 
>> sure if that is needed or not.
>> 
>> Basically I remove the override, and add more specific rules for the 
>> parts which goes "missing" without it.
>> 
>> Anyone have any opinions on the form of patch? Anyone want to do any 
>> additional testing?
>> 
>> Let me know! If not, I guess Eli you can install this at your own leisure.
> 
> Thanks, installed on the master branch, and closing the bug.

Thanks to you both :)






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 12 Mar 2025 11:24:27 GMT) Full text and rfc822 format available.

This bug report was last modified 159 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.