aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAboobacker MK <aboobackervyd@gmail.com>2025-12-04 22:00:27 +0530
committerGitHub <noreply@github.com>2025-12-04 11:30:27 -0500
commite66a1185eedad94f30019a07d749059ec9049745 (patch)
treef896894a5050b5d1bb0e96a8567b547076ede3e8
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-e66a1185eedad94f30019a07d749059ec9049745.tar
nvim-lspconfig-e66a1185eedad94f30019a07d749059ec9049745.tar.gz
nvim-lspconfig-e66a1185eedad94f30019a07d749059ec9049745.tar.bz2
nvim-lspconfig-e66a1185eedad94f30019a07d749059ec9049745.tar.lz
nvim-lspconfig-e66a1185eedad94f30019a07d749059ec9049745.tar.xz
nvim-lspconfig-e66a1185eedad94f30019a07d749059ec9049745.tar.zst
nvim-lspconfig-e66a1185eedad94f30019a07d749059ec9049745.zip
fix(gitlab_duo): token update on init #4226
Problem: LSP was not getting updated LSP on initialization when the token is fetched from persistent storage Solution: Added `workspace/didChangeConfiguration` after token validation
-rw-r--r--lsp/gitlab_duo.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/lsp/gitlab_duo.lua b/lsp/gitlab_duo.lua
index 1b6f0762..08439f6f 100644
--- a/lsp/gitlab_duo.lua
+++ b/lsp/gitlab_duo.lua
@@ -393,7 +393,7 @@ return {
local new_token_data = refresh_access_token(token_data.refresh_token)
if new_token_data then
client:notify('workspace/didChangeConfiguration', {
- settings = { token = new_token_data.access_token },
+ settings = { token = new_token_data.access_token, baseUrl = config.gitlab_url },
})
else
vim.notify('Run :LspGitLabDuoSignIn to re-authenticate', vim.log.levels.WARN)
@@ -416,6 +416,16 @@ return {
-- Check authentication status
local token, status = get_valid_token()
+
+ if token then
+ client:notify('workspace/didChangeConfiguration', {
+ settings = {
+ token = token,
+ baseUrl = config.gitlab_url,
+ },
+ })
+ end
+
if not token then
vim.notify('GitLab Duo: Not authenticated. Run :LspGitLabDuoSignIn to sign in.', vim.log.levels.WARN)
elseif status == 'refreshed' then