Skip to content

Commit

Permalink
fix: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
KaitlynEthylia authored and saecki committed Jun 19, 2024
1 parent 613467a commit 652279b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lua/crates/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1856,12 +1856,14 @@ end
local function setup_neoconf(config)
---@type boolean, table
local ok, neoconf = pcall(require, 'neoconf')
if not ok then return config end
if not ok then
return config
end

-- enables neodev to autocomplete settings in .neoconf.json
pcall(function()
---@type table
local neoconf_plugins = require 'neoconf.plugins'
local neoconf_plugins = require('neoconf.plugins')
neoconf_plugins.register {
on_schema = function(schema)
schema:import("crates", config)
Expand All @@ -1873,14 +1875,16 @@ local function setup_neoconf(config)
__index = function(self, key)
local buf = vim.api.nvim_get_current_buf()
local loc = rawget(self, buf)
if loc then return loc[key] end
if loc then
return loc[key]
end
---@type Config
loc = neoconf.get("crates", config, {
buffer = buf,
lsp = true,
})
rawset(self, buf, loc)
return loc
return loc[key]
end
})
end
Expand Down

0 comments on commit 652279b

Please sign in to comment.