GNU bug report logs - #63086
29.0.90; go-ts-mode treesit-query-error during jit-lock

Previous Next

Package: emacs;

Reported by: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>

Date: Wed, 26 Apr 2023 10:01:02 UTC

Severity: normal

Found in version 29.0.90

Done: Dmitry Gutov <dmitry <at> gutov.dev>

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 63086 in the body.
You can then email your comments to 63086 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#63086; Package emacs. (Wed, 26 Apr 2023 10:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 26 Apr 2023 10:01:02 GMT) Full text and rfc822 format available.

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

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Wed, 26 Apr 2023 11:00:14 +0100
After visiting a go file and turning on M-x go-ts-mode, this following
message appears in the *Messages* buffer and the go buffer is not
highlighted as a result.

QuitError during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 11 "[(false) (iota) (nil) (true)] @font-lock-constant-face (const_declaration (const_spec name: (identifier) @font-lock-constant-face))" "Debug the query with `treesit-query-validate'")
Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 11 "[(false) (iota) (nil) (true)] @font-lock-constant-face (const_declaration (const_spec name: (identifier) @font-lock-constant-face))" "Debug the query with `treesit-query-validate'")



In GNU Emacs 29.0.90 (build 1, aarch64-apple-darwin22.4.0, NS
 appkit-2299.50 Version 13.3.1 (Build 22E261)) of 2023-04-24 built on
 MobileCat.localdomain
Windowing system distributor 'Apple', version 10.3.2299
System Description:  macOS 13.3.1

Configured using:
 'configure --prefix=/opt/local --disable-silent-rules --without-dbus
 --without-gconf --without-libotf --without-m17n-flt --with-libgmp
 --with-gnutls --with-json --with-xml2 --with-modules --infodir
 /opt/local/share/info/emacs --with-sqlite3 --with-webp --with-ns
 --with-lcms2 --without-harfbuzz --without-imagemagick --without-xaw3d
 --with-tree-sitter --with-rsvg --with-xwidgets
 --with-native-compilation=aot 'CFLAGS=-pipe -Os -Wno-attributes
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch
 arm64' 'CPPFLAGS=-I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk'
 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath
 /opt/local/lib/gcc12 -Wl,-no_pie
 -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk
 -arch arm64''

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

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

Major mode: ELisp/l

Minor modes in effect:
  company-quickhelp-mode: t
  company-quickhelp-local-mode: t
  company-prescient-mode: t
  prescient-persist-mode: t
  rainbow-mode: t
  elisp-def-mode: t
  display-line-numbers-mode: t
  subword-mode: t
  page-break-lines-mode: t
  beginend-prog-mode: t
  imenu-list-minor-mode: t
  purpose-mode: t
  windmove-mode: t
  magit-todos-mode: t
  diff-hl-flydiff-mode: t
  projectile-rails-global-mode: t
  projectile-mode: t
  pdf-occur-global-minor-mode: t
  crm-custom-mode: t
  override-global-mode: t
  treemacs-filewatch-mode: t
  treemacs-follow-mode: t
  treemacs-git-mode: t
  treemacs-fringe-indicator-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  winner-mode: t
  which-key-mode: t
  which-function-mode: t
  smooth-scrolling-mode: t
  show-smartparens-global-mode: t
  show-smartparens-mode: t
  smartparens-global-mode: t
  smartparens-mode: t
  server-mode: t
  savehist-mode: t
  save-place-mode: t
  rxt-global-mode: t
  rxt-mode: t
  recentf-mode: t
  minibuffer-depth-indicate-mode: t
  ido-vertical-mode: t
  ido-ubiquitous-mode: t
  global-whitespace-cleanup-mode: t
  whitespace-cleanup-mode: t
  global-so-long-mode: t
  global-origami-mode: t
  origami-mode: t
  global-move-dup-mode: t
  move-dup-mode: t
  global-hl-line-mode: t
  global-flycheck-mode: t
  global-diff-hl-show-hunk-mouse-mode: t
  diff-hl-show-hunk-mouse-mode: t
  global-diff-hl-mode: t
  diff-hl-mode: t
  global-company-mode: t
  company-mode: t
  global-auto-revert-mode: t
  global-aggressive-indent-mode: t
  aggressive-indent-mode: t
  flx-ido-mode: t
  ido-everywhere: t
  icomplete-vertical-mode: t
  icomplete-mode: t
  fido-mode: t
  editorconfig-mode: t
  direnv-mode: t
  desktop-save-mode: t
  delete-selection-mode: t
  yas-minor-mode: t
  auto-compile-on-save-mode: t
  auto-compile-mode: t
  amx-mode: t
  abridge-diff-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  window-divider-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  visual-line-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t

Load-path shadows:
/opt/local/share/emacs/site-lisp/cmake-mode hides /Users/wyuenho/.emacs.d/elpa/cmake-mode-20230422.828/cmake-mode
/Users/wyuenho/.emacs.d/elpa/transient-20230315.1520/transient hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/transient
/Users/wyuenho/.emacs.d/elpa/use-package-20230203.2004/use-package-jump hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-jump
/Users/wyuenho/.emacs.d/elpa/use-package-20230203.2004/use-package-ensure hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-ensure
/Users/wyuenho/.emacs.d/elpa/use-package-20230203.2004/use-package-core hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-core
/Users/wyuenho/.emacs.d/elpa/use-package-20230203.2004/use-package-delight hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-delight
/Users/wyuenho/.emacs.d/elpa/use-package-20230203.2004/use-package-diminish hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-diminish
/Users/wyuenho/.emacs.d/elpa/use-package-20230203.2004/use-package hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package
/Users/wyuenho/.emacs.d/elpa/use-package-20230203.2004/use-package-bind-key hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-bind-key
/Users/wyuenho/.emacs.d/elpa/use-package-20230203.2004/use-package-lint hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-lint

Features:
(shadow sort mail-extr view lsp-zig lsp-tilt lsp-steep lsp-svelte
lsp-sqls lsp-ruby-syntax-tree lsp-ruby-lsp lsp-yaml lsp-xml
lsp-vimscript lsp-vhdl lsp-volar lsp-vetur lsp-html lsp-verilog lsp-vala
lsp-v lsp-typeprof lsp-ttcn3 lsp-toml lsp-terraform lsp-tex lsp-sorbet
lsp-solargraph lsp-rust lsp-rf lsp-ruff-lsp lsp-remark lsp-racket lsp-r
lsp-purescript lsp-pylsp lsp-pyls lsp-pwsh lsp-php lsp-pls
lsp-perlnavigator lsp-perl lsp-openscad lsp-ocaml lsp-magik lsp-nix
lsp-nim lsp-nginx lsp-mint lsp-marksman lsp-markdown lsp-lua lsp-kotlin
lsp-json lsp-javascript lsp-idris lsp-haxe lsp-groovy lsp-hack
lsp-graphql lsp-glsl lsp-gleam lsp-go lsp-completion lsp-gdscript
lsp-fsharp lsp-fortran lsp-eslint lsp-erlang lsp-emmet lsp-elixir
lsp-elm lsp-dockerfile lsp-dhall lsp-d lsp-css lsp-csharp lsp-crystal
lsp-cmake lsp-clojure lsp-semantic-tokens lsp-clangd lsp-beancount
lsp-bash lsp-astro lsp-ansible lsp-angular lsp-ada lsp-actionscript
dap-dlv-go dap-utils dom xml go-ts-mode emacsbug facemenu two-column
dired-aux vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs diff-hl-dired
all-the-icons-dired dired-collapse dired-hacks-utils flycheck-inline
flycheck-cask company-native-complete sh-script executable
company-quickhelp pos-tip company-prescient prescient char-fold
company-keywords company-etags etags fileloop company-gtags
company-dabbrev-code company-dabbrev company-yasnippet company-capf
company-files company-cmake company-clang company-semantic
company-template company-bbdb rainbow-mode elisp-def ert debug backtrace
display-line-numbers cap-words superword subword smartparens-config
smartparens-javascript smartparens-ruby smartparens-org
smartparens-python smartparens-markdown smartparens-text smartparens-c
page-break-lines beginend window-purpose-x shut-up imenu-list hideshow
window-purpose window-purpose-fixes window-purpose-prefix-overload
window-purpose-switch window-purpose-layout window-purpose-core
window-purpose-configuration window-purpose-utils windmove
dired-hide-dotfiles shrink-path git-timemachine vc-git magit-lfs
magit-todos hl-todo async forge-list forge-commands forge-semi
forge-bitbucket buck forge-gogs gogs forge-gitea gtea forge-gitlab glab
forge-github ghub-graphql treepy gsexp ghub url-http url-gw url-auth
gnutls forge-notify forge-revnote forge-pullreq forge-issue forge-topic
bug-reference forge-post forge-repo forge forge-core forge-db closql
emacsql-sqlite-common emacsql emacsql-compiler magit-bookmark
magit-submodule magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log diff-hl-flydiff ediff-merg
ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util
dumb-jump popup rg rg-info-hack rg-menu rg-ibuffer rg-result wgrep-rg
wgrep rg-history rg-header projectile-rails rake inflections inf-ruby
ruby-mode smie autoinsert lsp-sourcekit dap-java lsp-java request lsp
cargo cargo-process yard-mode lsp-pyright pet lsp-jedi python-pytest
projectile grep python-isort python-black python python-insert-docstring
jq-format prettier nvm iter2 generator reformatter flycheck-package
package-lint finder finder-inf eterm-256color term disp-table ehelp
xterm-color native-complete verb js c-ts-common treesit cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
url-queue url-file org ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-macro org-src ob-comint org-pcomplete org-list org-footnote
org-faces org-entities ob-emacs-lisp ob-core ob-eval org-cycle org-table
ol org-fold org-fold-core org-keys oc org-loaddefs cal-menu calendar
cal-loaddefs org-version org-compat org-macs quick-peek lsp-ui
lsp-ui-flycheck lsp-ui-doc xwidget goto-addr lsp-ui-imenu lsp-ui-peek
lsp-ui-sideline lsp-ui-util face-remap pdf-loader pdf-occur ibuf-ext
ibuffer ibuffer-loaddefs tablist tablist-filter semantic/wisent/comp
semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util
semantic semantic/tag semantic/lex semantic/fw mode-local cedet
pdf-isearch pdf-misc pdf-tools pdf-view treemacs-bookmarks treemacs-tags
bookmark jka-compr pdf-cache pdf-info tq pdf-util pdf-macs image-mode
exif iedit iedit-lib mc-hide-unmatched-lines-mode mc-mark-more
mc-cycle-cursors multiple-cursors-core rect crm-custom scroll-on-jump
pager-default-keybindings pager browse-kill-ring use-package-bind-key
bind-key use-package-delight exec-path-from-shell all-the-icons
all-the-icons-faces data-material data-weathericons data-octicons
data-fileicons data-faicons data-alltheicons spaceline-config
spaceline-segments spaceline powerline powerline-separators
powerline-themes solarized-dark-theme solarized-theme solarized
solarized-faces delight quelpa-use-package use-package-core quelpa
lisp-mnt help-fns radix-tree tramp-cache time-stamp tramp-sh tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat
parse-time iso8601 ls-lisp dap-mouse dap-ui lsp-treemacs
lsp-treemacs-generic lsp-treemacs-themes treemacs-treelib treemacs
treemacs-header-line treemacs-compatibility treemacs-mode
treemacs-interface treemacs-persistence treemacs-filewatch-mode
treemacs-follow-mode treemacs-rendering treemacs-annotations
treemacs-async treemacs-workspaces treemacs-dom treemacs-visuals
treemacs-fringe-indicator pulse treemacs-faces treemacs-icons
treemacs-scope treemacs-themes treemacs-core-utils pfuture
treemacs-logging treemacs-customization treemacs-macros gdb-mi bindat
gud bui bui-list bui-info bui-entry bui-core bui-history bui-button
bui-utils lsp-lens magit-diff smerge-mode diff git-commit log-edit
message sendmail yank-media dired dired-loaddefs rfc822 mml mml-sec epa
gnus-util time-date mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils
gmm-utils mailheader add-log magit-core magit-autorevert magit-margin
magit-transient magit-process with-editor shell pcomplete magit-mode
transient edmacro kmacro magit-git magit-base magit-section format-spec
crm compat winner which-key which-func smooth-scrolling smartparens
loadhist server savehist saveplace pcre2el rxt re-builder recentf
mb-depth ido-vertical-mode ido-completing-read+ memoize cus-edit pp
minibuf-eldef help-at-pt whitespace-cleanup-mode whitespace so-long
origami origami-parsers cl move-dup hl-line flycheck find-func
diff-hl-show-hunk diff-hl-inline-popup diff-hl log-view pcvs-util vc-dir
vc vc-dispatcher company autorevert aggressive-indent flx-ido advice flx
ido icomplete editorconfig editorconfig-core editorconfig-core-handle
editorconfig-fnmatch direnv diff-mode easy-mmode desktop frameset delsel
dap-mode dap-tasks dap-launch lsp-docker yaml posframe dap-overlays
lsp-mode lsp-protocol yasnippet-snippets yasnippet xref project
tree-widget wid-edit spinner network-stream puny nsm markdown-mode color
thingatpt noutline outline lv inline imenu ht f f-shortdoc ewoc epg
rfc6068 epg-config dash compile text-property-search comint ansi-osc
ansi-color ring auto-compile amx s abridge-diff let-alist filenotify
cus-load move-dup-autoloads yarn-mode-autoloads
git-timemachine-autoloads web-mode-autoloads
flycheck-golangci-lint-autoloads docker-compose-mode-autoloads
ibuffer-vc-autoloads lsp-java-autoloads dap-mode-autoloads
lsp-treemacs-autoloads monky-autoloads auto-yasnippet-autoloads
company-prescient-autoloads cycle-quotes-autoloads
python-docstring-autoloads flycheck-plantuml-autoloads direnv-autoloads
lsp-pyright-autoloads graphviz-dot-mode-autoloads
lsp-sourcekit-autoloads highlight-indent-guides-autoloads
ts-comint-autoloads impostman-autoloads spaceline-autoloads
bug-hunter-autoloads graphql-mode-autoloads fontify-face-autoloads
crm-custom-autoloads buffer-move-autoloads pet-autoloads
scroll-on-jump-autoloads flycheck-package-autoloads magit-lfs-autoloads
lsp-origami-autoloads origami-autoloads pdf-tools-autoloads
ido-completing-read+-autoloads verb-autoloads memoize-autoloads
terraform-mode-autoloads lsp-ui-autoloads reason-mode-autoloads
import-js-autoloads grizzl-autoloads company-quickhelp-autoloads
sbt-mode-autoloads vundo-autoloads lsp-jedi-autoloads
page-break-lines-autoloads smart-semicolon-autoloads
ssh-config-mode-autoloads sphinx-doc-autoloads solarized-theme-autoloads
browse-kill-ring-autoloads dired-hide-dotfiles-autoloads
svg-lib-autoloads jsonian-autoloads amx-autoloads
eterm-256color-autoloads xterm-color-autoloads ialign-autoloads
dotenv-mode-autoloads shrink-path-autoloads default-text-scale-autoloads
enh-ruby-mode-autoloads csv-mode-autoloads dired-single-autoloads
package-utils-autoloads restart-emacs-autoloads flycheck-cask-autoloads
tuareg-autoloads caml-autoloads all-the-icons-dired-autoloads
all-the-icons-autoloads jq-mode-autoloads smartparens-autoloads
flx-isearch-autoloads emmet-mode-autoloads cask-mode-autoloads
window-purpose-autoloads shut-up-autoloads imenu-list-autoloads
yard-mode-autoloads lsp-docker-autoloads treemacs-autoloads
cfrs-autoloads pfuture-autoloads ace-window-autoloads avy-autoloads
company-native-complete-autoloads native-complete-autoloads
company-autoloads dumb-jump-autoloads focus-autoloads
flycheck-projectile-autoloads rainbow-mode-autoloads po-mode-autoloads
delight-autoloads flx-ido-autoloads lorem-ipsum-autoloads
wgrep-ag-autoloads popup-autoloads buttercup-autoloads
yaml-mode-autoloads python-insert-docstring-autoloads cargo-autoloads
add-node-modules-path-autoloads request-autoloads pos-tip-autoloads
jq-format-autoloads expand-region-autoloads sass-mode-autoloads
haml-mode-autoloads powerline-autoloads posframe-autoloads
js-doc-autoloads forge-autoloads yaml-autoloads ghub-autoloads
closql-autoloads emacsql-autoloads nodejs-repl-autoloads
prescient-autoloads string-inflection-autoloads
visual-regexp-steroids-autoloads flycheck-inline-autoloads
flycheck-autoloads pkg-info-autoloads epl-autoloads lsp-mode-autoloads
protobuf-mode-autoloads whitespace-cleanup-mode-autoloads
projectile-rails-autoloads rake-autoloads inf-ruby-autoloads
inflections-autoloads git-modes-autoloads macrostep-autoloads
python-pytest-autoloads projectile-autoloads scala-mode-autoloads
quick-peek-autoloads tablist-autoloads groovy-mode-autoloads
imenu-anywhere-autoloads pager-default-keybindings-autoloads
pager-autoloads olivetti-autoloads treepy-autoloads bui-autoloads
repeat-help-autoloads apib-mode-autoloads markdown-mode-autoloads
quelpa-use-package-autoloads use-package-autoloads quelpa-autoloads
ido-vertical-mode-autoloads multiple-cursors-autoloads rg-autoloads
wgrep-autoloads beginend-autoloads smooth-scrolling-autoloads
vterm-autoloads which-key-autoloads aggressive-indent-autoloads
diff-hl-autoloads osx-trash-autoloads cmake-font-lock-autoloads
cmake-mode-autoloads ron-mode-autoloads abridge-diff-autoloads
hcl-mode-autoloads visual-regexp-autoloads udev-mode-autoloads
package-build-autoloads derived dired-collapse-autoloads
dired-hacks-utils-autoloads ag-autoloads arduino-mode-autoloads ede/auto
eieio-base crux-autoloads auto-compile-autoloads prettier-autoloads
editorconfig-autoloads nvm-autoloads iter2-autoloads elisp-def-autoloads
package-lint-autoloads coverage-autoloads ov-autoloads
shift-number-autoloads paradox-autoloads hydra-autoloads lv-autoloads
spinner-autoloads python-isort-autoloads magit-todos-autoloads
pcre2el-autoloads magit-autoloads magit-section-autoloads
git-commit-autoloads with-editor-autoloads transient-autoloads
hl-todo-autoloads compat-autoloads async-autoloads kurecolor-autoloads
flx-autoloads yasnippet-snippets-autoloads yasnippet-autoloads
python-black-autoloads reformatter-autoloads helpful-autoloads
elisp-refs-autoloads f-autoloads s-autoloads iedit-autoloads
exec-path-from-shell-autoloads plantuml-mode-autoloads
swift-mode-autoloads ht-autoloads info dash-autoloads package browse-url
url url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source eieio eieio-core password-cache json map byte-opt url-vars
comp comp-cstr warnings icons subr-x rx cl-seq cl-macs cl-extra
help-mode bytecomp byte-compile gv pcase bootstrap-theme 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 xwidget-internal kqueue cocoa
ns lcms2 multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 1333044 510649)
 (symbols 48 88292 63)
 (strings 32 284916 87828)
 (string-bytes 1 9093140)
 (vectors 16 174937)
 (vector-slots 8 4402069 715758)
 (floats 8 1250 2528)
 (intervals 56 2888 1407)
 (buffers 984 30))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63086; Package emacs. (Wed, 26 Apr 2023 10:37:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>, Randy Taylor <dev <at> rjt.dev>,
 Yuan Fu <casouri <at> gmail.com>
Cc: 63086 <at> debbugs.gnu.org
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Wed, 26 Apr 2023 13:36:16 +0300
> From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
> Date: Wed, 26 Apr 2023 11:00:14 +0100
> 
> 
> After visiting a go file and turning on M-x go-ts-mode, this following
> message appears in the *Messages* buffer and the go buffer is not
> highlighted as a result.
> 
> QuitError during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 11 "[(false) (iota) (nil) (true)] @font-lock-constant-face (const_declaration (const_spec name: (identifier) @font-lock-constant-face))" "Debug the query with `treesit-query-validate'")
> Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 11 "[(false) (iota) (nil) (true)] @font-lock-constant-face (const_declaration (const_spec name: (identifier) @font-lock-constant-face))" "Debug the query with `treesit-query-validate'")

Can you post a minimal file that triggers this?  Or are you saying
that any Go file will cause this?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63086; Package emacs. (Wed, 26 Apr 2023 11:09:01 GMT) Full text and rfc822 format available.

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

From: Jimmy Wong <wyuenho <at> gmail.com>
To: Randy Taylor <dev <at> rjt.dev>, Yuan Fu <casouri <at> gmail.com>, Eli
 Zaretskii <eliz <at> gnu.org>
Cc: 63086 <at> debbugs.gnu.org
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Wed, 26 Apr 2023 12:07:53 +0100
[Message part 1 (text/plain, inline)]
Any go file will trigger this
On 26 Apr 2023 at 11:35 AM +0100, Eli Zaretskii <eliz <at> gnu.org>, wrote:
> > From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
> > Date: Wed, 26 Apr 2023 11:00:14 +0100
> >
> >
> > After visiting a go file and turning on M-x go-ts-mode, this following
> > message appears in the *Messages* buffer and the go buffer is not
> > highlighted as a result.
> >
> > QuitError during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 11 "[(false) (iota) (nil) (true)] @font-lock-constant-face (const_declaration (const_spec name: (identifier) @font-lock-constant-face))" "Debug the query with `treesit-query-validate'")
> > Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 11 "[(false) (iota) (nil) (true)] @font-lock-constant-face (const_declaration (const_spec name: (identifier) @font-lock-constant-face))" "Debug the query with `treesit-query-validate'")
>
> Can you post a minimal file that triggers this? Or are you saying
> that any Go file will cause this?
>
> Thanks.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63086; Package emacs. (Wed, 26 Apr 2023 12:39:01 GMT) Full text and rfc822 format available.

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

From: Randy Taylor <dev <at> rjt.dev>
To: Jimmy Wong <wyuenho <at> gmail.com>
Cc: Yuan Fu <casouri <at> gmail.com>, 63086 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Wed, 26 Apr 2023 12:38:34 +0000
[Message part 1 (text/plain, inline)]
On Wednesday, April 26th, 2023 at 07:07, Jimmy Wong <wyuenho <at> gmail.com> wrote:

> Any go file will trigger this
> On 26 Apr 2023 at 11:35 AM +0100, Eli Zaretskii <eliz <at> gnu.org>, wrote:
>
>>> From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
>>> Date: Wed, 26 Apr 2023 11:00:14 +0100
>>>
>>> After visiting a go file and turning on M-x go-ts-mode, this following
>>> message appears in the *Messages* buffer and the go buffer is not
>>> highlighted as a result.
>>>
>>> QuitError during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 11 "[(false) (iota) (nil) (true)] @font-lock-constant-face (const_declaration (const_spec name: (identifier) @font-lock-constant-face))" "Debug the query with `treesit-query-validate'")
>>> Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 11 "[(false) (iota) (nil) (true)] @font-lock-constant-face (const_declaration (const_spec name: (identifier) @font-lock-constant-face))" "Debug the query with `treesit-query-validate'")
>>
>> Can you post a minimal file that triggers this? Or are you saying
>> that any Go file will cause this?
>>
>> Thanks.

I can't reproduce this with any .go files I have laying around. Can you share one that reproduces the issue?

Is the tree-sitter-go shared library file you're using the latest and most up to date one?

What is the version of tree-sitter? If it's not the latest, can you try the latest and see if that helps?

Also, and just to be on the safe side, are you able to reproduce this with emacs -Q?
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63086; Package emacs. (Wed, 26 Apr 2023 13:27:02 GMT) Full text and rfc822 format available.

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

From: Jimmy Wong <wyuenho <at> gmail.com>
To: Randy Taylor <dev <at> rjt.dev>
Cc: Yuan Fu <casouri <at> gmail.com>, 63086 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Wed, 26 Apr 2023 14:26:09 +0100
[Message part 1 (text/plain, inline)]
I can produce this with emacs-q. I’m using tree-sitter-go 0.19.1 from Macports.
On 26 Apr 2023 at 1:38 PM +0100, Randy Taylor <dev <at> rjt.dev>, wrote:
> On Wednesday, April 26th, 2023 at 07:07, Jimmy Wong <wyuenho <at> gmail.com> wrote:
>
> > Any go file will trigger this
> > On 26 Apr 2023 at 11:35 AM +0100, Eli Zaretskii <eliz <at> gnu.org>, wrote:
> > > > From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
> > > > Date: Wed, 26 Apr 2023 11:00:14 +0100
> > > >
> > > >
> > > > After visiting a go file and turning on M-x go-ts-mode, this following
> > > > message appears in the *Messages* buffer and the go buffer is not
> > > > highlighted as a result.
> > > >
> > > > QuitError during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 11 "[(false) (iota) (nil) (true)] @font-lock-constant-face (const_declaration (const_spec name: (identifier) @font-lock-constant-face))" "Debug the query with `treesit-query-validate'")
> > > > Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 11 "[(false) (iota) (nil) (true)] @font-lock-constant-face (const_declaration (const_spec name: (identifier) @font-lock-constant-face))" "Debug the query with `treesit-query-validate'")
> > >
> > > Can you post a minimal file that triggers this? Or are you saying
> > > that any Go file will cause this?
> > >
> > > Thanks.
>
> I can't reproduce this with any .go files I have laying around. Can you share one that reproduces the issue?
>
> Is the tree-sitter-go shared library file you're using the latest and most up to date one?
>
> What is the version of tree-sitter? If it's not the latest, can you try the latest and see if that helps?
>
> Also, and just to be on the safe side, are you able to reproduce this with emacs -Q?
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63086; Package emacs. (Wed, 26 Apr 2023 13:39:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jimmy Wong <wyuenho <at> gmail.com>
Cc: dev <at> rjt.dev, casouri <at> gmail.com, 63086 <at> debbugs.gnu.org
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Wed, 26 Apr 2023 16:38:20 +0300
> Date: Wed, 26 Apr 2023 14:26:09 +0100
> From: Jimmy Wong <wyuenho <at> gmail.com>
> Cc: Yuan Fu <casouri <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>, 
>  63086 <at> debbugs.gnu.org
> 
> I’m using tree-sitter-go 0.19.1 from Macports. 

That version was released 2 years ago.  Maybe go-ts-mode.el relies on
some newer functionality, or on some bug that was fixed since then?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63086; Package emacs. (Wed, 26 Apr 2023 13:46:01 GMT) Full text and rfc822 format available.

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

From: Jimmy Wong <wyuenho <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: dev <at> rjt.dev, casouri <at> gmail.com, 63086 <at> debbugs.gnu.org
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Wed, 26 Apr 2023 14:44:51 +0100
[Message part 1 (text/plain, inline)]
There hasn’t been any new releases since then, should emacs rely on devel packages?
On 26 Apr 2023 at 2:37 PM +0100, Eli Zaretskii <eliz <at> gnu.org>, wrote:
> > Date: Wed, 26 Apr 2023 14:26:09 +0100
> > From: Jimmy Wong <wyuenho <at> gmail.com>
> > Cc: Yuan Fu <casouri <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
> > 63086 <at> debbugs.gnu.org
> >
> > I’m using tree-sitter-go 0.19.1 from Macports.
>
> That version was released 2 years ago. Maybe go-ts-mode.el relies on
> some newer functionality, or on some bug that was fixed since then?
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63086; Package emacs. (Wed, 26 Apr 2023 14:06:01 GMT) Full text and rfc822 format available.

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

From: Randy Taylor <dev <at> rjt.dev>
To: Jimmy Wong <wyuenho <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 63086 <at> debbugs.gnu.org, casouri <at> gmail.com
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Wed, 26 Apr 2023 14:05:13 +0000
[Message part 1 (text/plain, inline)]
On Wednesday, April 26th, 2023 at 09:44, Jimmy Wong <wyuenho <at> gmail.com> wrote:

> There hasn’t been any new releases since then, should emacs rely on devel packages?
> On 26 Apr 2023 at 2:37 PM +0100, Eli Zaretskii <eliz <at> gnu.org>, wrote:
>
>>> Date: Wed, 26 Apr 2023 14:26:09 +0100
>>> From: Jimmy Wong <wyuenho <at> gmail.com>
>>> Cc: Yuan Fu <casouri <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
>>> 63086 <at> debbugs.gnu.org
>>>
>>> I’m using tree-sitter-go 0.19.1 from Macports.
>>
>> That version was released 2 years ago. Maybe go-ts-mode.el relies on
>>
>> some newer functionality, or on some bug that was fixed since then?

tree-sitter-go and a bunch of other grammars have dropped the ball of versioning, I think (some don't even try to version properly...). Since then there have plenty of changes, but it's stayed at the same version with no new tags. Anything packaging based on the tags of those repositories is going to be wildly out of date.

You can try using `M-x treesit-install-language-grammar` to install the go grammar, which will get the latest and greatest.

>

If I had to guess what triggers the error, it's probably the (iota) match which seems to have been added Jan 5, 2022. You can try removing that from go-ts-mode and seeing if it fixes the issue for you (although maybe that will fix the current problem but reveal a bunch more...all of which will be easily resolved by using a more up to date grammar). I'll try to get that old version installed myself and see.

I think java-ts-mode and some others have a helper that checks which queries are supported by testing them, I can make a patch for that if that's the direction we want to go.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63086; Package emacs. (Wed, 26 Apr 2023 15:41:01 GMT) Full text and rfc822 format available.

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

From: Randy Taylor <dev <at> rjt.dev>
To: Jimmy Wong <wyuenho <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 63086 <at> debbugs.gnu.org, casouri <at> gmail.com
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Wed, 26 Apr 2023 15:40:36 +0000
[Message part 1 (text/plain, inline)]
On Wednesday, April 26th, 2023 at 10:05, Randy Taylor <dev <at> rjt.dev> wrote:

> On Wednesday, April 26th, 2023 at 09:44, Jimmy Wong <wyuenho <at> gmail.com> wrote:
>
>> There hasn’t been any new releases since then, should emacs rely on devel packages?
>> On 26 Apr 2023 at 2:37 PM +0100, Eli Zaretskii <eliz <at> gnu.org>, wrote:
>>
>>>> Date: Wed, 26 Apr 2023 14:26:09 +0100
>>>> From: Jimmy Wong <wyuenho <at> gmail.com>
>>>> Cc: Yuan Fu <casouri <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
>>>> 63086 <at> debbugs.gnu.org
>>>>
>>>> I’m using tree-sitter-go 0.19.1 from Macports.
>>>
>>> That version was released 2 years ago. Maybe go-ts-mode.el relies on
>>>
>>> some newer functionality, or on some bug that was fixed since then?
>
> tree-sitter-go and a bunch of other grammars have dropped the ball of versioning, I think (some don't even try to version properly...). Since then there have plenty of changes, but it's stayed at the same version with no new tags. Anything packaging based on the tags of those repositories is going to be wildly out of date.
>
> You can try using `M-x treesit-install-language-grammar` to install the go grammar, which will get the latest and greatest.
>
>>
>
> If I had to guess what triggers the error, it's probably the (iota) match which seems to have been added Jan 5, 2022. You can try removing that from go-ts-mode and seeing if it fixes the issue for you (although maybe that will fix the current problem but reveal a bunch more...all of which will be easily resolved by using a more up to date grammar). I'll try to get that old version installed myself and see.
>
> I think java-ts-mode and some others have a helper that checks which queries are supported by testing them, I can make a patch for that if that's the direction we want to go.

I can reproduce this with the latest tagged tree-sitter-go version (v0.19.1 released on on Mar 3, 2021). I've attached a patch fixing it (i.e. go-ts-mode now runs and highlights), if we decide to support those older versions. Hopefully I didn't commit any elisp sins.

Please give it a try if you can, Jimmy. I still recommend that you upgrade to the latest tree-sitter-go (i.e. from the tip of the develop branch) yourself because v0.19.1 has other problems (some valid code can be highlighted as error if using the highest treesit-font-lock-level). And I would recommend that for all of the tree-sitter grammars.

>
[Message part 2 (text/html, inline)]
[0001-go-ts-mode-Use-iota-query-only-if-supported-Bug-6308.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63086; Package emacs. (Thu, 27 Apr 2023 06:37:02 GMT) Full text and rfc822 format available.

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

From: Jimmy Wong <wyuenho <at> gmail.com>
To: Randy Taylor <dev <at> rjt.dev>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 63086 <at> debbugs.gnu.org, casouri <at> gmail.com
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Thu, 27 Apr 2023 07:36:25 +0100
[Message part 1 (text/plain, inline)]
This worked!
On 26 Apr 2023 at 4:40 PM +0100, Randy Taylor <dev <at> rjt.dev>, wrote:
> On Wednesday, April 26th, 2023 at 10:05, Randy Taylor <dev <at> rjt.dev> wrote:
>
> > On Wednesday, April 26th, 2023 at 09:44, Jimmy Wong <wyuenho <at> gmail.com> wrote:
> >
> > > There hasn’t been any new releases since then, should emacs rely on devel packages?
> > > On 26 Apr 2023 at 2:37 PM +0100, Eli Zaretskii <eliz <at> gnu.org>, wrote:
> > > > > Date: Wed, 26 Apr 2023 14:26:09 +0100
> > > > > From: Jimmy Wong <wyuenho <at> gmail.com>
> > > > > Cc: Yuan Fu <casouri <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
> > > > > 63086 <at> debbugs.gnu.org
> > > > >
> > > > > I’m using tree-sitter-go 0.19.1 from Macports.
> > > >
> > > > That version was released 2 years ago. Maybe go-ts-mode.el relies on
> > > > some newer functionality, or on some bug that was fixed since then?
> >
> > tree-sitter-go and a bunch of other grammars have dropped the ball of versioning, I think (some don't even try to version properly...). Since then there have plenty of changes, but it's stayed at the same version with no new tags. Anything packaging based on the tags of those repositories is going to be wildly out of date.
> >
> > You can try using `M-x treesit-install-language-grammar` to install the go grammar, which will get the latest and greatest.
> >
> > If I had to guess what triggers the error, it's probably the (iota) match which seems to have been added Jan 5, 2022. You can try removing that from go-ts-mode and seeing if it fixes the issue for you (although maybe that will fix the current problem but reveal a bunch more...all of which will be easily resolved by using a more up to date grammar). I'll try to get that old version installed myself and see.
> >
> > I think java-ts-mode and some others have a helper that checks which queries are supported by testing them, I can make a patch for that if that's the direction we want to go.
>
> I can reproduce this with the latest tagged tree-sitter-go version (v0.19.1 released on on Mar 3, 2021). I've attached a patch fixing it (i.e. go-ts-mode now runs and highlights), if we decide to support those older versions. Hopefully I didn't commit any elisp sins.
>
> Please give it a try if you can, Jimmy. I still recommend that you upgrade to the latest tree-sitter-go (i.e. from the tip of the develop branch) yourself because v0.19.1 has other problems (some valid code can be highlighted as error if using the highest treesit-font-lock-level). And I would recommend that for all of the tree-sitter grammars.
>
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63086; Package emacs. (Fri, 28 Apr 2023 00:17:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Randy Taylor <dev <at> rjt.dev>, Jimmy Wong <wyuenho <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, casouri <at> gmail.com, 63086 <at> debbugs.gnu.org
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Fri, 28 Apr 2023 03:16:31 +0300
On 26/04/2023 17:05, Randy Taylor wrote:
> I think java-ts-mode and some others have a helper that checks which 
> queries are supported by testing them, I can make a patch for that if 
> that's the direction we want to go.

It might be better to use treesit-query-string instead, see 
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61913#55.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63086; Package emacs. (Fri, 28 Apr 2023 01:36:02 GMT) Full text and rfc822 format available.

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

From: Randy Taylor <dev <at> rjt.dev>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: casouri <at> gmail.com, Eli Zaretskii <eliz <at> gnu.org>, 63086 <at> debbugs.gnu.org,
 Jimmy Wong <wyuenho <at> gmail.com>
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Fri, 28 Apr 2023 01:35:13 +0000
On Thursday, April 27th, 2023 at 20:16, Dmitry Gutov <dmitry <at> gutov.dev> wrote:
> 
> On 26/04/2023 17:05, Randy Taylor wrote:
> 
> > I think java-ts-mode and some others have a helper that checks which
> > queries are supported by testing them, I can make a patch for that if
> > that's the direction we want to go.
> 
> 
> It might be better to use treesit-query-string instead, see
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61913#55.

Thanks.

Maybe I'm missing something, but doesn't treesit-query-string with an empty string do nothing and always error, since it queries on whatever string you pass in?

In that case, wouldn't using treesit-query-capture directly be the best? I don't understand why it's not from reading that thread. If it isn't, then treesit-query-validate is the only option, right?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63086; Package emacs. (Fri, 28 Apr 2023 10:07:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Randy Taylor <dev <at> rjt.dev>
Cc: casouri <at> gmail.com, Eli Zaretskii <eliz <at> gnu.org>, 63086 <at> debbugs.gnu.org,
 Jimmy Wong <wyuenho <at> gmail.com>
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Fri, 28 Apr 2023 13:05:51 +0300
On 28/04/2023 04:35, Randy Taylor wrote:
> Maybe I'm missing something, but doesn't treesit-query-string with an empty string do nothing and always error, since it queries on whatever string you pass in?

It would return nil, not error (querying an empty buffer). And we should 
be checking for error.

This is the part that java-ts-mode--string-highlight-helper got right, BTW.

go-ts-mode--iota-query-supported-p in your patch relies on the condition 
that the file, at the time the mode is enabled, already contains at 
least one "iota" node.

> In that case, wouldn't using treesit-query-capture directly be the best? I don't understand why it's not from reading that thread. If it isn't, then treesit-query-validate is the only option, right?

treesit-query-validate pops a new buffer interactively in the case of 
failure, so it's not something we should use here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63086; Package emacs. (Tue, 02 May 2023 00:31:01 GMT) Full text and rfc822 format available.

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

From: Randy Taylor <dev <at> rjt.dev>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: casouri <at> gmail.com, Eli Zaretskii <eliz <at> gnu.org>, 63086 <at> debbugs.gnu.org,
 Jimmy Wong <wyuenho <at> gmail.com>
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Tue, 02 May 2023 00:29:43 +0000
[Message part 1 (text/plain, inline)]
On Friday, April 28th, 2023 at 06:05, Dmitry Gutov <dmitry <at> gutov.dev> wrote:
> On 28/04/2023 04:35, Randy Taylor wrote:
> 
> > Maybe I'm missing something, but doesn't treesit-query-string with an empty string do nothing and always error, since it queries on whatever string you pass in?
> 
> 
> It would return nil, not error (querying an empty buffer). And we should
> be checking for error.
> 
> This is the part that java-ts-mode--string-highlight-helper got right, BTW.

Sorry, I was operating under false assumptions and somehow convinced myself that treesit-query-string with an empty string returning nil meant the query wasn't supported, hence me thinking it achieved nothing. I am no longer under such delusions :).

> 
> go-ts-mode--iota-query-supported-p in your patch relies on the condition
> that the file, at the time the mode is enabled, already contains at
> least one "iota" node.

Good point. I've attached a patch using treesit-query-string with an empty string. It now works properly when iota is missing but inserted later.

> 
> > In that case, wouldn't using treesit-query-capture directly be the best? I don't understand why it's not from reading that thread. If it isn't, then treesit-query-validate is the only option, right?
> 
> 
> treesit-query-validate pops a new buffer interactively in the case of
> failure, so it's not something we should use here.
[0001-go-ts-mode-Use-iota-query-only-if-supported-Bug-6308.patch (text/x-patch, attachment)]

Reply sent to Dmitry Gutov <dmitry <at> gutov.dev>:
You have taken responsibility. (Wed, 03 May 2023 21:59:02 GMT) Full text and rfc822 format available.

Notification sent to Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>:
bug acknowledged by developer. (Wed, 03 May 2023 21:59:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Randy Taylor <dev <at> rjt.dev>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 63086-done <at> debbugs.gnu.org, casouri <at> gmail.com,
 Jimmy Wong <wyuenho <at> gmail.com>
Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Thu, 4 May 2023 00:58:22 +0300
On 02/05/2023 03:29, Randy Taylor wrote:
> On Friday, April 28th, 2023 at 06:05, Dmitry Gutov <dmitry <at> gutov.dev> wrote:
>> On 28/04/2023 04:35, Randy Taylor wrote:
>>
>>> Maybe I'm missing something, but doesn't treesit-query-string with an empty string do nothing and always error, since it queries on whatever string you pass in?
>>
>>
>> It would return nil, not error (querying an empty buffer). And we should
>> be checking for error.
>>
>> This is the part that java-ts-mode--string-highlight-helper got right, BTW.
> 
> Sorry, I was operating under false assumptions and somehow convinced myself that treesit-query-string with an empty string returning nil meant the query wasn't supported, hence me thinking it achieved nothing. I am no longer under such delusions :).
> 
>>
>> go-ts-mode--iota-query-supported-p in your patch relies on the condition
>> that the file, at the time the mode is enabled, already contains at
>> least one "iota" node.
> 
> Good point. I've attached a patch using treesit-query-string with an empty string. It now works properly when iota is missing but inserted later.

Thanks! I've pushed this to emacs-29, so the bug can be closed.

Stylistically, I think I prefer the original way (with condition-case), 
but we'll have plenty of time to refine this on master later.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 01 Jun 2023 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 323 days ago.

Previous Next


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