summaryrefslogtreecommitdiff
path: root/lua/99/extensions/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/99/extensions/init.lua')
-rw-r--r--lua/99/extensions/init.lua15
1 files changed, 11 insertions, 4 deletions
diff --git a/lua/99/extensions/init.lua b/lua/99/extensions/init.lua
index 6aae2bb..6a7d631 100644
--- a/lua/99/extensions/init.lua
+++ b/lua/99/extensions/init.lua
@@ -8,15 +8,22 @@ local Files = require("99.extensions.files")
--- @param completion _99.Completion | nil
--- @return _99.Extensions.Source | nil
local function get_source(completion)
- if not completion or not completion.source then
- return
+ local source = completion and completion.source or "native"
+
+ if source == "native" then
+ local ok, native = pcall(require, "99.extensions.native")
+ if not ok then
+ vim.notify("[99] Failed to load native completions", vim.log.levels.ERROR)
+ return
+ end
+ return native
end
- local source = completion.source
+
if source == "cmp" then
local ok, cmp = pcall(require, "99.extensions.cmp")
if not ok then
vim.notify(
- '[99] nvim-cmp is not installed. Install hrsh7th/nvim-cmp or use source = "blink"',
+ '[99] nvim-cmp is not installed. Install hrsh7th/nvim-cmp or use source = "blink" or "native"',
vim.log.levels.WARN
)
return