Subject: 29.1.90; python-ts-mode "not in" not highlighted

From: Jimmy Yuen Ho Wong <[email-masked]>
Date: Thu, 09 Nov 2023 10:56:44 +0000

Reproduction:

1. M-x python-ts-mode
2. Type

   if 1 not in [1 2 3]:
       pass
   
3. As soon as you start inserting anything after "in ", the whole "not in"
   keyword block is unhighlighted.

Expectation:

Keywords should always be highlighted when they are used in keyword contexts.

---------

In GNU Emacs 29.1.90 (build 1, aarch64-apple-darwin22.6.0, NS
 appkit-2299.70 Version 13.6.1 (Build 22G313)) of 2023-11-09 built on
 MobileCat.local
Windowing system distributor 'Apple', version 10.3.2299
System Description:  macOS 13.6.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 --with-sqlite3
 --with-webp --infodir /opt/local/share/info/emacs --with-ns
 --with-lcms2 --without-harfbuzz --without-imagemagick --without-xaw3d
 --with-rsvg --with-xwidgets --with-native-compilation=aot
 --with-tree-sitter '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: Python

Minor modes in effect:
  highlight-indent-guides-mode: t
  python-docstring-mode: t
  sphinx-doc-mode: t
  company-quickhelp-mode: t
  company-quickhelp-local-mode: t
  company-prescient-mode: t
  flycheck-inline-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
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  diff-hl-flydiff-mode: t
  projectile-rails-global-mode: t
  pet-mode: t
  projectile-mode: t
  shell-dirtrack-mode: t
  pdf-occur-global-minor-mode: t
  marginalia-mode: t
  vertico-prescient-mode: t
  prescient-persist-mode: t
  vertico-mouse-mode: t
  vertico-mode: t
  override-global-mode: t
  envrc-mode: t
  dap-tooltip-mode: t
  dap-ui-many-windows-mode: t
  dap-ui-controls-mode: t
  dap-ui-mode: t
  treemacs-filewatch-mode: t
  treemacs-follow-mode: t
  treemacs-git-mode: t
  treemacs-fringe-indicator-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
  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
  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
  gcmh-mode: t
  editorconfig-mode: t
  desktop-save-mode: t
  delete-selection-mode: t
  dap-auto-configure-mode: t
  dap-mode: t
  yas-minor-mode: t
  auto-compile-on-save-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:
/Users/wyuenho/.emacs.d/elpa/transient-20231103.2312/transient hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/transient
/Users/wyuenho/.emacs.d/elpa/use-package-20230426.2324/use-package-jump hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-jump
/Users/wyuenho/.emacs.d/elpa/use-package-20230426.2324/use-package-ensure hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-ensure
/Users/wyuenho/.emacs.d/elpa/use-package-20230426.2324/use-package-core hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-core
/Users/wyuenho/.emacs.d/elpa/use-package-ensure-system-package-20221209.2013/use-package-ensure-system-package hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-ensure-system-package
/Users/wyuenho/.emacs.d/elpa/use-package-20230426.2324/use-package-delight hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-delight
/Users/wyuenho/.emacs.d/elpa/use-package-20230426.2324/use-package-diminish hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-diminish
/Users/wyuenho/.emacs.d/elpa/use-package-20230426.2324/use-package hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package
/Users/wyuenho/.emacs.d/elpa/use-package-20230426.2324/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-20230426.2324/use-package-lint hides /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/use-package/use-package-lint

Features:
(shadow sort mail-extr emacsbug macros cl-print crux vundo
smartparens-rst rst helpful cc-langs trace edebug info-look elisp-refs
misearch multi-isearch visual-regexp-steroids visual-regexp conf-mode
tabify dap-python highlight-indent-guides python-docstring sphinx-doc
rainbow-mode elisp-def ert debug backtrace 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 lsp-jq lsp-zig lsp-tilt lsp-steep
lsp-svelte lsp-sqls lsp-solidity 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-semgrep lsp-rust lsp-rubocop
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-mojo lsp-magik lsp-nix lsp-nim lsp-nginx
lsp-move lsp-mint lsp-mdx 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-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-credo
lsp-cmake lsp-clojure lsp-semantic-tokens lsp-clangd lsp-beancount
lsp-bash lsp-astro lsp-awk lsp-ansible lsp-angular lsp-ada
lsp-actionscript lsp-modeline lsp-diagnostics lsp-completion lsp-origami
dap-cpptools company-quickhelp pos-tip company-prescient
company-keywords company-etags company-gtags company-dabbrev-code
company-dabbrev company-yasnippet company-capf company-files
company-cmake company-clang company-semantic company-template
company-bbdb flycheck-inline flycheck-cask dap-codelldb cus-start
dap-gdb-lldb dap-utils display-line-numbers cap-words superword subword
smartparens-config smartparens-javascript smartparens-rust
smartparens-ruby smartparens-org smartparens-python smartparens-markdown
smartparens-text smartparens-c page-break-lines c++-ts-mode c-ts-mode
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 ibuffer-projectile
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 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 magit-diff smerge-mode git-commit log-edit add-log
magit-core magit-autorevert magit-margin magit-transient magit-process
with-editor magit-mode magit-git magit-base magit-section cursor-sensor
crm diff-hl-flydiff diff ediff-merg ediff-mult ediff-wind ediff-diff
ediff-help ediff-init ediff-util 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-metals view
lsp-metals-treeview lsp-metals-protocol lsp-sourcekit dap-java lsp-java
request lsp cargo cargo-process rust-ts-mode protobuf-ts-mode
flycheck-golangci-lint cmake-ts-mode yard-mode lsp-pyright pet lsp-jedi
python-pytest projectile grep transient python-isort python-black python
python-insert-docstring tide tide-lv etags fileloop typescript-ts-mode
prettier tramp tramp-loaddefs trampver tramp-integration files-x
tramp-compat nvm iter2 jsdoc reformatter flycheck-package package-lint
finder dockerfile-ts-mode toml-ts-mode yaml-mode eterm-256color term
disp-table native-complete shell ehelp xterm-color 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 embark-org org-element
org-persist xdg org-id org-refile avl-tree generator org ob ob-tangle
ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete
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-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 cedet pdf-isearch pdf-misc pdf-loader pdf-tools pdf-view
treemacs-bookmarks treemacs-tags bookmark jka-compr pdf-cache pdf-info
tq pdf-util format-spec pdf-macs image-mode exif iedit iedit-lib
mc-hide-unmatched-lines-mode mc-mark-more mc-cycle-cursors
multiple-cursors-core rect embark ffap marginalia vertico-prescient
prescient char-fold vertico-mouse vertico-directory vertico compat
scroll-on-jump pager-default-keybindings pager browse-kill-ring edmacro
kmacro use-package-bind-key bind-key use-package-delight envrc
inheritenv exec-path-from-shell spaceline-config spaceline-segments
spaceline powerline powerline-separators powerline-themes
solarized-dark-theme solarized-theme solarized solarized-faces
all-the-icons all-the-icons-faces all-the-icons-data-material-icons
all-the-icons-data-fluentui-system-icons
all-the-icons-data-fontawesome-4 all-the-icons-data-weather-icons
all-the-icons-data-vscode-codicons all-the-icons-data-octicons
all-the-icons-data-mfixx all-the-icons-data-file-icons
all-the-icons-data-devopicons all-the-icons-data-alltheicons svg dom xml
mode-local parse-time iso8601 delight quelpa-use-package
use-package-core quelpa lisp-mnt help-fns radix-tree finder-inf
mm-archive message sendmail yank-media dired dired-loaddefs rfc822 mml
mml-sec epa gnus-util time-date mailabbrev gmm-utils mailheader
mm-decode mm-bodies mm-encode mail-utils gnutls url-cache url-http
url-auth mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr url-gw 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 cus-edit pp lsp-lens winner which-key which-func
smooth-scrolling smartparens loadhist server savehist saveplace pcre2el
rxt re-builder recentf mb-depth help-at-pt whitespace-cleanup-mode
advice 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 diff-mode company autorevert
aggressive-indent easy-mmode gcmh editorconfig editorconfig-core
editorconfig-core-handle editorconfig-fnmatch 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 s ewoc epg
rfc6068 epg-config dash compile text-property-search comint ansi-osc
ansi-color ring auto-compile let-alist filenotify cus-load
add-node-modules-path-autoloads ag-autoloads aggressive-indent-autoloads
all-the-icons-dired-autoloads all-the-icons-autoloads
apib-mode-autoloads arduino-mode-autoloads ede/auto eieio-base
auto-compile-autoloads auto-yasnippet-autoloads bazel-autoloads
beginend-autoloads browse-kill-ring-autoloads buffer-move-autoloads
bug-hunter-autoloads buttercup-autoloads cargo-autoloads
cask-mode-autoloads company-native-complete-autoloads
company-prescient-autoloads company-quickhelp-autoloads
company-autoloads coverage-autoloads crux-autoloads csv-mode-autoloads
cycle-quotes-autoloads delight-autoloads diff-ansi-autoloads
diff-hl-autoloads dired-collapse-autoloads dired-hacks-utils-autoloads
dired-hide-dotfiles-autoloads dired-single-autoloads
docker-compose-mode-autoloads dotenv-mode-autoloads elisp-def-autoloads
embark-autoloads emmet-mode-autoloads enh-ruby-mode-autoloads
envrc-autoloads eterm-256color-autoloads exec-path-from-shell-autoloads
expreg-autoloads flycheck-cask-autoloads
flycheck-golangci-lint-autoloads flycheck-inline-autoloads
flycheck-package-autoloads focus-autoloads fontify-face-autoloads
forge-autoloads closql-autoloads emacsql-autoloads gcmh-autoloads
ghub-autoloads git-modes-autoloads git-timemachine-autoloads
go-mode-autoloads graphql-mode-autoloads graphviz-dot-mode-autoloads
groovy-mode-autoloads helpful-autoloads elisp-refs-autoloads
highlight-indent-guides-autoloads ialign-autoloads
ibuffer-projectile-autoloads iedit-autoloads imenu-anywhere-autoloads
impostman-autoloads inheritenv-autoloads jq-mode-autoloads
jsdoc-autoloads jsonian-autoloads jupyter-autoloads just-mode-autoloads
kurecolor-autoloads lorem-ipsum-autoloads lsp-java-autoloads
lsp-jedi-autoloads lsp-metals-autoloads dap-mode-autoloads
lsp-docker-autoloads bui-autoloads lsp-origami-autoloads
lsp-pyright-autoloads lsp-sourcekit-autoloads lsp-treemacs-autoloads
lsp-ui-autoloads lsp-mode-autoloads macrostep-autoloads
magit-lfs-autoloads magit-todos-autoloads magit-autoloads
magit-section-autoloads git-commit-autoloads hl-todo-autoloads
async-autoloads marginalia-autoloads markdown-mode-autoloads
mermaid-mode-autoloads monky-autoloads move-dup-autoloads
multiple-cursors-autoloads native-complete-autoloads
nodejs-repl-autoloads olivetti-autoloads origami-autoloads ov-autoloads
package-build-autoloads derived package-lint-autoloads
page-break-lines-autoloads pager-default-keybindings-autoloads
pager-autoloads pcre2el-autoloads pdf-tools-autoloads pet-autoloads
plantuml-mode-autoloads po-mode-autoloads pos-tip-autoloads
prettier-autoloads editorconfig-autoloads nvm-autoloads iter2-autoloads
projectile-rails-autoloads inf-ruby-autoloads inflections-autoloads
protobuf-ts-mode-autoloads python-black-autoloads
python-docstring-autoloads python-insert-docstring-autoloads
python-isort-autoloads python-pytest-autoloads projectile-autoloads
quelpa-use-package-autoloads quelpa-autoloads quick-peek-autoloads
rainbow-mode-autoloads rake-autoloads reason-mode-autoloads
reformatter-autoloads repeat-help-autoloads rg-autoloads
ron-mode-autoloads sass-mode-autoloads haml-mode-autoloads
sbt-mode-autoloads scala-mode-autoloads scroll-on-jump-autoloads
shift-number-autoloads shrink-path-autoloads f-autoloads
simple-httpd-autoloads smart-semicolon-autoloads smartparens-autoloads
smooth-scrolling-autoloads solarized-theme-autoloads spaceline-autoloads
powerline-autoloads sphinx-doc-autoloads spinner-autoloads
ssh-config-mode-autoloads string-inflection-autoloads swagg-autoloads
request-autoloads swift-mode-autoloads tablist-autoloads
terraform-mode-autoloads hcl-mode-autoloads tide-autoloads
flycheck-autoloads pkg-info-autoloads epl-autoloads transient-autoloads
treemacs-autoloads cfrs-autoloads posframe-autoloads ht-autoloads
hydra-autoloads lv-autoloads pfuture-autoloads ace-window-autoloads
avy-autoloads s-autoloads dash-autoloads treepy-autoloads
ts-comint-autoloads tuareg-autoloads caml-autoloads udev-mode-autoloads
use-package-ensure-system-package-autoloads system-packages-autoloads
use-package-autoloads verb-autoloads vertico-prescient-autoloads
vertico-autoloads prescient-autoloads visual-regexp-steroids-autoloads
visual-regexp-autoloads vterm-autoloads vundo-autoloads
web-mode-autoloads websocket-autoloads wgrep-ag-autoloads
wgrep-autoloads which-key-autoloads whitespace-cleanup-mode-autoloads
window-purpose-autoloads shut-up-autoloads imenu-list-autoloads
with-editor-autoloads info compat-autoloads xterm-color-autoloads
yaml-autoloads yaml-mode-autoloads yard-mode-autoloads
yarn-mode-autoloads yasnippet-snippets-autoloads yasnippet-autoloads
zmq-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 pcase bootstrap-theme comp
comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode
bytecomp byte-compile 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 1366441 428411)
 (symbols 48 100114 0)
 (strings 32 387483 120979)
 (string-bytes 1 15872031)
 (vectors 16 161652)
 (vector-slots 8 4182146 853882)
 (floats 8 1027 2644)
 (intervals 56 10878 5873)
 (buffers 984 39))