unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#70299: 30.0.50; go-ts-mode + tree-sitter-go@v0.20.0 no highlighting
@ 2024-04-08 23:43 Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-04-09  5:23 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-04-08 23:43 UTC (permalink / raw)
  To: 70299

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

--text follows this line--

- emacs -Q;
- M-x treesit-install-language-grammar
  - go
  - github.com/tree-sitter/tree-sitter-go

- Open up a new buffer and use go-ts-mode
- Write some go-code
```
package my_pkg
type myStruct struct {}
func MyFunc(x context.Context) error {}
```
- Observe that there is no syntax highlighting
- Observe that treesit-explore-mode seems to work properly
- Conclude that there is something wrong with go-ts-mode's
  highlighting. There is highlighting with tree-sitter-go v0.19.1, but
  that grammar also seems to come with some bugs.


In GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin23.4.0, NS
 appkit-2487.50 Version 14.4.1 (Build 23E224)) of 2024-04-08 built on
 MF9VWRYQFN
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.4.1

Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp
 --infodir=/opt/homebrew/Cellar/emacs-plus@30/30.0.50/share/info/emacs
 --prefix=/opt/homebrew/Cellar/emacs-plus@30/30.0.50 --with-xml2
 --with-gnutls --without-compress-install --without-dbus
 --without-imagemagick --with-modules --with-rsvg --with-webp --with-ns
 --disable-ns-self-contained 'CFLAGS=-Os -w -pipe
 -mmacosx-version-min=14
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk
 -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT'
 'CPPFLAGS=-I/opt/homebrew/opt/icu4c/include
 -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/readline/include
 -isystem/opt/homebrew/include -F/opt/homebrew/Frameworks
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk'
 'LDFLAGS=-L/opt/homebrew/opt/icu4c/lib -L/opt/homebrew/opt/sqlite/lib
 -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/lib
 -F/opt/homebrew/Frameworks -Wl,-headerpad_max_install_names
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk''

Configured features:
ACL GIF GLIB GMP GNUTLS JPEG LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS
PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
WEBP XIM ZLIB

Important settings:
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Go

Minor modes in effect:
  treesit-explore-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils python
rx project byte-opt gv bytecomp byte-compile compat pcase comint
ansi-osc ring ansi-color cl-seq go-ts-mode treesit vc-git diff-mode
easy-mmode vc-dispatcher cl-loaddefs cl-lib rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads kqueue cocoa ns lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 104850 12135) (symbols 48 7868 0) (strings 32 21254 2120)
 (string-bytes 1 586116) (vectors 16 14537)
 (vector-slots 8 156722 9447) (floats 8 27 34) (intervals 56 5547 0)
 (buffers 992 13))

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#70299: 30.0.50; go-ts-mode + tree-sitter-go@v0.20.0 no highlighting
  2024-04-08 23:43 bug#70299: 30.0.50; go-ts-mode + tree-sitter-go@v0.20.0 no highlighting Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-04-09  5:23 ` Eli Zaretskii
  2024-04-09  5:47   ` Yuan Fu
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-04-09  5:23 UTC (permalink / raw)
  To: Martin; +Cc: 70299

> Date: Tue, 9 Apr 2024 00:43:57 +0100
> From:  Martin via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> - emacs -Q;
> - M-x treesit-install-language-grammar
>   - go
>   - github.com/tree-sitter/tree-sitter-go
> 
> - Open up a new buffer and use go-ts-mode
> - Write some go-code 
> ```
> package my_pkg
> type myStruct struct {}
> func MyFunc(x context.Context) error {}
> ```
> - Observe that there is no syntax highlighting
> - Observe that treesit-explore-mode seems to work properly
> - Conclude that there is something wrong with go-ts-mode's
>   highlighting. There is highlighting with tree-sitter-go v0.19.1, but
>   that grammar also seems to come with some bugs.

Isn't this a duplicate of bug#70296?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#70299: 30.0.50; go-ts-mode + tree-sitter-go@v0.20.0 no highlighting
  2024-04-09  5:23 ` Eli Zaretskii
@ 2024-04-09  5:47   ` Yuan Fu
  2024-04-09 11:55     ` Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 7+ messages in thread
From: Yuan Fu @ 2024-04-09  5:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Martin, 70299



> On Apr 8, 2024, at 10:23 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> Date: Tue, 9 Apr 2024 00:43:57 +0100
>> From:  Martin via "Bug reports for GNU Emacs,
>> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>> 
>> - emacs -Q;
>> - M-x treesit-install-language-grammar
>>  - go
>>  - github.com/tree-sitter/tree-sitter-go
>> 
>> - Open up a new buffer and use go-ts-mode
>> - Write some go-code 
>> ```
>> package my_pkg
>> type myStruct struct {}
>> func MyFunc(x context.Context) error {}
>> ```
>> - Observe that there is no syntax highlighting
>> - Observe that treesit-explore-mode seems to work properly
>> - Conclude that there is something wrong with go-ts-mode's
>>  highlighting. There is highlighting with tree-sitter-go v0.19.1, but
>>  that grammar also seems to come with some bugs.
> 
> Isn't this a duplicate of bug#70296?

Yeah, Martin contacted me on Reddit because he didn’t know how to report this issue, and I told him he can use M-x bug-report-emacs, which he did. Thanks Martin!

Meanwhile I wrote a patch and sent it in bug#70296. Let me merge these two reports.

Yuan




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#70299: 30.0.50; go-ts-mode + tree-sitter-go@v0.20.0 no highlighting
  2024-04-09  5:47   ` Yuan Fu
@ 2024-04-09 11:55     ` Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-04-09 13:08       ` Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 7+ messages in thread
From: Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-04-09 11:55 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Eli Zaretskii, 70299

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

I tried manually applying that patch to my local emacs - it didn't seem to
fix the issue of no syntax highlighting?

On Tue, Apr 9, 2024 at 6:47 AM Yuan Fu <casouri@gmail.com> wrote:

>
>
> > On Apr 8, 2024, at 10:23 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> >
> >> Date: Tue, 9 Apr 2024 00:43:57 +0100
> >> From:  Martin via "Bug reports for GNU Emacs,
> >> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> >>
> >> - emacs -Q;
> >> - M-x treesit-install-language-grammar
> >>  - go
> >>  - github.com/tree-sitter/tree-sitter-go
> >>
> >> - Open up a new buffer and use go-ts-mode
> >> - Write some go-code
> >> ```
> >> package my_pkg
> >> type myStruct struct {}
> >> func MyFunc(x context.Context) error {}
> >> ```
> >> - Observe that there is no syntax highlighting
> >> - Observe that treesit-explore-mode seems to work properly
> >> - Conclude that there is something wrong with go-ts-mode's
> >>  highlighting. There is highlighting with tree-sitter-go v0.19.1, but
> >>  that grammar also seems to come with some bugs.
> >
> > Isn't this a duplicate of bug#70296?
>
> Yeah, Martin contacted me on Reddit because he didn’t know how to report
> this issue, and I told him he can use M-x bug-report-emacs, which he did.
> Thanks Martin!
>
> Meanwhile I wrote a patch and sent it in bug#70296. Let me merge these two
> reports.
>
> Yuan

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#70299: 30.0.50; go-ts-mode + tree-sitter-go@v0.20.0 no highlighting
  2024-04-09 11:55     ` Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-04-09 13:08       ` Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-04-09 23:22         ` Randy Taylor
  0 siblings, 1 reply; 7+ messages in thread
From: Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-04-09 13:08 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Eli Zaretskii, 70299

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

I can see this in *Messages*

Error during redisplay: (jit-lock-function 6092) signaled
(treesit-query-error "Node type error at" 150 "(function_declaration name:
(identifier) @font-lock-function-name-face) (method_declaration name:
(field_identifier) @font-lock-function-name-face) (method_spec name:
(field_identifier) @font-lock-function-name-face) (field_declaration name:
(field_identifier) @font-lock-property-name-face) (parameter_declaration
name: (identifier) @font-lock-variable-name-face) (short_var_declaration
left: (expression_list (identifier) @font-lock-variable-name-face (\",\"
(identifier) @font-lock-variable-name-face) *)) (var_spec name:
(identifier) @font-lock-variable-name-face (\",\" name: (identifier)
@font-lock-variable-name-face) *)" "Debug the query with
`treesit-query-validate'")


On Tue, Apr 9, 2024 at 12:55 PM Martin <martin.tang365@googlemail.com>
wrote:

> I tried manually applying that patch to my local emacs - it didn't seem to
> fix the issue of no syntax highlighting?
>
> On Tue, Apr 9, 2024 at 6:47 AM Yuan Fu <casouri@gmail.com> wrote:
>
>>
>>
>> > On Apr 8, 2024, at 10:23 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> >
>> >> Date: Tue, 9 Apr 2024 00:43:57 +0100
>> >> From:  Martin via "Bug reports for GNU Emacs,
>> >> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>> >>
>> >> - emacs -Q;
>> >> - M-x treesit-install-language-grammar
>> >>  - go
>> >>  - github.com/tree-sitter/tree-sitter-go
>> >>
>> >> - Open up a new buffer and use go-ts-mode
>> >> - Write some go-code
>> >> ```
>> >> package my_pkg
>> >> type myStruct struct {}
>> >> func MyFunc(x context.Context) error {}
>> >> ```
>> >> - Observe that there is no syntax highlighting
>> >> - Observe that treesit-explore-mode seems to work properly
>> >> - Conclude that there is something wrong with go-ts-mode's
>> >>  highlighting. There is highlighting with tree-sitter-go v0.19.1, but
>> >>  that grammar also seems to come with some bugs.
>> >
>> > Isn't this a duplicate of bug#70296?
>>
>> Yeah, Martin contacted me on Reddit because he didn’t know how to report
>> this issue, and I told him he can use M-x bug-report-emacs, which he did.
>> Thanks Martin!
>>
>> Meanwhile I wrote a patch and sent it in bug#70296. Let me merge these
>> two reports.
>>
>> Yuan
>
>

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#70299: 30.0.50; go-ts-mode + tree-sitter-go@v0.20.0 no highlighting
  2024-04-09 13:08       ` Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-04-09 23:22         ` Randy Taylor
  2024-04-10  8:38           ` Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 7+ messages in thread
From: Randy Taylor @ 2024-04-09 23:22 UTC (permalink / raw)
  To: Martin; +Cc: Yuan Fu, 70299, Eli Zaretskii

On Tuesday, April 9th, 2024 at 09:08, Martin via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> wrote:
> I can see this in *Messages*
> 
> > Error during redisplay: (jit-lock-function 6092) signaled (treesit-query-error "Node type error at" 150 "(function_declaration name: (identifier) @font-lock-function-name-face) (method_declaration name: (field_identifier) @font-lock-function-name-face) (method_spec name: (field_identifier) @font-lock-function-name-face) (field_declaration name: (field_identifier) @font-lock-property-name-face) (parameter_declaration name: (identifier) @font-lock-variable-name-face) (short_var_declaration left: (expression_list (identifier) @font-lock-variable-name-face (\",\" (identifier) @font-lock-variable-name-face) *)) (var_spec name: (identifier) @font-lock-variable-name-face (\",\" name: (identifier) @font-lock-variable-name-face) *)" "Debug the query with `treesit-query-validate'")
> 
> 
> On Tue, Apr 9, 2024 at 12:55 PM Martin <martin.tang365@googlemail.com> wrote:
> 
> > I tried manually applying that patch to my local emacs - it didn't seem to fix the issue of no syntax highlighting?
>>

The patch fixes it for me.

How did you apply the patch?

Perhaps the stale bytecompiled go-ts-mode.elc is used instead - can you try either regenerating it or setting load-prefer-newer to t and trying again?






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#70299: 30.0.50; go-ts-mode + tree-sitter-go@v0.20.0 no highlighting
  2024-04-09 23:22         ` Randy Taylor
@ 2024-04-10  8:38           ` Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 7+ messages in thread
From: Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-04-10  8:38 UTC (permalink / raw)
  To: dev; +Cc: Yuan Fu, 70299, Eli Zaretskii

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

🤦

heh. yeah that was it. deleted the .elc and now it works. Weirdly, setting
load-prefer-newer to t did not fix the issue.. I probably did something
wrong there too.

Anyway, all good. Thanks!

On Wed, Apr 10, 2024 at 12:22 AM Randy Taylor <dev@rjt.dev> wrote:

> On Tuesday, April 9th, 2024 at 09:08, Martin via "Bug reports for GNU
> Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> wrote:
> > I can see this in *Messages*
> >
> > > Error during redisplay: (jit-lock-function 6092) signaled
> (treesit-query-error "Node type error at" 150 "(function_declaration name:
> (identifier) @font-lock-function-name-face) (method_declaration name:
> (field_identifier) @font-lock-function-name-face) (method_spec name:
> (field_identifier) @font-lock-function-name-face) (field_declaration name:
> (field_identifier) @font-lock-property-name-face) (parameter_declaration
> name: (identifier) @font-lock-variable-name-face) (short_var_declaration
> left: (expression_list (identifier) @font-lock-variable-name-face (\",\"
> (identifier) @font-lock-variable-name-face) *)) (var_spec name:
> (identifier) @font-lock-variable-name-face (\",\" name: (identifier)
> @font-lock-variable-name-face) *)" "Debug the query with
> `treesit-query-validate'")
> >
> >
> > On Tue, Apr 9, 2024 at 12:55 PM Martin <martin.tang365@googlemail.com>
> wrote:
> >
> > > I tried manually applying that patch to my local emacs - it didn't
> seem to fix the issue of no syntax highlighting?
> >>
>
> The patch fixes it for me.
>
> How did you apply the patch?
>
> Perhaps the stale bytecompiled go-ts-mode.elc is used instead - can you
> try either regenerating it or setting load-prefer-newer to t and trying
> again?
>
>

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-10  8:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-08 23:43 bug#70299: 30.0.50; go-ts-mode + tree-sitter-go@v0.20.0 no highlighting Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-09  5:23 ` Eli Zaretskii
2024-04-09  5:47   ` Yuan Fu
2024-04-09 11:55     ` Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-09 13:08       ` Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-09 23:22         ` Randy Taylor
2024-04-10  8:38           ` Martin via Bug reports for GNU Emacs, the Swiss army knife of text editors

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).