ray-x / go.nvim

G'day Nvimer, Joyful Gopher: Discover the Feature-Rich Go Plugin for Neovim
MIT License
1.9k stars 119 forks source link

How to avoid conflict with navigator #475

Closed Zach-Johnson closed 2 weeks ago

Zach-Johnson commented 3 weeks ago

Hello - I am hitting some kind of conflict between navigator and ray-x/go. With both plugins running I get a treesitter error in checkhealth:

  go(locals) is concatenated from the following files:
  |    [OK]:"/Users/zachjohnson/.local/share/nvim/lazy/nvim-treesitter/queries/go/locals.scm"
  | [ERROR]:"/Users/zachjohnson/.local/share/nvim/lazy/go.nvim/after/queries/go/locals.scm", failed to load: ...m/0.10.0/share/nvim/runtime/lua/vim/treesitter/query.lua:252: Query error at 8:2. Invalid node type "method_elem":
  (method_elem

I reduced my config down to a bare config and I still get the error:

return {
    "ray-x/navigator.lua",
    dependencies = {
        { "hrsh7th/nvim-cmp" },
        { "nvim-treesitter/nvim-treesitter" },
        { "nvim-treesitter/nvim-treesitter-refactor" },
        {
            "ray-x/guihua.lua",
            run = "cd lua/fzy && make",
        },
        {
            "ray-x/go.nvim",
            event = { "CmdlineEnter" },
            ft = { "go", "gomod" },
            build = ':lua require("go.install").update_all_sync()'
        },
        {
            "ray-x/lsp_signature.nvim", -- Show function signature when you type
            event = "VeryLazy",
            config = function() require("lsp_signature").setup() end
        }
    },
    config = function()
        require 'go'.setup({
            disable_defaults = true,
        })

        require("navigator").setup({})
    end
}

and the treesitter config:

return {
    "nvim-treesitter/nvim-treesitter",
    build = ":TSUpdate",
    event = { 'BufReadPost', 'BufNewFile' },
    lazy = false,
    tag = "v0.9.2",
    dependencies = {
        { "nvim-treesitter/nvim-treesitter-textobjects" }, -- Syntax aware text-objects
        { "nvim-treesitter/nvim-treesitter-refactor" },
        {
            "nvim-treesitter/nvim-treesitter-context", -- Show code context
            opts = {
                enable = true,
                mode = "topline",
                line_numbers = true,
                max_lines = 3,
            }
        }
    },
    config = function()
        local treesitter = require("nvim-treesitter.configs")

        treesitter.setup({
            ensure_installed = {
                "c", "lua", "vim", "vimdoc", "query",
                "dockerfile", "gitignore", "go", "gomod", "gosum",
                "gowork", "javascript", "json", "markdown", "proto",
                "python", "sql", "yaml"
            },
        })

Is there some config I'm missing here, or is this an actual issue somewhere?

ray-x commented 3 weeks ago

Is it something that happened recently? Will updating the go ts parser help resolve this issue?

Zach-Johnson commented 3 weeks ago

@ray-x I think so, but I've just added these two plugins to my config recently, and I've been messing around with it a lot. I think it was working at some point. I already updated go ts parser, no luck with that

Zach-Johnson commented 2 weeks ago

I think I got this resolved, I was using treesitter v0.9.2, changing to latest master seems to have fixed it. Not sure what changed!