diff --git a/CodeiumVS/LanguageServer/LanguageServer.cs b/CodeiumVS/LanguageServer/LanguageServer.cs index a105a2c..afa2dec 100644 --- a/CodeiumVS/LanguageServer/LanguageServer.cs +++ b/CodeiumVS/LanguageServer/LanguageServer.cs @@ -3,6 +3,7 @@ using Microsoft.VisualStudio.Imaging; using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.Threading; +using Microsoft.Win32; using Newtonsoft.Json; using System.Collections.Generic; using System.ComponentModel; @@ -200,7 +201,8 @@ public async Task SignOutAsync() /// private async Task GetLanguageServerInfoAsync() { - string extensionBaseUrl = "https://github.com/Exafunction/codeium/releases/download"; + string extensionBaseUrl = (_package.SettingsPage.ExtensionBaseUrl.Equals("") ? "https://github.com/Exafunction/codeium/releases/download" + : _package.SettingsPage.ExtensionBaseUrl); if (_package.SettingsPage.EnterpriseMode) { @@ -393,7 +395,7 @@ public async Task PrepareAsync() } await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); - await _package.LogAsync($"Downloading language server v{_languageServerVersion}"); + await _package.LogAsync($"Downloading language server v{_languageServerVersion} from {_languageServerURL}"); // show the downloading progress dialog before starting the thread to make it feels more // responsive diff --git a/CodeiumVS/SettingsPage.cs b/CodeiumVS/SettingsPage.cs index a9b4fdf..8046d01 100644 --- a/CodeiumVS/SettingsPage.cs +++ b/CodeiumVS/SettingsPage.cs @@ -9,6 +9,7 @@ public class SettingsPage : DialogPage private bool enterpriseMode; private string portalUrl = ""; private string apiUrl = ""; + private string extensionBaseUrl = "https://github.com/Exafunction/codeium/releases/download"; private bool enableCommentCompletion = true; private bool enableLanguageServerProxy = false; @@ -39,6 +40,21 @@ public string PortalUrl } } + [Category("Codeium")] + [DisplayName("Extension Base Url")] + [Description("URL of the Codeium Extension Base.")] + public string ExtensionBaseUrl + { + get + { + return extensionBaseUrl; + } + set + { + extensionBaseUrl = value; + } + } + [Category("Codeium")] [DisplayName("API Url")] [Description("API Url for Codeium Enterprise. Requires restart.")]