From e66a1185eedad94f30019a07d749059ec9049745 Mon Sep 17 00:00:00 2001 From: Aboobacker MK Date: Thu, 4 Dec 2025 22:00:27 +0530 Subject: 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 --- lsp/gitlab_duo.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-70-g09d2