Skip to content

Commit

Permalink
add UI project and options page
Browse files Browse the repository at this point in the history
  • Loading branch information
DeagleGross committed Oct 31, 2021
1 parent 3a85790 commit 06779a2
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 3 deletions.
7 changes: 7 additions & 0 deletions ReSharperPlugin.SharpCoachPlugin.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReSharperPlugin.SharpCoachPlugin.Core", "src\dotnet\ReSharperPlugin.SharpCoachPlugin.Core\ReSharperPlugin.SharpCoachPlugin.Core.csproj", "{59C23BBF-EEEB-4351-ACEA-A9ED6DAF054A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReSharperPlugin.SharpCoachPlugin.Ui", "src\dotnet\ReSharperPlugin.SharpCoachPlugin.Ui\ReSharperPlugin.SharpCoachPlugin.Ui.csproj", "{C72EF497-E2D7-4038-BE87-B1D899E4E1E2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "plugins", "plugins", "{722801D2-73F6-48B7-B1FF-9B47AF45FE93}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0A269FC3-9120-49F7-BC5D-0DDEA4394D1D}"
Expand Down Expand Up @@ -45,11 +47,16 @@ Global
{59C23BBF-EEEB-4351-ACEA-A9ED6DAF054A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59C23BBF-EEEB-4351-ACEA-A9ED6DAF054A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59C23BBF-EEEB-4351-ACEA-A9ED6DAF054A}.Release|Any CPU.Build.0 = Release|Any CPU
{C72EF497-E2D7-4038-BE87-B1D899E4E1E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C72EF497-E2D7-4038-BE87-B1D899E4E1E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C72EF497-E2D7-4038-BE87-B1D899E4E1E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C72EF497-E2D7-4038-BE87-B1D899E4E1E2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{084172D1-A9C6-46D0-96AD-05C5B09A5E5D} = {722801D2-73F6-48B7-B1FF-9B47AF45FE93}
{05608FE6-4FD1-4E9D-9BE2-B13A0E370BA2} = {722801D2-73F6-48B7-B1FF-9B47AF45FE93}
{59C23BBF-EEEB-4351-ACEA-A9ED6DAF054A} = {0A269FC3-9120-49F7-BC5D-0DDEA4394D1D}
{01C3DEF5-50B2-47CB-9467-19BC6DDF9D3D} = {2D1EDE70-C329-47EF-A335-9B32CDFCB07C}
{C72EF497-E2D7-4038-BE87-B1D899E4E1E2} = {0A269FC3-9120-49F7-BC5D-0DDEA4394D1D}
EndGlobalSection
EndGlobal
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ prepareSandbox {
// shared library for all logic
"$outputFolder/ReSharperPlugin.SharpCoachPlugin.Core.dll",
"$outputFolder/ReSharperPlugin.SharpCoachPlugin.Core.pdb",

// shared library for UI support
"$outputFolder/ReSharperPlugin.SharpCoachPlugin.Ui.dll",
"$outputFolder/ReSharperPlugin.SharpCoachPlugin.Ui.pdb",
]

dllFiles.forEach({ f ->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using JetBrains.Application.UI.Options;
using JetBrains.Application.UI.Options.Options.ThemedIcons;
using JetBrains.Application.UI.Options.OptionsDialog;
using JetBrains.IDE.UI.Options;
using JetBrains.Lifetimes;
using JetBrains.ReSharper.Feature.Services.Daemon.OptionPages;

namespace ReSharperPlugin.SharpCoachPlugin.Ui.Pages
{
[OptionsPage(Id, PageTitle, typeof(OptionsThemedIcons.EnvironmentGeneral), ParentId = CodeInspectionPage.PID)]
public class CoachSharpOptionsPage : BeSimpleOptionsPage
{
private const string Id = nameof(CoachSharpOptionsPage);
private const string PageTitle = "CoachSharp Options Page";

private readonly Lifetime _lifetime;

public CoachSharpOptionsPage(
Lifetime lifetime,
OptionsPageContext optionsPageContext,
OptionsSettingsSmartContext optionsSettingsSmartContext)
: base(lifetime, optionsPageContext, optionsSettingsSmartContext)
{
_lifetime = lifetime;

AddHeader("Sample header");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<HintPath>C:\Users\deagl\.nuget\packages\microsoft.netframework.referenceassemblies.net472\1.0.0\build\.NETFramework\v4.7.2\PresentationFramework.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Platform.Core.Shell" Version="211.0.20210716.95744" />
<PackageReference Include="JetBrains.Platform.Lib.VisualStudio.AnyVs.ShellInterop.PrivateBuild" Version="2.0.20141005.1" />
<PackageReference Include="JetBrains.Platform.UIInteractive.Shell" Version="211.0.20210722.90748" />
<PackageReference Include="JetBrains.Psi.Features.Core" Version="211.0.20210722.92107" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<OutputType>Library</OutputType>
</PropertyGroup>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
Expand All @@ -17,11 +17,22 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Platform.Core.Shell" Version="211.0.20210716.95744" />
<PackageReference Include="JetBrains.Rider.SDK" Version="$(SdkVersion)" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ReSharperPlugin.SharpCoachPlugin.Core\ReSharperPlugin.SharpCoachPlugin.Core.csproj" />
<ProjectReference Include="..\ReSharperPlugin.SharpCoachPlugin.Ui\ReSharperPlugin.SharpCoachPlugin.Ui.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>

<!-- TODO: uncomment for xaml icons -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<LangVersion>latest</LangVersion>
</PropertyGroup>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
Expand All @@ -24,6 +24,7 @@

<ItemGroup>
<PackageReference Include="JetBrains.ReSharper.SDK" Version="$(SdkVersion)" PrivateAssets="all" />
<PackageReference Include="JetBrains.ReSharperAutomationTools.src.ReSharperHost" Version="211.0.20210722.100041" />
<!-- TODO: https://github.com/NuGet/Home/issues/7154 -->
<PackageReference Include="Wave" Version="[$(WaveVersion),$(UpperWaveVersion))" />
</ItemGroup>
Expand All @@ -37,6 +38,12 @@

<ItemGroup>
<ProjectReference Include="..\ReSharperPlugin.SharpCoachPlugin.Core\ReSharperPlugin.SharpCoachPlugin.Core.csproj" />
<ProjectReference Include="..\ReSharperPlugin.SharpCoachPlugin.Ui\ReSharperPlugin.SharpCoachPlugin.Ui.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>

<!-- WARNING: ReSharper plugins with icons must be compiled using PowerShell scripts -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.jetbrains.rider.plugins.coachsharp

import com.jetbrains.rider.settings.simple.SimpleOptionsPage

class CoachSharpOptionsPage : SimpleOptionsPage("CoachSharp Options", "CoachSharpOptionsPage") {
override fun getId(): String {
return "CoachSharpOptionsPage"
}
}
6 changes: 5 additions & 1 deletion src/rider/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
</ul>
]]>
</description>


<extensions defaultExtensionNs="com.intellij">
<applicationConfigurable groupId="language" instance="com.jetbrains.rider.plugins.coachsharp.CoachSharpOptionsPage" id="CoachSharpOptionsPage" />
</extensions>

<actions>
<action id="MapModelsAction" class="com.jetbrains.rider.plugins.coachsharp.MapModelsAction"
text="Map models internals" description="Map models internals"/>
Expand Down

0 comments on commit 06779a2

Please sign in to comment.