neovim (AstroNvim) treesitter/highlighter 错误在注释行上

huangapple go评论91阅读模式
英文:

neovim (AstroNvim) treesitter/highlighter error on comment-lines

问题

我刚刚安装了Astronvim,并且遇到了以下问题:当文件中有任何注释(例如Python中的#、Lua中的--等)时,treesitter/highlighter会显示以下错误:

neovim (AstroNvim) treesitter/highlighter 错误在注释行上

一些额外信息:

  • 我没有额外的配置。只是使用了gruvbox主题和一些小插件(使用了Astronvim文档中的配置模板)。
  • 我已经尝试了纯粹的AstroNvim,没有任何改变。
  • 我已经检查了:TSUpdate命令。所有解析器都已安装和更新。
  • 我已经尝试了使用rm -rf删除Neovim的缓存、共享和状态后重新安装AstriNvim。
  • 在treesitter上运行:checkhealth不显示任何错误或警告。

nvim --version命令输出:

NVIM v0.9.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/nvim/parts/nvim/build/.deps/usr/include/luajit-2.1 -I/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/build/src/nvim/auto -I/build/nvim/parts/nvim/build/build/include -I/build/nvim/parts/nvim/build/build/cmake.config -I/build/nvim/parts/nvim/build/src -I/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include

全局系统vimrc文件: "$VIM/sysinit.vim"
默认$VIM值: "/usr/share/nvim"

运行 :checkhealth 获取更多信息

如果问题出在我的配置中,这里是配置的链接:https://github.com/ALittleMoron/AstroNvimConfig

英文:

I've just installed astronvim and have the following issue: when there is any comment in the file (python #, lua --, etc.), treesitter/highlighter displays the following error:

neovim (AstroNvim) treesitter/highlighter 错误在注释行上

Some extra-information:

  • I have no extra configure. Just gruvbox theme and some little plugins (with config template from astronvim docs).
  • I've already tested it with pure AstroNvim - nothing changed.
  • I've already checked :TSUpdate command. All parsers are installed and updated.
  • I've already tried reinstall AstriNvim with rm -rf on cache, share and state of neovim.
  • :checkhealth on treesitter shows no errors or warnings.

nvim --version command output:

NVIM v0.9.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/nvim/parts/nvim/build/.deps/usr/include/luajit-2.1 -I/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/build/src/nvim/auto -I/build/nvim/parts/nvim/build/build/include -I/build/nvim/parts/nvim/build/build/cmake.config -I/build/nvim/parts/nvim/build/src -I/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include

            общесистемный файл vimrc: "$VIM/sysinit.vim"
          значение $VIM по умолчанию: "/usr/share/nvim"

Run :checkhealth for more info

If the problem in my config, here is a link to it: https://github.com/ALittleMoron/AstroNvimConfig

答案1

得分: 1

解决方案很简单,但我忘记去做:

我通过 which nvim 检查了 neovim 的位置,然后意识到我的 neovim 是通过 snap 安装的,所以我只是删除了它,然后通过本机包管理器重新安装:sudo pacman -S neovim,没有重新设置配置。现在一切都正常工作。

英文:

The solution was simple, but I forgot to do it:

I checked neovim location with which nvim and realized, that my neovim was installed via snap, so I just delete it and reinstall via native package manager: sudo pacman -S neovim with no config resetting. All work ok now.

huangapple
  • 本文由 发表于 2023年6月9日 02:21:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/76434692.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定