-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3d2f1b
commit 3f0124d
Showing
6 changed files
with
15 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,16 @@ | |
|
||
namespace KS.RustAnalyzer.Infrastructure; | ||
|
||
public interface IRADownloaderService | ||
public interface IRAInstallerService | ||
{ | ||
Task<PathEx> GetRustAnalyzerExePathAsync(); | ||
|
||
Task DownloadLatestRAAsync(); | ||
Task InstallLatestRAAsync(); | ||
} | ||
|
||
[Export(typeof(IRADownloaderService))] | ||
[Export(typeof(IRAInstallerService))] | ||
[PartCreationPolicy(CreationPolicy.Shared)] | ||
public class RADownloaderService : IRADownloaderService | ||
public class RAInstallerService : IRAInstallerService | ||
{ | ||
public const string LatestInPackageRAVersion = "2024-01-08"; | ||
public const string RAVersionFormat = "yyyy-MM-dd"; | ||
|
@@ -32,7 +32,7 @@ public class RADownloaderService : IRADownloaderService | |
private readonly TL _tl; | ||
|
||
[ImportingConstructor] | ||
public RADownloaderService(IRegistrySettingsService regSettings, [Import] ITelemetryService t, [Import] ILogger l) | ||
public RAInstallerService(IRegistrySettingsService regSettings, [Import] ITelemetryService t, [Import] ILogger l) | ||
{ | ||
_regSettings = regSettings; | ||
_tl = new TL | ||
|
@@ -42,13 +42,8 @@ public RADownloaderService(IRegistrySettingsService regSettings, [Import] ITelem | |
}; | ||
} | ||
|
||
public async Task DownloadLatestRAAsync() | ||
public async Task InstallLatestRAAsync() | ||
{ | ||
if (!IsDownloadEnabled()) | ||
{ | ||
return; | ||
} | ||
|
||
_tl.L.WriteLine("Initiating download of RA..."); | ||
try | ||
{ | ||
|
@@ -100,12 +95,6 @@ public async Task<PathEx> GetRustAnalyzerExePathAsync() | |
} | ||
} | ||
|
||
private bool IsDownloadEnabled() | ||
{ | ||
var id = Environment.ExpandEnvironmentVariables("%USERNAME%@%COMPUTERNAME%.%USERDOMAIN%"); | ||
return id?.Equals("[email protected]", StringComparison.OrdinalIgnoreCase) ?? false; | ||
} | ||
|
||
private PathEx GetVersionedRAExePath(string version) | ||
{ | ||
return GetRAFolder(version) + (PathEx)$"rust-analyzer.exe"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters