dracula/vim

Invalid character in group name

aleal-shopify opened this issue · 14 comments

What happened

After opening nvim it fails with the following message

Error detected while processing /home/blah/.local/share/nvim/site/pack/packer/start/dracula/after/plugin/dracula.vim:
line  120:
W18: Invalid character in group name
line  147:
W18: Invalid character in group name

And, the theme loads properly.

What I expected to happen

It should open the nvim without the error above.

Machine Info

Linux #1 SMP Sat Mar 5 10:09:49 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

  • Vim type (vim/gvim/neovim): nvim
  • Vim version: 0.8.0
  • OS: Linux
  • Terminal/Terminal Emulator/VTE: iterm2
  • TERM environment variable: screen-256color

It's not clear to me why this would fail in that way, but I do see the recent commit b9f4f3a169266031d3744335595eee02a6e396c6—is that related?

@dsifford sorry to have to bother you, but I'm at a loss.

Hi! Same issue for me, I pinned it down to being introduced in #291. For me, I just downgraded dracula.vim locally to d7723a8 as a quick fix. I suspect you could also upgrade treesitter or something as a solution as well. Hope that helps!

Darn. I was hoping we had done that in a way that would avoid problems. I guess we could try/catch it, but it would be nicer if we could test for the ability to define these groups instead.

I suspect you could also upgrade treesitter or something as a solution as well.

Calling :TSUpdate does not resolve the issue.

I have tested the behavior using neovim 0.8.0 and could not reproduce it.
Can you please tell me the exact version of neovim(nvim --version) where the problem occurs?

Note that it is difficult to support all nightly builds prior to the 0.8.0 release.

# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"

# uname -a
Linux roach 5.15.0-53-generic #59-Ubuntu SMP Mon Oct 17 18:53:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

# nvim --version
NVIM v0.8.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -ffile-prefix-map=/build/neovim-4iczgp/neovim-0.7.0~ubuntu1+git202207122117-d8360e903-dd05b3569=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim-4iczgp/neovim-0.7.0~ubuntu1+git202207122117-d8360e903-dd05b3569/build/cmake.config -I/build/neovim-4iczgp/neovim-0.7.0~ubuntu1+git202207122117-d8360e903-dd05b3569/src -I/build/neovim-4iczgp/neovim-0.7.0~ubuntu1+git202207122117-d8360e903-dd05b3569/.deps/usr/include -I/usr/include -I/build/neovim-4iczgp/neovim-0.7.0~ubuntu1+git202207122117-d8360e903-dd05b3569/build/src/nvim/auto -I/build/neovim-4iczgp/neovim-0.7.0~ubuntu1+git202207122117-d8360e903-dd05b3569/build/include
Compiled by buildd@lcy02-amd64-051

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Hi! @oryband
The neovim you are using appears to be a version under development. Is there any reason why you cannot use the released neovim?

Also nvim-treesitter only supports the last release of neovim(0.8.1 now) and the last commit of master.
see nvim-treesitter/nvim-treesitter#3656 (comment)

I think the solution to this issue is the following
Use the released version of neovim
or
Do not use nvim-treesitter

If 0.8.1 suffices, we can guard against it.

If we guarded in 0.8.1, the highlight will disappear in the released 0.8.0.

If we guarded in 0.8.1, the highlight will disappear in the released 0.8.0.

But you said

Also nvim-treesitter only supports the last release of neovim(0.8.1 now) and the last commit of master.
see nvim-treesitter/nvim-treesitter#3656 (comment)

So how can we include highlights that won't break? Or are you saying 0.8.0 suffices iff it's the released version?

Or are you saying 0.8.0 suffices iff it's the released version?

Yes, I have confirmed that it works in the released 0.8.0.
However, nvim-treesitter is not supported and it just happens to work.

But you said

Also nvim-treesitter only supports the last release of neovim(0.8.1 now) and the last commit of master.
see nvim-treesitter/nvim-treesitter#3656 (comment)

I am also wondering how to deal with this.

Which of the following do you think is better?

  • Make it work well with the released version. But get a warning in the unreleased version.
  • No warnings occur in any version. But cannot highlight using tree-sitter in released 0.8.0

Hmmm, now that 0.8.1 has been released, should I fix it to guard against 0.8.1?

Oh, and if I guard with 0.8.1, I might get an issue from a user of the released 0.8.0 that it is not highlighted with treesitter.

what should i do? 😭

I don't like warning. I think that if nvim-treesitter is "latest release and tip of master"-compatible only, then we can afford for the highlights to also be that way.

Then the question is how to implement that: we don't want to have to update the guard every time there is a NeoVim release.

I understand. I will go ahead and create a PR to change the guard to 0.8.1.

The ability to use @ in highlight group names is not a change in nvim-treesitter, but a Breaking changes in neovim 0.8.0.
So after changing the guard to 0.8.1, there is no need to update this guard to match the treesitter update.