Skip to content

Can't remove treesitter from nvim-cmp sources #1428

@KN13KOMETA

Description

@KN13KOMETA

I tried to remove treesitter from nvim-cmp sources by making it null:

config.vim = {
  treesitter = {
    fold = true;
    context.enable = true;
  };
  autocomplete.nvim-cmp = {
    enable = true;
    sourcePlugins = [
      "cmp-nvim-lsp"
      "cmp-path"
    ];
    sources = {
      treesitter = null;
    };
  };
};

And I got that error:

error: The option `vim.autocomplete.nvim-cmp.sources.treesitter` is defined both null and not null, in `/nix/store/fnbinzfzkwiw9kihfaig18x2raf3zxdz-source/modules/plugins/treesitter/config.nix' and `<unknown-file>'.

I assume the problem is here, where treesitter automatically add itself to nvim-cmp sources:

# cmp-treesitter doesn't work on blink.cmp
autocomplete.nvim-cmp = mkIf config.vim.autocomplete.nvim-cmp.enable {
sources = {treesitter = "[Treesitter]";};
sourcePlugins = ["cmp-treesitter"];
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions