使用在https://github.com/JetBrains/resharper-rider-plugin.
[Action("ActionShowMessageBox", "Show message box", Id = 5432144)]
public class ActionShowMessageBox : IExecutableAction, IInsertLast<ToolsMenu>{
public bool Update(IDataContext context, ActionPresentation presentation, DelegateUpdate nextUpdate) => true;
public void Execute(IDataContext context, DelegateExecute nextExecute){
var solution = context.GetData(JetBrains.ProjectModel.DataContext.ProjectModelDataConstants.SOLUTION);
MessageBox.ShowInfo(solution?.SolutionFile != null
? $"{solution.SolutionFile?.Name} solution is opened"
: "No solution is opened");
}
}F5来调试,打开一个项目,然后使用Ctrl+Shift+A搜索我的操作。我的操作不在那里列出,也没有按照declaration.在ToolsMenu中显示。

发布于 2021-09-16 07:39:46
实际上,构建Rider插件要比我尝试的简单尝试要复杂一些,并且需要修改更多的文件。我的解决方案是使用下一个片段,它安装一个可以运行示例并在那里进行探索的就绪程序。
最初,我使用并手动添加了该操作。
dotnet new resharper-rider-plugin --name Xpand 但相反我可以用
dotnet new resharper-rider-plugin --name Xpand --include-samples然后播放预装操作、plugin.xml和kotlin文件,它们都在其中扮演角色。
https://stackoverflow.com/questions/69195339
复制相似问题