Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ExtensionBaseUrl configurable. #39

Merged
merged 3 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CodeiumVS/LanguageServer/LanguageServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -200,7 +201,8 @@ public async Task SignOutAsync()
/// <returns></returns>
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.Trim().TrimEnd('/'));

if (_package.SettingsPage.EnterpriseMode)
{
Expand Down Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions CodeiumVS/SettingsPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -39,6 +40,22 @@ public string PortalUrl
}
}

[Category("Codeium")]
[DisplayName("Language Server Download URL")]
[Description(
"If you're experiencing network issues with GitHub and can't download the language server, please change this to a GitHub Mirror URL instead. For example: https://gh.api.99988866.xyz/https://github.com/Exafunction/codeium/releases/download")]
public string ExtensionBaseUrl
{
get
{
return extensionBaseUrl;
}
set
{
extensionBaseUrl = value;
}
}

[Category("Codeium")]
[DisplayName("API Url")]
[Description("API Url for Codeium Enterprise. Requires restart.")]
Expand Down
Loading