Skip to content

Commit 226e1ae

Browse files
committed
#6 - fmt + clippy integration
- update version & release notes - remove rating dialog & integrate with release notes
1 parent 9270f25 commit 226e1ae

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed

src/RustAnalyzer.TestAdapter/Constants.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ namespace KS.RustAnalyzer.TestAdapter;
55

66
public static class Constants
77
{
8-
public const string ReleaseSummary = $"Significant refactoring of the {ManifestFileName} parser module resulting in simpler code & robust handling of various crates and workspaces scenarios. Please report any issues you face.";
8+
public const string ReleaseSummary = $"Right click on {ManifestFileName} to run clippy / fmt, use Tools > Options to change defaults. Please report any issues you face. Consider giving 5⭐ if you find this extension useful.";
99
public const string ReleaseNotesUrl = $"https://github.com/kitamstudios/rust-analyzer.vs/releases/{Vsix.Version}";
1010
public const string DiscordUrl = "https://discord.gg/JyK55EsACr";
1111
public const string PrerequisitesUrl = "https://github.com/kitamstudios/rust-analyzer.vs/blob/master/PREREQUISITES.md";
12+
public const string RateExtensionUrl = "https://marketplace.visualstudio.com/items?itemName=kitamstudios.RustAnalyzer&ssr=false#review-details";
1213

1314
public const string RustLanguageContentType = "rust";
1415
public const string RustFileExtension = ".rs";

src/RustAnalyzer/Infrastructure/Options.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class GeneralOptions : BaseOptionPage<Options>
1212
}
1313
}
1414

15-
public class Options : BaseOptionModel<Options>, IRatingConfig
15+
public class Options : BaseOptionModel<Options>
1616
{
1717
[DisplayName("Default Clippy Arguments")]
1818
[Description("Command line arguments passed to cargo clippy. Default is: --all-targets --all-features -- -D warnings")]
@@ -21,7 +21,4 @@ public class Options : BaseOptionModel<Options>, IRatingConfig
2121
[DisplayName("Default Cargo Arguments")]
2222
[Description("Command line arguments passed to cargo fmt. Default is: --all")]
2323
public string DefailtCargoFmtArgs { get; set; } = "--all";
24-
25-
[Browsable(false)]
26-
public int RatingRequests { get; set; }
2724
}

src/RustAnalyzer/RustAnalyzer.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
</ItemGroup>
137137
<ItemGroup>
138138
<PackageReference Include="Community.VisualStudio.VSCT" Version="16.0.29.6" PrivateAssets="all" />
139-
<PackageReference Include="Community.VisualStudio.Toolkit.17" Version="17.0.492" ExcludeAssets="Runtime" />
139+
<PackageReference Include="Community.VisualStudio.Toolkit.17" Version="17.0.430" ExcludeAssets="Runtime" />
140140
<PackageReference Include="Microsoft.ApplicationInsights">
141141
<Version>2.21.0</Version>
142142
</PackageReference>
@@ -146,7 +146,7 @@
146146
<PackageReference Include="Microsoft.VisualStudio.TestWindow.Interfaces">
147147
<Version>11.0.61030</Version>
148148
</PackageReference>
149-
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.5.4065" />
149+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.0.5232" />
150150
</ItemGroup>
151151
<ItemGroup>
152152
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.4.33103.184" ExcludeAssets="runtime">
@@ -174,6 +174,10 @@
174174
<Version>17.1.11-preview-0002</Version>
175175
<NoWarn>NU1603</NoWarn>
176176
</PackageReference>
177+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.1.4057">
178+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
179+
<PrivateAssets>all</PrivateAssets>
180+
</PackageReference>
177181
</ItemGroup>
178182
<ItemGroup>
179183
<ProjectReference Include="..\RustAnalyzer.TestAdapter\RustAnalyzer.TestAdapter.csproj">

src/RustAnalyzer/RustAnalyzerPackage.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,13 @@ public sealed class RustAnalyzerPackage : ToolkitPackage
3838
{
3939
private TL _tl;
4040
private IPreReqsCheckService _preReqs;
41-
private RatingPrompt _ratingPrompt;
4241

4342
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
4443
{
4544
await this.RegisterCommandsAsync();
4645

4746
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
4847

49-
_ratingPrompt = new RatingPrompt("kitamstudios.RustAnalyzer", Vsix.Name, Options.Instance);
50-
5148
var cmServiceProvider = (IComponentModel)await GetServiceAsync(typeof(SComponentModel));
5249
_tl = new TL
5350
{
@@ -66,8 +63,6 @@ protected override async Task OnAfterPackageLoadedAsync(CancellationToken cancel
6663
await ReleaseSummaryNotification.ShowAsync(this, _tl);
6764
await SearchAndDisableIncompatibleExtensionsAsync();
6865
await _preReqs.SatisfyAsync();
69-
70-
_ratingPrompt.RegisterSuccessfulUsage();
7166
}
7267

7368
#region Handling incompatible extensions
@@ -151,6 +146,7 @@ public static class ReleaseSummaryNotification
151146
private const string ActionContextReleaseNotes = "release_notes";
152147
private const string ActionContextDismiss = "dismiss";
153148
private const string ActionContextGetHelp = "get_help";
149+
private const string ActionContextRateExtension = "rate_extension";
154150
private const string DismissedRegKeyName = "release_notes_dismissed";
155151

156152
public static async Task ShowAsync(IServiceProvider sp, TL tl)
@@ -166,7 +162,7 @@ public static async Task ShowAsync(IServiceProvider sp, TL tl)
166162

167163
var actionItems = new[]
168164
{
169-
new InfoBarHyperlink("Release notes", ActionContextReleaseNotes),
165+
new InfoBarHyperlink("Rate Extension", ActionContextRateExtension),
170166
new InfoBarHyperlink("Get help!", ActionContextGetHelp),
171167
new InfoBarHyperlink("Dismiss", ActionContextDismiss),
172168
};
@@ -191,8 +187,8 @@ private static void InfoBar_ActionItemClicked(object sender, InfoBarActionItemEv
191187

192188
switch (actionContext)
193189
{
194-
case ActionContextReleaseNotes:
195-
VsShellUtilities.OpenSystemBrowser(Constants.ReleaseNotesUrl);
190+
case ActionContextRateExtension:
191+
VsShellUtilities.OpenSystemBrowser(Constants.RateExtensionUrl);
196192
break;
197193

198194
case ActionContextGetHelp:

src/RustAnalyzer/source.extension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal sealed partial class Vsix
1111
public const string Name = "rust-analyzer.vs";
1212
public const string Description = @"Rust language support for Visual Studio";
1313
public const string Language = "en-US";
14-
public const string Version = "1.6";
14+
public const string Version = "1.7";
1515
public const string Author = "Kitam Studios";
1616
public const string Tags = "Rust;Cargo;RustAnalyzer";
1717
}

src/RustAnalyzer/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011"
44
xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
55
<Metadata>
6-
<Identity Id="KS.RustAnalyzer.3a91e56b-fb28-4d85-b572-ec964abf8e31" Version="1.6" Language="en-US" Publisher="Kitam Studios" />
6+
<Identity Id="KS.RustAnalyzer.3a91e56b-fb28-4d85-b572-ec964abf8e31" Version="1.7" Language="en-US" Publisher="Kitam Studios" />
77
<DisplayName>rust-analyzer.vs</DisplayName>
88
<Description xml:space="preserve">Rust language support for Visual Studio</Description>
99
<MoreInfo>https://github.com/kitamstudios/rust-analyzer.vs</MoreInfo>

0 commit comments

Comments
 (0)