Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
linrongbin16 committed Sep 28, 2023
1 parent 6f8cbe8 commit fd31fdc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# lsp-progress.nvim

<p align="center">
<a href="https://github.com/neovim/neovim/releases/stable"><img alt="Neovim-v0.5" src="https://img.shields.io/badge/Neovim-v0.5-blueviolet.svg?logo=Neovim&logoColor=green" /></a>
<a href="https://github.com/neovim/neovim/releases/v0.6.0"><img alt="Neovim-v0.6.0" src="https://img.shields.io/badge/Neovim-v0.6.0-blueviolet.svg?logo=Neovim&logoColor=green" /></a>
<a href="https://github.com/linrongbin16/lsp-progress.nvim/search?l=lua"><img alt="Top Language" src="https://img.shields.io/github/languages/top/linrongbin16/lsp-progress.nvim?label=Lua&logo=lua&logoColor=darkblue" /></a>
<a href="https://github.com/linrongbin16/lsp-progress.nvim/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/linrongbin16/lsp-progress.nvim?logo=GNU&label=License" /></a>
<a href="https://github.com/linrongbin16/lsp-progress.nvim/actions/workflows/ci.yml"><img alt="ci.yml" src="https://img.shields.io/github/actions/workflow/status/linrongbin16/lsp-progress.nvim/ci.yml?logo=GitHub&label=Luacheck" /></a>
<a href="https://github.com/linrongbin16/lsp-progress.nvim/actions/workflows/ci.yml"><img alt="ci.yml" src="https://img.shields.io/github/actions/workflow/status/linrongbin16/lsp-progress.nvim/ci.yml?logo=GitHub&label=CI" /></a>
</p>

A performant lsp progress status for Neovim.
Expand Down
34 changes: 17 additions & 17 deletions lua/lsp-progress.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local new_client = require("lsp-progress.client").new_client
-- global variable

--- @type table<string, any>
local Config = {}
local Configs = {}
--- @type boolean
local Registered = false
--- @type table<integer, ClientObject>
Expand Down Expand Up @@ -84,7 +84,7 @@ local function spin(client_id, token)
end

client:increase_spin_index()
vim.defer_fn(spin_again, Config.spin_update_time)
vim.defer_fn(spin_again, Configs.spin_update_time)

local series = client:get_series(token)
-- if series done, remove this series from client later
Expand Down Expand Up @@ -125,7 +125,7 @@ local function spin(client_id, token)
)
end
event.emit()
end, Config.decay)
end, Configs.decay)
logger.debug(
"|lsp-progress.spin| Token %s is done in client %s, remove series later...",
token,
Expand All @@ -151,7 +151,7 @@ local function spin(client_id, token)
client_id
)
event.emit()
end, Config.decay)
end, Configs.decay)
logger.debug(
"|lsp-progress.spin| Client id %d is stopped, remove it later...",
client_id
Expand Down Expand Up @@ -239,7 +239,7 @@ end
--- @param option table<string, any>
--- @return string|nil
local function progress(option)
option = vim.tbl_deep_extend("force", vim.deepcopy(Config), option or {})
option = vim.tbl_deep_extend("force", vim.deepcopy(Configs), option or {})

local active_clients_count = #vim.lsp.get_active_clients()
if active_clients_count <= 0 then
Expand Down Expand Up @@ -279,29 +279,29 @@ end
--- @return nil
local function setup(option)
-- setup config
Config = defaults.setup(option)
Configs = defaults.setup(option)

-- setup logger
logger.setup(
Config.debug,
Config.console_log,
Config.file_log,
Config.file_log_name
Configs.debug,
Configs.console_log,
Configs.file_log,
Configs.file_log_name
)

-- setup event
event.setup(
Config.event,
Config.event_update_time_limit,
Config.regular_internal_update_time,
Config.disable_events_opts
Configs.event,
Configs.event_update_time_limit,
Configs.regular_internal_update_time,
Configs.disable_events_opts
)

-- setup series
require("lsp-progress.series").setup(Config.series_format)
require("lsp-progress.series").setup(Configs.series_format)

-- init client
require("lsp-progress.client").setup(Config.client_format, Config.spinner)
require("lsp-progress.client").setup(Configs.client_format, Configs.spinner)

if not Registered then
if vim.lsp.handlers["$/progress"] then
Expand All @@ -323,4 +323,4 @@ local M = {
progress = progress,
}

return M
return M
2 changes: 1 addition & 1 deletion lua/lsp-progress/logger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ local function log(level, msg)
return
end

local msg_lines = vim.fn.split(msg, "\n")
local msg_lines = vim.split(msg, "\n", { plain = true })
if Configs.use_console and level >= LogLevels.INFO then
local msg_chunks = {}
for _, line in ipairs(msg_lines) do
Expand Down

0 comments on commit fd31fdc

Please sign in to comment.