程序员最近都爱上了这个网站  程序员们快来瞅瞅吧!  it98k网:it98k.com

本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长

+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

Why treesitter syntax highlighting not working correctly with FastAPI Python decorators in Neovim?

发布于2024-12-12 10:37     阅读(985)     评论(0)     点赞(29)     收藏(1)


I'm having an issue with syntax highlighting for FastAPI decorators. In VSCode everything works perfectly out of the box (after installed some Python extensions), but in Neovim the whole decorator section has the same color (tried with a lot a color schemes)

Code looks like this in Neovim Syntax highlighting in Neovim Same code looks like this in VSCode: Syntax highlighting in VSCode This is my treesitter config:

{
  'nvim-treesitter/nvim-treesitter',
  build = ':TSUpdate',
  main = 'nvim-treesitter.configs',
  opts = {
    ensure_installed = { 'python', 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
    auto_install = true,
    highlight = {
      enable = true,
      additional_vim_regex_highlighting = { 'ruby' },
    },
    indent = { enable = true, disable = { 'ruby' } },
  },
},

I'm using Neovim 0.10.0, and this config based on kickstart.nvim.

I tried disabling other plugins but this is not solved my issue. If I disable treesitter for this buffer, the highlighting works as I expected.


解决方案


暂无回答



所属网站分类: 技术文章 > 问答

作者:黑洞官方问答小能手

链接:https://www.pythonheidong.com/blog/article/2046424/dde315a1dd8a27359932/

来源:python黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

29 0
收藏该文
已收藏

评论内容:(最多支持255个字符)