Commit Graph

143 Commits

Author SHA1 Message Date
Folke Lemaitre 3be55a4615 feat: added support for plugin packages by lazy, rockspec and packspec 2024-06-24 17:15:10 +02:00
Folke Lemaitre f1ba2e3d05 feat: luarocks support 2024-06-24 17:15:10 +02:00
Folke Lemaitre 8eba74c3fc feat: packspec 2024-06-24 17:15:10 +02:00
Folke Lemaitre b4316da731
fix(plugin): rebuild optional when needed and remove frags from parent deps. Fixes #1402 2024-06-16 15:52:33 +02:00
Folke Lemaitre be5dfba542
fix(plugin): better way of dealing with local specs. Fixes #1524 2024-06-16 07:09:33 +02:00
Folke Lemaitre e2e10d9cbe
feat: find local_spec in parent directories as well. Closes #1519 2024-06-15 09:28:58 +02:00
Folke Lemaitre 067fd41933
fix(plugin): check optional plugins again after resolving enabled. Fixes #1402 2024-06-15 09:11:36 +02:00
Folke Lemaitre 1f7b720cff
feat(plugin): `opts_extend` can be a list of dotted keys that will be extended instead of merged 2024-06-07 09:02:52 +02:00
Zhizhen He f39c79fcb1
style: fix some typo (#1496) 2024-06-03 09:18:43 +02:00
Folke Lemaitre 9dde1f1bce
feat: added support for local spec files `.lazy.lua` 2024-05-26 16:43:52 +02:00
atusy a6f782adc1
feat(plugin): dev.path can now be a function (#1157)
In some case, `dev.path .. plugin.name` is not enoguh.

For example, when using `ghq` to manage projects, plugin directories may
vary by onewrs of the plugins.

With this change, users can do something like below

``` lua
require("lazy").setup("plugins", {
  dev = {
    path = function(p)
      -- ghq
      local path, cnt = string.gsub(p.url, "^https://(.*)%.git$", "~/ghq/%1")
      if cnt == 1 then
        return path
      end

      -- fallback to default
      return "~/projects/" .. plugin.name
    end,
  },
})
```
2024-01-20 14:19:09 +01:00
Folke Lemaitre c1b9887373
perf(plugin): cache lazy handler values 2023-10-16 23:04:57 +02:00
Folke Lemaitre 2f169e74d4
refactor(handlers): lazy resolving of plugin handlers (#1126)
* refactor(handlers): lazy resolving of plugin handlers

* test: fixed tests
2023-10-16 22:34:44 +02:00
Folke Lemaitre 2270bbbc48
fix(plugin): work-around for Plugin.values error. Will add proper fix later. Fixes #1124 2023-10-16 18:11:02 +02:00
Folke Lemaitre 1cfd6d1f36
fix(loader): don't load handlers before installing plugins 2023-10-16 15:05:16 +02:00
Folke Lemaitre c8e2091e6d
fix(plugin): dont allow `dir` changes when we already loaded files from the plugin's old dir. Show an error in this case. Fixes #993 2023-10-15 08:51:54 +02:00
Folke Lemaitre 3dc413d6fd
fix(plugin): improved dir/dev merging. Fixes #993 2023-10-15 08:36:15 +02:00
Folke Lemaitre 0c53d4673f
feat(plugin): treat url changes as warnings. They will only be shown with checkhealth 2023-10-14 23:07:01 +02:00
Folke Lemaitre 22bf6ae04b
style: sort requires 2023-10-09 11:25:42 +02:00
abeldekat 58e954a735
feat(plugin): added support for `cond` for imports (#1079)
Co-authored-by: abeldekat <abel@nomail.com>
2023-10-06 15:46:46 +02:00
Folke Lemaitre 82da5a0048
refactor(plugin): refactored rebuild 2023-10-04 12:50:48 +02:00
Folke Lemaitre 638c8e6382
fix(plugin): rebuild plugins after fixing optional and cond to ensure enabled will work correctly 2023-10-04 11:48:14 +02:00
Folke Lemaitre 8eb8de29af
feat(plugin): keep track of the module a spec fragment was defined in 2023-10-04 00:20:08 +02:00
Folke Lemaitre 09e5010741
fix(plugin): prevent recursive loop with cond=false. Fixes #1061 2023-09-30 18:02:07 +02:00
Folke Lemaitre 6a2c47e642
style: lua annotations 2023-09-29 16:37:55 +02:00
Folke Lemaitre f3c7169dd6
feat(plugin): dont include plugin spec fragments for disabled or optional plugins (#1058)
* feat(plugin): dont include plugin spec fragments for disabled or optional plugins

* test: fixed tests

* fix(plugin): calculate handlers after disabling plugins

* fix(plugin): clear Plugin._.super when rebuilding

* fix(ui): dont process handlers for disabled plugins

* test: added tests for disabling fragments

* fix(plugin): ignore any installed deps of a disabled conditional plugin. Fixes #1053
2023-09-29 16:11:56 +02:00
abeldekat e7334d8db5
feat(plugins): Given an optional plugin, conditionally discard deps (#947)
* deps_of_all_optional: First, refactor the code responsible for disabling unneeded deps to be more generic

* deps_of_all_optional: Second, also disable unneeded deps from plugins marked as all optional

* deps_of_all_optional: add tests proving unneeded optional deps are now also discarded

* deps_of_all_optional: forgot return type

---------

Co-authored-by: abeldekat <abel@nomail.com>
2023-07-22 10:20:52 +02:00
Folke Lemaitre fbb0bea2db
feat(plugin)!: `cond` is now the same as `enabled`, but skips clean 2023-07-06 15:30:01 +02:00
Folke Lemaitre 42ff6009f6
fix(plugin): fixup. It's fine that Plugin.url doesn't exist 2023-05-27 08:49:45 +02:00
Folke Lemaitre 199e100464
fix(plugin): delay check if plugin ref exists until after loading all plugins. Fixes #833 2023-05-27 08:45:14 +02:00
Folke Lemaitre c325c50ba4
fix(plugin): check that import is a string. See #825 2023-05-25 08:26:55 +02:00
Folke Lemaitre 32170a8891
fix(plugin): fix url based plugin name and added extra safety checks. Fixes #824 2023-05-25 08:10:08 +02:00
Folke Lemaitre 57062f3a09
feat(plugin): trigger LazyPlugins after loading plugin specs 2023-05-25 08:09:19 +02:00
Folke Lemaitre b0aa5348d8
docs: added docs on optional 2023-05-23 08:57:57 +02:00
Folke Lemaitre 9177778891
fix(plugin): rename weak => optional. Makes more sense :) 2023-05-22 14:53:36 +02:00
Folke Lemaitre af39d61d3f
fix: better weak handling 2023-05-22 14:31:28 +02:00
Folke Lemaitre 8564f6d22b
feat(plugin): added support for `weak` specs. They will not be included in the final spec if not specified somwhere else 2023-05-22 14:24:18 +02:00
Fraser Hanson d2d67b5a0b
fix(config): use url_format for the lazy plugin (#792)
Co-authored-by: Fraser Hanson <fraser.hanson@netapp.com>
2023-05-10 17:20:06 +02:00
Folke Lemaitre dff6f07290
style(plugins): more descriptive error when a spec module didnt return any specs 2023-04-22 14:10:06 +02:00
Folke Lemaitre ea1a044e3c
feat(cache): use `vim.cache` everywhere. poly-fill when needed 2023-03-14 19:45:22 +01:00
Folke Lemaitre 1a34636094
refactor(cache): documented the cache in preparation to upstream 2023-03-14 12:56:58 +01:00
Folke Lemaitre 355312eb51
fix(plugin): properly pass is_list for recursively merging props 2023-03-07 19:11:33 +01:00
Folke Lemaitre 77223786aa
fix(git): properly deal with failed clones. Fixes #571 2023-02-28 11:51:16 +01:00
Folke Lemaitre ff76e58961
fix(spec): make sure imported specs are sorted alphabetically 2023-02-17 13:58:23 +01:00
Null Chilly 772d8888cc
feat(dev): optionally fallback to git when local plugin doesn't exist (#446)
* feat: fallback to git when local plugin isn't found

* feat(option): fallback to git when local plugin doesn't exist
2023-01-24 22:55:34 +01:00
Folke Lemaitre c389ad552b
fix(spec): dont complain about an invalid short url, when a full url is set. Fixes #421 2023-01-18 08:39:02 +01:00
Folke Lemaitre 1b2a6f631c
perf(plugin): de-duplicate dependencies, keys, ft, event and cmd 2023-01-17 14:00:42 +01:00
Folke Lemaitre da4e8cc245
fix(spec): dont copy dep and super state from existing plugins 2023-01-17 14:00:42 +01:00
Folke Lemaitre baaf8ddfff
fix(spec): when overriding a spec by name that has not been imported yet, show an error when needed 2023-01-17 14:00:42 +01:00
Folke Lemaitre 0cbd91d2cd
feat(spec): you can now override specs using only the plugin name instead of the short url 2023-01-16 17:03:43 +01:00