Skip to content

Cannot change style of annotation in LazyVim #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
G00Z-G00Z opened this issue Mar 26, 2025 · 0 comments
Open

Cannot change style of annotation in LazyVim #215

G00Z-G00Z opened this issue Mar 26, 2025 · 0 comments

Comments

@G00Z-G00Z
Copy link

I'm trying to change the documentation style in lazy vim using their LazyVim.extras using their documentation. However It does not seem to be working. I do not know if its a problem with LazyVim itself. Here is the snippet that does not work:

return {
  "danymat/neogen",
  dependencies = LazyVim.has("mini.snippets") and { "mini.snippets" } or {},
  cmd = "Neogen",
  keys = {
    {
      "<leader>cn",
      function()
        require("neogen").generate()
      end,
      desc = "Generate Annotations (Neogen)",
    },
  },
  opts = function(_, opts)
    if opts.snippet_engine ~= nil then
      return
    end

    local map = {
      ["LuaSnip"] = "luasnip",
      ["mini.snippets"] = "mini",
      ["nvim-snippy"] = "snippy",
      ["vim-vsnip"] = "vsnip",
    }

    for plugin, engine in pairs(map) do
      if LazyVim.has(plugin) then
        opts.snippet_engine = engine
        return
      end
    end

    if vim.snippet then
      opts.snippet_engine = "nvim"
    end

    -- Does not seem to work
    opts.languages = {
      python = {
        template = {
          annotation_convention = "google", -- for a full list of annotation_conventions, see supported-languages below,
        },
      },
    }
  end,
}

I tried putting the configuration in the table, but it does not seem to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant