Skip to content

Commit

Permalink
fix: LSP get clients for 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
barreiroleo committed Apr 26, 2024
1 parent 100be76 commit 1515eeb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
include:
- os: ubuntu-22.04
rev: nightly/nvim-linux64.tar.gz
# - os: ubuntu-22.04
# rev: v0.9.0/nvim-linux64.tar.gz
- os: ubuntu-22.04
rev: v0.9.0/nvim-linux64.tar.gz
steps:
- uses: actions/checkout@v3
- run: date +%F > todays-date
Expand Down
9 changes: 8 additions & 1 deletion lua/ltex_extra/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,16 @@ function LtexExtra:ResolvePendingTasks()
end
end

---TODO: Remove get_active_clients when 0.10 is released
---@return vim.lsp.Client|nil client Ltex client if found
function LtexExtra:GetLtexClient()
local ltex_client = vim.lsp.get_clients({ name = 'ltex' })[1]
local ltex_client = nil
if vim.lsp.get_clients then
ltex_client = vim.lsp.get_clients({ name = 'ltex' })[1]
else
ltex_client = vim.lsp.get_active_clients({ name = 'ltex' })[1]
end

if ltex_client then
LoggerBuilder.log.debug("Ltex client found at client id " .. ltex_client.id)
else
Expand Down

0 comments on commit 1515eeb

Please sign in to comment.