From fc046bbd97841d53381f86b985ff65070922e388 Mon Sep 17 00:00:00 2001 From: Edward Park Date: Fri, 14 Nov 2025 12:52:37 -0500 Subject: [PATCH] Re-auth on failure, pin language server for specific portals --- .github/workflows/build-extension.yml | 2 +- CodeiumVS/LanguageServer/LanguageServer.cs | 27 +++++++++++++++++----- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-extension.yml b/.github/workflows/build-extension.yml index 284368e..7320582 100644 --- a/.github/workflows/build-extension.yml +++ b/.github/workflows/build-extension.yml @@ -36,7 +36,7 @@ jobs: - name: Set Release Condition id: check_release run: | - $isRelease = "${{ github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/enterprise-release-v') && (github.actor == 'saranshsaini' || github.actor == 'fortenforge') }}" + $isRelease = "${{ github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/enterprise-release-v') && (github.actor == 'edwardpark97' || github.actor == 'saranshsaini' || github.actor == 'fortenforge') }}" echo "IS_RELEASE=$isRelease" | Out-File -FilePath $env:GITHUB_ENV -Append if ($isRelease -eq 'true') { $tag = "${{ github.ref_name }}" diff --git a/CodeiumVS/LanguageServer/LanguageServer.cs b/CodeiumVS/LanguageServer/LanguageServer.cs index 9dc7863..ff24e3e 100644 --- a/CodeiumVS/LanguageServer/LanguageServer.cs +++ b/CodeiumVS/LanguageServer/LanguageServer.cs @@ -232,6 +232,11 @@ private async Task GetLanguageServerInfoAsync() { _languageServerVersion = version; } + // Only pin to 1.50.100 for specific portal URLs + if (portalUrl.Contains(".windsurf.com") || portalUrl.Contains("dstart.com")) + { + _languageServerVersion = "1.50.100"; + } } catch (Exception) { @@ -725,8 +730,18 @@ private void LSP_OnPipeDataReceived(object sender, DataReceivedEventArgs e) return JsonConvert.DeserializeObject(await rq.Content.ReadAsStringAsync()); } - await _package.LogAsync( - $"Error: Failed to send request to {url}, status code: {rq.StatusCode}"); + // If auth failed, sign out and show login prompt + if (rq.StatusCode == HttpStatusCode.Forbidden || + rq.StatusCode == HttpStatusCode.Unauthorized) + { + await _package.LogAsync("Session expired - please sign in again"); + await SignOutAsync(); + } + else + { + await _package.LogAsync( + $"Error: Failed to send request to {url}, status code: {rq.StatusCode}"); + } } catch (OperationCanceledException) { @@ -881,7 +896,7 @@ async Task AddFilesToIndexLists(EnvDTE.Project project) remainingToFind -= 1; remainingProjectsToIndexPath.Add(dir); } - + processedProjects.Add(project.Name); } @@ -908,7 +923,7 @@ async Task AddFilesToIndexLists(EnvDTE.Project project) { await AddFilesToIndexLists(project); } - catch (Exception ex) + catch (Exception ex) { await _package.LogAsync($"Failed to process open project: {ex.Message}"); continue; @@ -924,12 +939,12 @@ async Task AddFilesToIndexLists(EnvDTE.Project project) { await AddFilesToIndexLists(project); } - catch (Exception ex) + catch (Exception ex) { await _package.LogAsync($"Failed to process remaining project: {ex.Message}"); continue; } - if (remainingToFind <=0) + if (remainingToFind <= 0) { break; }