-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathSampleFrontendTestedAction.cs
30 lines (27 loc) · 1.06 KB
/
SampleFrontendTestedAction.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using JetBrains.Application.DataContext;
using JetBrains.Application.UI.Actions;
using JetBrains.Application.UI.ActionsRevised.Menu;
using JetBrains.ProjectModel.DataContext;
using JetBrains.ReSharper.Features.Internal.Resources;
using JetBrains.Util;
namespace ReSharperPlugin.Actions;
[Action(
ResourceType: typeof(Resources),
TextResourceName: nameof(Resources.SampleFrontendTestedActionText),
// Icon must also be changed in frontend code
Icon = typeof(FeaturesInternalThemedIcons.QuickStartToolWindow),
IdeaShortcuts = new[] { "Shift+Control+T" },
VsShortcuts = new[] { "Shift+Control+T" })]
public class SampleFrontendTestedAction : IExecutableAction
{
public bool Update(IDataContext context, ActionPresentation presentation, DelegateUpdate nextUpdate)
{
return true;
}
public void Execute(IDataContext context, DelegateExecute nextExecute)
{
var solution = context.GetData(ProjectModelDataConstants.SOLUTION)!;
var file = solution.SolutionDirectory / "file.txt";
file.WriteAllText("Hello");
}
}