feat(ai): move ai related extras from coding to ai (#4751)

## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [ ] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
This commit is contained in:
Folke Lemaitre
2024-11-10 11:27:21 +01:00
committed by GitHub
parent 309d189448
commit 86904d2fb1
6 changed files with 8 additions and 1 deletions

View File

@ -135,7 +135,7 @@ local defaults = {
}
M.json = {
version = 6,
version = 7,
path = vim.g.lazyvim_json or vim.fn.stdpath("config") .. "/lazyvim.json",
data = {
version = nil, ---@type string?

View File

@ -90,6 +90,13 @@ function M.migrate()
json.data.extras = vim.tbl_filter(function(extra)
return not (extra == "lazyvim.plugins.extras.editor.trouble-v3")
end, json.data.extras or {})
elseif json.data.version == 6 then
local ai = { "copilot", "codeium", "copilot-chat", "tabnine" }
json.data.extras = vim.tbl_map(function(extra)
return extra:gsub("^lazyvim%.plugins%.extras%.coding%.(.*)$", function(name)
return vim.tbl_contains(ai, name) and ("lazyvim.plugins.extras.ai." .. name) or extra
end)
end, json.data.extras or {})
end
M.save()