fix: namespace all local packages and modules

This commit is contained in:
2025-04-16 23:16:58 +02:00
parent 0c327701a1
commit 16ccb1d107
45 changed files with 43 additions and 32 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ if version.major == 0 then
end
end
local utils = require("utils")
local utils = require("ow.utils")
-- Install lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+18 -9
View File
@@ -1,9 +1,9 @@
local utils = require("utils")
local utils = require("ow.utils")
local CONFIG_DIR = vim.fn.stdpath("config") .. "/lua/lsp/config"
local CONFIG_DIR = vim.fn.stdpath("config") .. "/lua/ow/lsp/config"
---@class Server
local Server = require("lsp.server")
local Server = require("ow.lsp.server")
local M = {}
@@ -19,9 +19,9 @@ local function get_module_name(filepath)
end
local function get_server_config(name)
local module = "lsp.config." .. name
local module = "ow.lsp.config." .. name
package.loaded[module] = nil
return utils.try_require("lsp.config." .. name)
return utils.try_require("ow.lsp.config." .. name)
end
local reload_server_config = utils.debounce_with_id(function(name, events)
@@ -35,7 +35,8 @@ local reload_server_config = utils.debounce_with_id(function(name, events)
end
if events.rename then
local _, _, err_name = vim.uv.fs_stat(("%s/%s.lua"):format(CONFIG_DIR, name))
local _, _, err_name =
vim.uv.fs_stat(("%s/%s.lua"):format(CONFIG_DIR, name))
if err_name == "ENOENT" then
return
end
@@ -51,7 +52,7 @@ local reload_server_config = utils.debounce_with_id(function(name, events)
return
end
local on_done = function (success)
local on_done = function(success)
if success then
utils.info(("%s reloaded"):format(name))
end
@@ -68,7 +69,10 @@ end, 1000)
local function process_change(error, filename, events)
if error then
utils.err(("Error on change for %s:\n%s"):format(filename, error), "lsp.on_config_change")
utils.err(
("Error on change for %s:\n%s"):format(filename, error),
"ow.lsp.on_config_change"
)
return
end
@@ -109,7 +113,12 @@ local function load_configs()
::continue::
end
vim.uv.fs_event_start(vim.uv.new_fs_event(), CONFIG_DIR, {}, vim.schedule_wrap(process_change))
vim.uv.fs_event_start(
vim.uv.new_fs_event(),
CONFIG_DIR,
{},
vim.schedule_wrap(process_change)
)
end
--- Setup diagnostics UI
@@ -1,4 +1,4 @@
local utils = require("utils")
local utils = require("ow.utils")
return {
enable = true,
@@ -1,4 +1,4 @@
local utils = require("utils")
local utils = require("ow.utils")
---@type ServerConfig
return {
@@ -2,7 +2,7 @@
-- https://github.com/bmewburn/intelephense-docs/blob/master/installation.md
-- https://github.com/bmewburn/vscode-intelephense/blob/master/package.json
local utils = require("utils")
local utils = require("ow.utils")
return {
enable = true,
@@ -1,4 +1,4 @@
local utils = require("utils")
local utils = require("ow.utils")
local ERROR = vim.diagnostic.severity.ERROR
local WARN = vim.diagnostic.severity.WARN
@@ -1,7 +1,5 @@
-- spec: https://github.com/eclipse/lemminx/blob/main/docs/Configuration.md
local utils = require("utils")
return {
enable = true,
mason = {
@@ -1,5 +1,5 @@
-- spec: https://luals.github.io/wiki/settings/
local utils = require("utils")
local utils = require("ow.utils")
---@type ServerConfig
return {
+1 -1
View File
@@ -1,7 +1,7 @@
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local utils = require("utils")
local utils = require("ow.utils")
---@class Keymap
---@field mode string|string[]
+1 -1
View File
@@ -1,4 +1,4 @@
local utils = require("utils")
local utils = require("ow.utils")
---@class Linter
---@field name string
@@ -1,4 +1,4 @@
local utils = require("utils")
local utils = require("ow.utils")
---@class PostInstallStep
---@field cmd string[]
+4 -4
View File
@@ -1,11 +1,11 @@
local keymap = require("lsp.keymap")
local utils = require("utils")
local keymap = require("ow.lsp.keymap")
local utils = require("ow.utils")
---@class Linter
local Linter = require("lsp.linter")
local Linter = require("ow.lsp.linter")
---@class MasonPackage
local MasonPackage = require("lsp.package")
local MasonPackage = require("ow.lsp.package")
---@class Server
---@field name? string
@@ -37,7 +37,11 @@ return {
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
build = (require("utils").os_name ~= "Windows_NT" and "make install_jsregexp" or nil),
build = (
require("ow.utils").os_name ~= "Windows_NT"
and "make install_jsregexp"
or nil
),
version = "2.*",
dependencies = { "rafamadriz/friendly-snippets" },
},
@@ -45,7 +49,7 @@ return {
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local utils = require("utils")
local utils = require("ow.utils")
local lspkind = utils.try_require("lspkind")
---@type cmp.ConfigSchema
@@ -53,7 +57,7 @@ return {
-- enabled = function()
-- return has_words_before()
-- end,
preselect = 'None',
preselect = "None",
completion = {
autocomplete = { "InsertEnter", "TextChanged" },
keyword_length = 1,
View File