├── MyAwesomePlugin ├── dependencies.json ├── tools │ ├── nuget.exe │ └── vswhere.exe ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── CHANGELOG.md ├── .gitattributes ├── .gitignore ├── src │ ├── dotnet │ │ ├── ReSharperPlugin.MyAwesomePlugin │ │ │ ├── LiveTemplates │ │ │ │ ├── ZoneMarker.cs │ │ │ │ ├── ETLiveTemplatesOptionsPage.cs │ │ │ │ └── ETFileTemplatesOptionsPage.cs │ │ │ ├── IMyAwesomePluginZone.cs │ │ │ ├── Scope │ │ │ │ ├── ETProjectScopeCategoryUIProvider.cs │ │ │ │ └── ETScopeCategoryUIProvider.cs │ │ │ ├── ETTemplatesDefaultSettings.cs │ │ │ ├── Strings.cs │ │ │ ├── ReSharperPlugin.MyAwesomePlugin.Rider.csproj │ │ │ ├── ReSharperPlugin.MyAwesomePlugin.csproj │ │ │ ├── Icons │ │ │ │ └── LogoIcons.cs │ │ │ ├── DiyMacroDef.cs │ │ │ └── Templates │ │ │ │ └── et7.DotSettings │ │ ├── Plugin.props │ │ ├── ReSharperPlugin.MyAwesomePlugin.Tests │ │ │ ├── test │ │ │ │ └── data │ │ │ │ │ └── nuget.config │ │ │ ├── ReSharperPlugin.MyAwesomePlugin.Tests.csproj │ │ │ └── TestEnvironment.cs │ │ └── Directory.Build.props │ └── rider │ │ └── main │ │ ├── kotlin │ │ └── com │ │ │ └── jetbrains │ │ │ └── rider │ │ │ └── plugins │ │ │ └── etplugin │ │ │ └── ETTemplatesOptionPage.kt │ │ └── resources │ │ ├── META-INF │ │ └── plugin.xml │ │ └── icons │ │ └── sdk_16.svg ├── protocol │ └── build.gradle ├── buildPlugin.ps1 ├── publishPlugin.ps1 ├── gradle.properties ├── settings.ps1 ├── settings.gradle ├── ReSharperPlugin.MyAwesomePlugin.sln ├── README.md ├── runVisualStudio.ps1 ├── gradlew.bat ├── build.gradle └── gradlew ├── gif ├── new.png ├── install.png ├── NewHandler.gif ├── NewMethod.gif ├── FileTemplete.png ├── LiveTemplete.png ├── NewComponent.gif ├── NewComponent2.gif └── installplugin.png ├── plugin └── corkiplugin-1.0.2.zip ├── plugin-2023 ├── ReSharperPlugin.MyAwesomePlugin-1.0.4.zip └── et8codetip.DotSettings ├── plugin-2022.2 ├── ReSharperPlugin.MyAwesomePlugin-1.0.4.zip └── ReSharperPlugin.MyAwesomePlugin-自动导入-1.0.4.zip ├── LICENSE └── README.md /MyAwesomePlugin/dependencies.json: -------------------------------------------------------------------------------- 1 | [ 2 | ] 3 | -------------------------------------------------------------------------------- /gif/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/gif/new.png -------------------------------------------------------------------------------- /gif/install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/gif/install.png -------------------------------------------------------------------------------- /gif/NewHandler.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/gif/NewHandler.gif -------------------------------------------------------------------------------- /gif/NewMethod.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/gif/NewMethod.gif -------------------------------------------------------------------------------- /gif/FileTemplete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/gif/FileTemplete.png -------------------------------------------------------------------------------- /gif/LiveTemplete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/gif/LiveTemplete.png -------------------------------------------------------------------------------- /gif/NewComponent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/gif/NewComponent.gif -------------------------------------------------------------------------------- /gif/NewComponent2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/gif/NewComponent2.gif -------------------------------------------------------------------------------- /gif/installplugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/gif/installplugin.png -------------------------------------------------------------------------------- /plugin/corkiplugin-1.0.2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/plugin/corkiplugin-1.0.2.zip -------------------------------------------------------------------------------- /MyAwesomePlugin/tools/nuget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/MyAwesomePlugin/tools/nuget.exe -------------------------------------------------------------------------------- /MyAwesomePlugin/tools/vswhere.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/MyAwesomePlugin/tools/vswhere.exe -------------------------------------------------------------------------------- /MyAwesomePlugin/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/MyAwesomePlugin/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /plugin-2023/ReSharperPlugin.MyAwesomePlugin-1.0.4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/plugin-2023/ReSharperPlugin.MyAwesomePlugin-1.0.4.zip -------------------------------------------------------------------------------- /plugin-2022.2/ReSharperPlugin.MyAwesomePlugin-1.0.4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/plugin-2022.2/ReSharperPlugin.MyAwesomePlugin-1.0.4.zip -------------------------------------------------------------------------------- /plugin-2022.2/ReSharperPlugin.MyAwesomePlugin-自动导入-1.0.4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosloop/ET-Rider/HEAD/plugin-2022.2/ReSharperPlugin.MyAwesomePlugin-自动导入-1.0.4.zip -------------------------------------------------------------------------------- /MyAwesomePlugin/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 支持rider 2022.3版本,[et7](https://github.com/egametang/ET)代码提示插件 3 | 4 | 具体详情可以看 [更新日志](https://github.com/sosloop/ET-Rider) 5 | 6 | -------------------------------------------------------------------------------- /MyAwesomePlugin/.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Preserve line endings in gradle scripts 5 | gradlew* -text diff 6 | -------------------------------------------------------------------------------- /MyAwesomePlugin/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://cache-redirector.jetbrains.com/services.gradle.org/distributions/gradle-7.6-all.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /MyAwesomePlugin/.gitignore: -------------------------------------------------------------------------------- 1 | # Build artifacts 2 | [Bb]in/ 3 | [Oo]bj/ 4 | build 5 | output 6 | .gradle 7 | .tmp 8 | 9 | # User-specific files 10 | *.suo 11 | *.user 12 | *.sln.docstates 13 | *.cache 14 | 15 | # IDEs 16 | /.idea/*.iml 17 | /.idea/*.xml 18 | /.idea/.idea.*/*.iml 19 | /.idea/.idea.*/.idea/*.xml 20 | .vs 21 | _ReSharper* 22 | _dotTrace* -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin/LiveTemplates/ZoneMarker.cs: -------------------------------------------------------------------------------- 1 | // using JetBrains.Application.BuildScript.Application.Zones; 2 | // using JetBrains.ReSharper.Feature.Services; 3 | // 4 | // namespace ReSharperPlugin.ETPlugin.LiveTemplates 5 | // { 6 | // [ZoneMarker] 7 | // public class ZoneMarker : IRequire 8 | // { 9 | // } 10 | // } -------------------------------------------------------------------------------- /MyAwesomePlugin/protocol/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | id 'org.jetbrains.kotlin.jvm' 4 | } 5 | 6 | dependencies { 7 | implementation "org.jetbrains.kotlin:kotlin-stdlib" 8 | implementation name: "rd-gen" 9 | implementation name: "rider-model" 10 | } 11 | 12 | repositories { 13 | mavenCentral() 14 | flatDir { 15 | dirs rdLibDirectory().absolutePath 16 | } 17 | } -------------------------------------------------------------------------------- /MyAwesomePlugin/buildPlugin.ps1: -------------------------------------------------------------------------------- 1 | Param( 2 | $Version = "9999.0.0" 3 | ) 4 | 5 | Set-StrictMode -Version Latest 6 | $ErrorActionPreference = "Stop" 7 | $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent 8 | Set-Location $PSScriptRoot 9 | 10 | . ".\settings.ps1" 11 | 12 | Invoke-Exe $MSBuildPath "/t:Restore;Rebuild;Pack" "$SolutionPath" "/v:minimal" "/p:PackageVersion=$Version" "/p:PackageOutputPath=`"$OutputDirectory`"" 13 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin/IMyAwesomePluginZone.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Application.BuildScript.Application.Zones; 2 | using JetBrains.ReSharper.Feature.Services.Daemon; 3 | using JetBrains.ReSharper.Psi; 4 | using JetBrains.ReSharper.Psi.CSharp; 5 | 6 | namespace ReSharperPlugin.MyAwesomePlugin 7 | { 8 | [ZoneDefinition] 9 | // [ZoneDefinitionConfigurableFeature("Title", "Description", IsInProductSection: false)] 10 | public interface IMyAwesomePluginZone : IZone 11 | { 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/Plugin.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2022.3.1 5 | 6 | MyAwesomePlugin 7 | Description 8 | 9 | Author 10 | Copyright $([System.DateTime]::Now.Year) Maintainers of MyAwesomePlugin 11 | resharper plugin 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin/Scope/ETProjectScopeCategoryUIProvider.cs: -------------------------------------------------------------------------------- 1 | // using System.Collections.Generic; 2 | // using JetBrains.ReSharper.Feature.Services.LiveTemplates.Scope; 3 | // 4 | // namespace ReSharperPlugin.ETPlugin.Scope 5 | // { 6 | // [ScopeCategoryUIProvider(Priority = Priority)] 7 | // public class ETProjectScopeCategoryUIProvider : ScopeCategoryUIProvider 8 | // { 9 | // private const int Priority = -200; 10 | // 11 | // public override IEnumerable BuildAllPoints() 12 | // { 13 | // yield break; 14 | // } 15 | // 16 | // public override string CategoryCaption => "ET"; 17 | // } 18 | // } -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin/Scope/ETScopeCategoryUIProvider.cs: -------------------------------------------------------------------------------- 1 | // using System.Collections.Generic; 2 | // using JetBrains.ReSharper.Feature.Services.LiveTemplates.Scope; 3 | // 4 | // namespace ReSharperPlugin.ETPlugin.Scope 5 | // { 6 | // [ScopeCategoryUIProvider(Priority = Priority, ScopeFilter = ScopeFilter.Project)] 7 | // public class ETScopeCategoryUIProvider : ScopeCategoryUIProvider 8 | // { 9 | // private const int Priority = -200; 10 | // 11 | // public override IEnumerable BuildAllPoints() 12 | // { 13 | // yield break; 14 | // } 15 | // 16 | // public override string CategoryCaption => "ET"; 17 | // } 18 | // } -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin.Tests/test/data/nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin/ETTemplatesDefaultSettings.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Reflection; 3 | using JetBrains.Application; 4 | using JetBrains.Application.Settings; 5 | using JetBrains.Diagnostics; 6 | using JetBrains.Lifetimes; 7 | 8 | namespace ReSharperPlugin.CorkiPlugin 9 | { 10 | [ShellComponent] 11 | public class ETTemplatesDefaultSettings : IHaveDefaultSettingsStream 12 | { 13 | public Stream GetDefaultSettingsStream(Lifetime lifetime) 14 | { 15 | var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("et7.dotSettings"); 16 | Assertion.AssertNotNull(stream, "stream != null"); 17 | lifetime.AddDispose(stream); 18 | return stream; 19 | } 20 | 21 | public string Name => "ET default LiveTemplates"; 22 | } 23 | } -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin.Tests/ReSharperPlugin.MyAwesomePlugin.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net472 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/rider/main/kotlin/com/jetbrains/rider/plugins/etplugin/ETTemplatesOptionPage.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.rider.plugins.etplugin 2 | 3 | import com.intellij.openapi.options.Configurable 4 | import com.intellij.openapi.util.NlsSafe 5 | import com.jetbrains.rider.settings.simple.SimpleOptionsPage 6 | 7 | class ETFileTemplatesOptionPage: SimpleOptionsPage(pageName, "RiderETFileTemplatesSettings"), Configurable.NoScroll { 8 | companion object { 9 | @NlsSafe 10 | const val pageName = "ET" 11 | } 12 | 13 | override fun getId(): String { 14 | return "RiderETFileTemplatesSettings" 15 | } 16 | } 17 | 18 | class ETLiveTemplatesOptionPage: SimpleOptionsPage(pageName, "RiderETLiveTemplatesSettings"), Configurable.NoScroll { 19 | companion object { 20 | @NlsSafe 21 | const val pageName = "ET" 22 | } 23 | 24 | override fun getId(): String { 25 | return "RiderETLiveTemplatesSettings" 26 | } 27 | } -------------------------------------------------------------------------------- /MyAwesomePlugin/publishPlugin.ps1: -------------------------------------------------------------------------------- 1 | Param( 2 | [string]$Configuration = "Release", 3 | [Parameter(Mandatory=$true)] 4 | [string]$Version, 5 | [Parameter(Mandatory=$true)] 6 | [string]$ApiKey 7 | ) 8 | 9 | Set-StrictMode -Version Latest 10 | $ErrorActionPreference = "Stop" 11 | $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent 12 | Set-Location $PSScriptRoot 13 | 14 | . ".\settings.ps1" 15 | 16 | $ChangelogText = ([Regex]::Matches([System.IO.File]::ReadAllText("CHANGELOG.md"), '(?s)(##.+?.+?)(?=##|$)').Captures | Select -First 10) -Join '' 17 | 18 | Invoke-Exe $MSBuildPath "/t:Restore;Rebuild;Pack" "$SolutionPath" "/v:minimal" "/p:Configuration=$Configuration" "/p:PackageOutputPath=$OutputDirectory" "/p:PackageVersion=$Version" "/p:PackageReleaseNotes=`"$ChangelogText`"" 19 | $PackageFile = "$OutputDirectory\$PluginId.$Version*.nupkg" 20 | Invoke-Exe $NuGetPath push $PackageFile -Source "https://plugins.jetbrains.com/api/v2/package" -ApiKey $ApiKey 21 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin.Tests/TestEnvironment.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using JetBrains.Application.BuildScript.Application.Zones; 3 | using JetBrains.ReSharper.Feature.Services; 4 | using JetBrains.ReSharper.Psi.CSharp; 5 | using JetBrains.ReSharper.TestFramework; 6 | using JetBrains.TestFramework; 7 | using JetBrains.TestFramework.Application.Zones; 8 | using NUnit.Framework; 9 | 10 | [assembly: Apartment(ApartmentState.STA)] 11 | 12 | namespace ReSharperPlugin.MyAwesomePlugin.Tests 13 | { 14 | [ZoneDefinition] 15 | public class MyAwesomePluginTestEnvironmentZone : ITestsEnvZone, IRequire, IRequire { } 16 | 17 | [ZoneMarker] 18 | public class ZoneMarker : IRequire, IRequire, IRequire { } 19 | 20 | [SetUpFixture] 21 | public class MyAwesomePluginTestsAssembly : ExtensionTestEnvironmentAssembly { } 22 | } 23 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/rider/main/resources/META-INF/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | com.jetbrains.rider.plugins.et 3 | ET7-CodeTip 4 | _PLACEHOLDER_ 5 | Author 6 | 7 | com.intellij.modules.rider 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | This is a code prompt plug-in based on github open source framework https://github.com/egametang/ET,For specific demonstration, please see the author's github https://github.com/sosloop/ET-Rider

18 | ]]> 19 |
20 | 21 |
22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 sosloop 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MyAwesomePlugin/gradle.properties: -------------------------------------------------------------------------------- 1 | # Any property can be overwritten from command-line via 2 | # -P= 3 | 4 | DotnetPluginId=ReSharperPlugin.MyAwesomePlugin 5 | DotnetSolution=ReSharperPlugin.MyAwesomePlugin.sln 6 | RiderPluginId=com.jetbrains.rider.plugins.et 7 | PluginVersion=1.0.4 8 | 9 | #BuildConfiguration=Debug 10 | BuildConfiguration=Release 11 | 12 | PublishToken="" 13 | 14 | # See https://www.jetbrains.com/intellij-repository/snapshots 15 | # 16 | # Examples: 17 | # Release: 2020.2 18 | # EAP: 2020.3-EAP2-SNAPSHOT 19 | # Nightly: 2020.3-SNAPSHOT 20 | ProductVersion=2022.3.1 21 | 22 | # Kotlin 1.4 will bundle the stdlib dependency by default, causing problems with the version bundled with the IDE 23 | # https://blog.jetbrains.com/kotlin/2020/07/kotlin-1-4-rc-released/#stdlib-default 24 | kotlin.stdlib.default.dependency=false 25 | 26 | systemProp.http.proxyHost=127.0.0.1 27 | systemProp.http.proxyPort=7890 28 | systemProp.https.proxyHost=127.0.0.1 29 | systemProp.https.proxyPort=7890 30 | 31 | systemProp.https.protocols=TLSv1.2 32 | #systemProp.socks.proxyHost=127.0.0.1 33 | #systemProp.socks.proxyPort=7890 -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin/Strings.cs: -------------------------------------------------------------------------------- 1 | namespace ReSharperPlugin.MyAwesomePlugin 2 | { 3 | using System; 4 | using JetBrains.Application.I18n; 5 | using JetBrains.DataFlow; 6 | using JetBrains.Diagnostics; 7 | using JetBrains.Lifetimes; 8 | using JetBrains.Util; 9 | using JetBrains.Util.Logging; 10 | 11 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 12 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 13 | public static class Strings 14 | { 15 | public static string etReplEmpty_Long_Text = "Repl Handler,Help,System,ClientSystem,ServerSystem"; 16 | public static string etReplEmpty_Short_Text = "Repl Handler,Help,System,ClientSystem,ServerSystem"; 17 | 18 | public static string etHandlerReversal_Long_Text = "C2R_GetInfoHandler update R2C_GetInfo"; 19 | public static string etHandlerReversal_Short_Text = "C2R_GetInfoHandler update R2C_GetInfo"; 20 | 21 | public static string etSplit0_Long_Text = "C2R_GetInfoHandler update C2R"; 22 | public static string etSplit0_Short_Text = "C2R_GetInfoHandler update C2R"; 23 | } 24 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 基于Rider快速生成ET代码 2 | 3 | ## plugin 文件夹 4 | 插件版本 rider-2019.1 到 rider-2022.1 5 | 6 | ## plugin-2022.2 文件夹 7 | 插件版本 rider-2022.2 到 最新 8 | 9 | ReSharperPlugin.MyAwesomePlugin-自动导入-1.0.4.zip 不需要手动导入*.DotSetting文件 10 | 11 | # 1.先装插件,再导入模板 12 | ## 安装本地插件 13 | **plugin**文件夹下 **corkiplugin-1.0.1.zip** 14 | 15 | ![Screen Cast](https://github.com/sosloop/ET-Rider/blob/main/gif/installplugin.png) 16 | 17 | ## 导入模板 18 | **plugin**文件夹下 **et-code.DotSettings** 19 | 20 | ![Screen Cast](https://github.com/sosloop/ET-Rider/blob/main/gif/install.png) 21 | 22 | # 3.新建选项 23 | ![Screen Cast](https://github.com/sosloop/ET-Rider/blob/main/gif/new.png) 24 | 25 | # 4.扩展 26 | 27 | ![Screen Cast](https://github.com/sosloop/ET-Rider/blob/main/gif/FileTemplete.png) 28 | 29 | ![Screen Cast](https://github.com/sosloop/ET-Rider/blob/main/gif/LiveTemplete.png) 30 | 31 | # 5.演示 32 | 33 | ![Screen Cast](https://github.com/sosloop/ET-Rider/blob/main/gif/NewComponent.gif) 34 | 35 | ![Screen Cast](https://github.com/sosloop/ET-Rider/blob/main/gif/NewComponent2.gif) 36 | 37 | ![Screen Cast](https://github.com/sosloop/ET-Rider/blob/main/gif/NewHandler.gif) 38 | 39 | ![Screen Cast](https://github.com/sosloop/ET-Rider/blob/main/gif/NewMethod.gif) 40 | 41 | # 6.参考 42 | 43 | https://github.com/citizenmatt/resharper-template-compiler -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Latest 5 | MSB3277 6 | true 7 | false 8 | None 9 | 10 | obj\$(MSBuildProjectName)\ 11 | $(DefaultItemExcludes);obj\** 12 | bin\$(MSBuildProjectName)\$(Configuration)\ 13 | 14 | 15 | 16 | TRACE;DEBUG;JET_MODE_ASSERT 17 | 18 | 19 | 20 | 21 | 22 | $(SdkVersion.Substring(2,2))$(SdkVersion.Substring(5,1)).0.0 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin/LiveTemplates/ETLiveTemplatesOptionsPage.cs: -------------------------------------------------------------------------------- 1 | // using JetBrains.Application.BuildScript.Application.Zones; 2 | // using JetBrains.Application.UI.Options; 3 | // using JetBrains.Application.UI.Options.OptionsDialog; 4 | // using JetBrains.IDE.UI; 5 | // using JetBrains.Lifetimes; 6 | // using JetBrains.ReSharper.Feature.Services.LiveTemplates.Scope; 7 | // using JetBrains.ReSharper.Feature.Services.LiveTemplates.Settings; 8 | // using JetBrains.ReSharper.LiveTemplates.UI; 9 | // using JetBrains.Rider.Model; 10 | // using ReSharperPlugin.ETPlugin.Icons; 11 | // 12 | // namespace ReSharperPlugin.ETPlugin.LiveTemplates 13 | // { 14 | // [ZoneMarker(typeof(IRiderModelZone))] 15 | // [OptionsPage("RiderETLiveTemplatesSettings", "ET", typeof(LogoIcons.ET))] 16 | // public class ETLiveTemplatesOptionsPage : RiderLiveTemplatesOptionPageBase 17 | // { 18 | // public ETLiveTemplatesOptionsPage(Lifetime lifetime, 19 | // ScopeCategoryUIProvider uiProvider, 20 | // OptionsPageContext optionsPageContext, 21 | // OptionsSettingsSmartContext optionsSettingsSmartContext, 22 | // StoredTemplatesProvider storedTemplatesProvider, 23 | // ScopeCategoryManager scopeCategoryManager, 24 | // IDialogHost dialogHost, 25 | // TemplatesUIFactory uiFactory, IconHostBase iconHostBase) 26 | // : base(lifetime, uiProvider, optionsPageContext, optionsSettingsSmartContext, storedTemplatesProvider, scopeCategoryManager, 27 | // uiFactory, iconHostBase, dialogHost, "CSHARP") 28 | // { 29 | // } 30 | // } 31 | // } -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin/LiveTemplates/ETFileTemplatesOptionsPage.cs: -------------------------------------------------------------------------------- 1 | // 2 | // using JetBrains.Application.BuildScript.Application.Zones; 3 | // using JetBrains.Application.UI.Options; 4 | // using JetBrains.Application.UI.Options.OptionsDialog; 5 | // using JetBrains.IDE.UI; 6 | // using JetBrains.Lifetimes; 7 | // using JetBrains.ReSharper.Feature.Services.LiveTemplates.Scope; 8 | // using JetBrains.ReSharper.Feature.Services.LiveTemplates.Settings; 9 | // using JetBrains.ReSharper.LiveTemplates.UI; 10 | // using JetBrains.Rider.Model; 11 | // using ReSharperPlugin.ETPlugin.Icons; 12 | // 13 | // 14 | // namespace ReSharperPlugin.ETPlugin.LiveTemplates 15 | // { 16 | // [ZoneMarker(typeof(IRiderModelZone))] 17 | // [OptionsPage("RiderETFileTemplatesSettings", "ET", typeof(LogoIcons.ET))] 18 | // public class ETFileTemplatesOptionsPage : RiderFileTemplatesOptionPageBase 19 | // { 20 | // public ETFileTemplatesOptionsPage(Lifetime lifetime, 21 | // ScopeCategoryUIProvider uiProvider, 22 | // OptionsPageContext optionsPageContext, 23 | // OptionsSettingsSmartContext optionsSettingsSmartContext, 24 | // StoredTemplatesProvider storedTemplatesProvider, 25 | // ScopeCategoryManager scopeCategoryManager, 26 | // IDialogHost dialogHost, 27 | // TemplatesUIFactory uiFactory, IconHostBase iconHostBase) 28 | // : base(lifetime, uiProvider, optionsPageContext, optionsSettingsSmartContext, storedTemplatesProvider, scopeCategoryManager, 29 | // uiFactory, iconHostBase, dialogHost, "CSHARP") 30 | // { 31 | // } 32 | // } 33 | // } -------------------------------------------------------------------------------- /MyAwesomePlugin/settings.ps1: -------------------------------------------------------------------------------- 1 | $PluginId = "ReSharperPlugin.MyAwesomePlugin" 2 | $SolutionPath = "$PSScriptRoot\ReSharperPlugin.MyAwesomePlugin.sln" 3 | $SourceBasePath = "$PSScriptRoot\src\dotnet" 4 | 5 | $VsWhereOutput = [xml] (& "$PSScriptRoot\tools\vswhere.exe" -format xml -products *) 6 | $VisualStudio = $VsWhereOutput.instances.instance | 7 | Where-Object { $_.channelId -match "Release" } | 8 | Sort-Object -Property installationVersion | 9 | Select-Object -Last 1 10 | 11 | $VisualStudioBaseDirectory = $VisualStudio.installationPath 12 | $VisualStudioMajorVersion = ($VisualStudio.installationVersion -split '\.')[0] 13 | $VisualStudioInstanceId = $VisualStudio.instanceId 14 | $DevEnvPath = Get-ChildItem "$VisualStudioBaseDirectory\*\IDE\devenv.exe" 15 | $MSBuildPath = Get-ChildItem "$VisualStudioBaseDirectory\MSBuild\*\Bin\MSBuild.exe" 16 | 17 | $OutputDirectory = "$PSScriptRoot\output" 18 | $NuGetPath = "$PSScriptRoot\tools\nuget.exe" 19 | 20 | Function Invoke-Exe { 21 | param( 22 | [parameter(mandatory=$true,position=0)] [ValidateNotNullOrEmpty()] [string] $Executable, 23 | [Parameter(ValueFromRemainingArguments=$true)][String[]] $Arguments, 24 | [parameter(mandatory=$false)] [array] $ValidExitCodes = @(0) 25 | ) 26 | 27 | Write-Host "> $Executable $Arguments" 28 | $rc = Start-Process -FilePath $Executable -ArgumentList $Arguments -NoNewWindow -Passthru 29 | $rc.Handle # to initialize handle according to https://stackoverflow.com/a/23797762/2684760 30 | $rc.WaitForExit() 31 | if (-Not $ValidExitCodes.Contains($rc.ExitCode)) { 32 | throw "'$Executable $Arguments' failed with exit code $($rc.ExitCode), valid exit codes: $ValidExitCodes" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /MyAwesomePlugin/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | // Provide repositories to resolve plugins 3 | repositories { 4 | maven { 5 | allowInsecureProtocol = true 6 | url "https://cache-redirector.jetbrains.com/plugins.gradle.org" } 7 | maven { 8 | allowInsecureProtocol = true 9 | url "https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap" } 10 | maven { 11 | allowInsecureProtocol = true 12 | url "https://cache-redirector.jetbrains.com/myget.org.rd-snapshots.maven" } 13 | 14 | maven { url 'https://maven.aliyun.com/repository/public/' } 15 | maven { url 'https://maven.aliyun.com/repository/spring/'} 16 | maven { url 'https://maven.aliyun.com/repository/google/'} 17 | maven { url 'https://maven.aliyun.com/repository/gradle-plugin/'} 18 | maven { url 'https://maven.aliyun.com/repository/spring-plugin/'} 19 | maven { url 'https://maven.aliyun.com/repository/grails-core/'} 20 | maven { url 'https://maven.aliyun.com/repository/apache-snapshots/'} 21 | } 22 | resolutionStrategy { 23 | eachPlugin { 24 | // Gradle has to map a plugin dependency to Maven coordinates - '{groupId}:{artifactId}:{version}'. It tries 25 | // to do use '{plugin.id}:{plugin.id}.gradle.plugin:version'. 26 | // This doesn't work for rdgen, so we provide some help 27 | if (requested.id.id == "com.jetbrains.rdgen") { 28 | useModule("com.jetbrains.rd:rd-gen:${requested.version}") 29 | } 30 | } 31 | } 32 | } 33 | 34 | rootProject.name = 'ReSharperPlugin.MyAwesomePlugin' 35 | 36 | include ':protocol' 37 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/rider/main/resources/icons/sdk_16.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin/ReSharperPlugin.MyAwesomePlugin.Rider.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildToolsPath)\Microsoft.CSharp.targets 5 | 6 | 7 | 8 | 9 | 10 | net472 11 | ReSharperPlugin.MyAwesomePlugin 12 | $(AssemblyName) 13 | false 14 | $(DefineConstants);RIDER 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | et7.dotSettings 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin/ReSharperPlugin.MyAwesomePlugin.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildToolsPath)\Microsoft.CSharp.targets 5 | 6 | 7 | 8 | 9 | 10 | net472 11 | True 12 | $(DefineConstants);RESHARPER 13 | false 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /MyAwesomePlugin/ReSharperPlugin.MyAwesomePlugin.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReSharperPlugin.MyAwesomePlugin", "src\dotnet\ReSharperPlugin.MyAwesomePlugin\ReSharperPlugin.MyAwesomePlugin.csproj", "{05608FE6-4FD1-4E9D-9BE2-B13A0E370BA2}" 4 | EndProject 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReSharperPlugin.MyAwesomePlugin.Rider", "src\dotnet\ReSharperPlugin.MyAwesomePlugin\ReSharperPlugin.MyAwesomePlugin.Rider.csproj", "{084172D1-A9C6-46D0-96AD-05C5B09A5E5D}" 6 | EndProject 7 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReSharperPlugin.MyAwesomePlugin.Tests", "src\dotnet\ReSharperPlugin.MyAwesomePlugin.Tests\ReSharperPlugin.MyAwesomePlugin.Tests.csproj", "{01C3DEF5-50B2-47CB-9467-19BC6DDF9D3D}" 8 | EndProject 9 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{4A9ABB95-3762-448B-B5BF-099E46DB22DE}" 10 | ProjectSection(SolutionItems) = preProject 11 | src\dotnet\Plugin.props = src\dotnet\Plugin.props 12 | README.md = README.md 13 | CHANGELOG.md = CHANGELOG.md 14 | src\rider\main\resources\META-INF\plugin.xml = src\rider\main\resources\META-INF\plugin.xml 15 | gradle.properties = gradle.properties 16 | EndProjectSection 17 | EndProject 18 | Global 19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 20 | Debug|Any CPU = Debug|Any CPU 21 | Release|Any CPU = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {05608FE6-4FD1-4E9D-9BE2-B13A0E370BA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {05608FE6-4FD1-4E9D-9BE2-B13A0E370BA2}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {05608FE6-4FD1-4E9D-9BE2-B13A0E370BA2}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {05608FE6-4FD1-4E9D-9BE2-B13A0E370BA2}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {084172D1-A9C6-46D0-96AD-05C5B09A5E5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {084172D1-A9C6-46D0-96AD-05C5B09A5E5D}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {084172D1-A9C6-46D0-96AD-05C5B09A5E5D}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {084172D1-A9C6-46D0-96AD-05C5B09A5E5D}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {01C3DEF5-50B2-47CB-9467-19BC6DDF9D3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {01C3DEF5-50B2-47CB-9467-19BC6DDF9D3D}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {01C3DEF5-50B2-47CB-9467-19BC6DDF9D3D}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {01C3DEF5-50B2-47CB-9467-19BC6DDF9D3D}.Release|Any CPU.Build.0 = Release|Any CPU 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /MyAwesomePlugin/README.md: -------------------------------------------------------------------------------- 1 | # MyAwesomePlugin for Rider and ReSharper 2 | 3 | [![Rider](https://img.shields.io/jetbrains/plugin/v/RIDER_PLUGIN_ID.svg?label=rider&colorB=0A7BBB&style=for-the-badge&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAADAAAAAsCAYAAAAjFjtnAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMjHxIGmVAAAEEklEQVRoQ%2B2ZS0hUURjHLSoKominVIta1aLaFYhBES1t1bLFRCAREbQKaiHpqgeEpjDjRhIFHWwzIyo6oWXqwmfkW0evr9TxNT7GcZxX%2FzPzzZk53jsyc%2B91I%2FcHB4a5%2F%2B%2B79z%2Fn3O98RzOOBKFQ6BeGlOrw%2B%2F2S0%2Bn83dXV9a6srOwSpUlKfX19yvnn5%2BelwcFBW09Pz8uamporlOJgEOgMq2R7ezuAm33Cx%2BOUTgYMqMq%2Ft7cX7O3t7QbXKJUyWgzEWFhYaMONTlJKAbUGYvh8vjBymy0Wi2J%2BXQwwxsbGvlFKAa0GGHjG8Nra2nd8lM%2B0kgGPx9OK76sSx9LSkgNrfyMQCOySTAAxodLS0uuUlqNkAPnG9%2BdfWVlxLC8vs%2FxBkskYHx%2B3Udo4CJbdoKqqKpcuy8DLmzU3N%2FeTpAJTU1MfSMZRMoBCYKHLMhwOx12YacBzkVpkeHjYRNIo6RpgsPXodrtdJOdgvdpJwknXQIyRkZE3mA2KiIP7LqJCnSGZOgMM3MBOcg5y6WaAsb6%2B%2Fp5CBDo7O5%2BSRL0BTOWhG2hpaTnt9Xr%2FURhndna2lSTqDWxtbUkk50xOTupqgDE9PV1AYZzV1VVXXl5etKyma6C8vDwTJa2GpALY1J6QjKPVAGY6l8I4mJVwR0dH9D1QMtDW1ubCjaXE0dDQIA0MDEj45f0kE0DlmMeUn4gkTUCrgYqKCpkBxszMTHID6YJq4cVU50QS7kOrAZvNJjOAZ9bPAHoWT3Nz84tIMgW0GsC%2B84rCOFjCYV5K1RpgPQo2tKbi4uLbkURJ0GoALUo3hXHQRP7BpWMRgZIBrGcPpmgjNjY3N2XtA16knb6%2BvouRJAegxUB1dXVuMCjvLCYmJspIomwA3wlVqL29PXt3d1e2t6MeD%2BTn58te3ETUGkDByMTyHKMQDmL9drv9FslSM8DAzvuRLgtgjX4miSJqDOCdugfNKMkFJElqIlmUVA0w0PdPkISDmQk3NjZmk0SGkgF0tq2VlZWm2ECpNFmtVtPi4uJzLN8fuD8pRdBa%2BIaGhrIodZR0DKCk5WBafSTj4IEmMeWnSCagZEANmBEPVsEDShsnHQOM%2Fv7%2BLyQTQPKvJBHQwwCqjhet%2Bn1KKZKuAfQg51GH%2F5KUw5bS6OjoHZJxtBjAr876q14ssxuUTk66Bhg4dNzECYzUcbAv7KCPukCyCGoMIPcaGjYrK6NIEa33ycBb%2FRhtgClx4EEu0%2BWkoPo83B%2FHBo59QqzZbH4LE7UHjbq6ulpsjM9QJEwFBQWPlHoqAwMDAwMDAwODo0hJScnZoqKic3oOHPST%2Fs9Md1wulxMjrNfAuZYdbK5S%2BsNH6UCjBfZ3HJgwDKQMDLzGKNRrwECh2%2B0WjpUGimRk%2FAdgThdOY4UJ9QAAAABJRU5ErkJggg%3D%3D)](https://plugins.jetbrains.com/plugin/RIDER_PLUGIN_ID) 4 | [![ReSharper](https://img.shields.io/jetbrains/plugin/v/RESHARPER_PLUGIN_ID.svg?label=resharper&colorB=0A7BBB&style=for-the-badge&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAADIAAAAxCAYAAACYq%2FofAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMjHxIGmVAAAE%2BElEQVRoQ%2B2Ya0hkZRzG3d1oWehLLQS2QRC1tEWflhLqU0QgsbAb6ZesiL5KXxKE3GBa86uE0IdWiTJq8BLGMiqapnjDYfAy3jCv6XgfZC7explxnJ73zDPvnOM7M%2BtlslrOD%2F7InOc5%2F%2Ff8z3mvZplkgJKSkuzS0tIb8bBYLC9RMoDr1%2FW%2B4uLiG5RUDg8PFxCek4Tf7%2Fe4XK7W0dHRosbGxieZ6tg4nU7%2F3t5eNB67u7tBSpK8vLwr29vbXr1veno6Ci7QYgSCT6inJRQK7UxNTd3F23ucKR%2FGBbyMAG%2FXWFpaClCT2Gy2F4PBIB0x0FYbZRXoZyokzszMTFdtbe0Vpk1JTU3NawcHB7wrBn7XU5a0tLS8Q1kyNDRko6wCPSOFCCYnJ2uYNiXLy8tv0y4ZHx%2F%2FnrIEL6aIsmRlZeUzyirQM1YI3mxodXX1OaZOCvr517RLPB7PR5QlGH9WyhIM%2BDzKKtCVQtCHf8Cfi0ejsLDwGfTdj2dnZ23hcPgQ1xRQSAVTayDXbYQ1Hmtra7u0SlDc4djYWEQfW1tbVBNMTExoWldX1wzTJ4CetBDKKbHb7Rb4eEeCjY2NOVo04PmCUsbAyzC0oYHrpyokNzf3Mvp7mLdIcO%2F%2FqxAButdPvEVyHoWg3cwWgi8yy1skSQr5HOEXEYlEDOuHAIteAN3Rrw8Qoizx%2BXzbcd3tdjuZPoHwxKwJjlNIX1%2FfG3gwZZBgsI%2FSooAuoXyd9vb2IsoSDOp6yhp4nmggEHiBcnLgO1EhdXV1l3p7ewuwrdik3QC%2B0pe0KmBK7aFNQzzg8PDwNcoSfJE%2FaNHA9iRUWVn5LOXkwKcUsrm5GcEqGjwaIyMjwZ2dnaB4gGSguHB1dfV1pjaQn59%2Fyev1TtCqgd%2FRqqqqp2iRrK%2Bv0xFjf39%2FlVJq4FMKOQ3oZtH%2B%2Fv57TKsgti94QXTHwKCdpCzBzvgaZQm%2Bsp1yauA7cyFic4civmXKpGBVfpV2CRZCB2XJ4OBgLmUJvtx3lFMD35kKwf5nrbOz8w5SKdtrdMGfEZsi8Pa3eYsE1%2Ffiui6UJV3MdnF9YWHhPtMbge%2FUhSwuLkYKCgqymUoBDT%2BgNWOgkF%2BY3gg0pRDMEn%2FOzc3d1we6zwZlA5gqq5lK4V8vBA%2BgTL%2BYJt%2FD9QgtEnSZcFtb2y3aDPwnCxHMz88bFqo4WHVXm5ubL9MmQZ4yRAdW7yFaJVjgQkLTB44BDsoSjA%2B33oMZ7C7TG4H32IWUlZVlo9st0WYAx9UfaVMoLy9%2FCznpjIFV%2FnfKku7u7luUJVi7fqWcHniPXYgAjd1Bb6IzgVhHcFb5lDYD2La8S5sEC6zSBh76K8oSLMCfUE4PvCcqxGKxXMTgV05vAhyGvHj7ypYDW5NvaJFg2v6AsgRH3t8oSyoqKm5TTg%2B8JypE0NDQcBVvWVkXBCiylTYJthx1lCXYmrxJWYKd7V%2BUNfhflMcopwfGExciwEz1figUEud0Q4hrDofjQ9o0XC6XT%2B%2FBnixKSYJj9FVMGjt6Hwa2W%2BzRaEkPnvsmHjxHH7j2POW04Mu83tHRkXM0rFbrK7Ro9PT03NTr9fX1OZQk4v9ira2thjzY4r9M2cTExMTExMTExMTkEaSpqemB3W5fznTg2LrMJs6HgYEB5YSYKdjE%2BfDIFOJ0Ol1sN%2BOwifMB7T2Bc%2FrT%2F0SwCZOHk5X1N%2Fu%2FydjP06PFAAAAAElFTkSuQmCC)](https://plugins.jetbrains.com/plugin/RESHARPER_PLUGIN_ID) 5 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin/Icons/LogoIcons.cs: -------------------------------------------------------------------------------- 1 | namespace ReSharperPlugin.ETPlugin.Icons 2 | { 3 | public sealed class LogoIcons 4 | { 5 | [global::JetBrains.Application.Icons.CompiledIconsCs.CompiledIconCsAttribute()] 6 | public sealed class ET : global::JetBrains.Application.Icons.CompiledIconsCs.CompiledIconCsClass 7 | { 8 | 9 | /// identifier class 10 | public static global::JetBrains.UI.Icons.IconId Id = new global::JetBrains.Application.Icons.CompiledIconsCs.CompiledIconCsId(typeof(ET)); 11 | 12 | /// Loads the image for Themed Icon Unity theme aspect Color. 13 | public global::JetBrains.Util.Icons.TiImage Load_Color() 14 | { 15 | return global::JetBrains.Util.Icons.TiImageConverter.FromTiSvg(@""); 16 | } 17 | 18 | /// Loads the image for Themed Icon Unity theme aspect Gray. 19 | public global::JetBrains.Util.Icons.TiImage Load_Gray() 20 | { 21 | return global::JetBrains.Util.Icons.TiImageConverter.FromTiSvg(@""); 22 | } 23 | 24 | /// Loads the image for Themed Icon Unity theme aspect GrayDark. 25 | public global::JetBrains.Util.Icons.TiImage Load_GrayDark() 26 | { 27 | return global::JetBrains.Util.Icons.TiImageConverter.FromTiSvg(@""); 28 | } 29 | 30 | /// Returns the set of theme images for Themed Icon Unity. 31 | public override global::JetBrains.Application.Icons.CompiledIconsCs.CompiledIconCsIdOwner.ThemedIconThemeImage[] GetThemeImages() 32 | { 33 | return new global::JetBrains.Application.Icons.CompiledIconsCs.CompiledIconCsIdOwner.ThemedIconThemeImage[] { 34 | new global::JetBrains.Application.Icons.CompiledIconsCs.CompiledIconCsIdOwner.ThemedIconThemeImage("Color", new global::JetBrains.Application.Icons.CompiledIconsCs.CompiledIconCsIdOwner.LoadImageDelegate(this.Load_Color)), 35 | new global::JetBrains.Application.Icons.CompiledIconsCs.CompiledIconCsIdOwner.ThemedIconThemeImage("Gray", new global::JetBrains.Application.Icons.CompiledIconsCs.CompiledIconCsIdOwner.LoadImageDelegate(this.Load_Gray)), 36 | new global::JetBrains.Application.Icons.CompiledIconsCs.CompiledIconCsIdOwner.ThemedIconThemeImage("GrayDark", new global::JetBrains.Application.Icons.CompiledIconsCs.CompiledIconCsIdOwner.LoadImageDelegate(this.Load_GrayDark))}; 37 | } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /MyAwesomePlugin/runVisualStudio.ps1: -------------------------------------------------------------------------------- 1 | Param( 2 | $RootSuffix = "MyAwesomePlugin", 3 | $Version = "9999.0.0" 4 | ) 5 | 6 | Set-StrictMode -Version Latest 7 | $ErrorActionPreference = "Stop" 8 | $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent 9 | Set-Location $PSScriptRoot 10 | 11 | . ".\settings.ps1" 12 | 13 | $UserProjectXmlFile = "$SourceBasePath\$PluginId\$PluginId.csproj.user" 14 | 15 | if (!(Test-Path "$UserProjectXmlFile")) { 16 | # Get versions from Plugin.props file 17 | $PluginPropsFile = "$SourceBasePath\Plugin.props" 18 | $PluginPropsXml = [xml] (Get-Content "$PluginPropsFile") 19 | $SdkVersionNode = $PluginPropsXml.SelectSingleNode(".//SdkVersion") 20 | $VersionSplit = $SdkVersionNode.InnerText.Split(".") 21 | $MajorVersion = "$($VersionSplit[0]).$($VersionSplit[1])" 22 | 23 | # Determine download link 24 | $ReleaseUrl = "https://data.services.jetbrains.com/products/releases?code=RSU&type=eap&type=release&majorVersion=$MajorVersion" 25 | $VersionEntry = $(Invoke-WebRequest -UseBasicParsing $ReleaseUrl | ConvertFrom-Json).RSU[0] 26 | ## TODO: check versions 27 | $DownloadLink = [uri] ($VersionEntry.downloads.windows.link.replace(".exe", ".Checked.exe")) 28 | 29 | # Download installer 30 | $InstallerFile = "$PSScriptRoot\build\installer\$($DownloadLink.Segments[-1])" 31 | if (!(Test-Path $InstallerFile)) { 32 | mkdir -Force $(Split-Path $InstallerFile -Parent) > $null 33 | Write-Output "Downloading $($DownloadLink.Segments[-2].TrimEnd("/")) installer" 34 | (New-Object System.Net.WebClient).DownloadFile($DownloadLink, $InstallerFile) 35 | } else { 36 | Write-Output "Using cached installer from $InstallerFile" 37 | } 38 | 39 | # Execute installer 40 | Write-Output "Installing experimental hive" 41 | Invoke-Exe $InstallerFile "/VsVersion=$VisualStudioMajorVersion.0" "/SpecificProductNames=ReSharper" "/Hive=$RootSuffix" "/Silent=True" 42 | 43 | $Installations = @(Get-ChildItem "$env:APPDATA\JetBrains\ReSharperPlatformVs$VisualStudioMajorVersion\vAny_$VisualStudioInstanceId$RootSuffix\NuGet.Config") 44 | if ($Installations.Count -ne 1) { Write-Error "Found no or multiple installation directories: $Installations" } 45 | $InstallationDirectory = $Installations.Directory 46 | Write-Host "Found installation directory at $InstallationDirectory" 47 | 48 | # Adapt packages.config 49 | if (Test-Path "$InstallationDirectory\packages.config") { 50 | $PackagesXml = [xml] (Get-Content "$InstallationDirectory\packages.config") 51 | } else { 52 | $PackagesXml = [xml] ("") 53 | } 54 | 55 | if ($null -eq $PackagesXml.SelectSingleNode(".//package[@id='$PluginId']/@id")) { 56 | $PluginNode = $PackagesXml.CreateElement('package') 57 | $PluginNode.setAttribute("id", "$PluginId") 58 | $PluginNode.setAttribute("version", "$Version") 59 | 60 | $PackagesNode = $PackagesXml.SelectSingleNode("//packages") 61 | $PackagesNode.AppendChild($PluginNode) > $null 62 | 63 | $PackagesXml.Save("$InstallationDirectory\packages.config") 64 | } 65 | 66 | # Adapt user project file 67 | $HostIdentifier = "$($InstallationDirectory.Parent.Name)_$($InstallationDirectory.Name.Split('_')[-1])" 68 | 69 | Set-Content -Path "$UserProjectXmlFile" -Value "" 70 | 71 | $ProjectXml = [xml] (Get-Content "$UserProjectXmlFile") 72 | $HostIdentifierNode = $ProjectXml.SelectSingleNode(".//HostFullIdentifier") 73 | $HostIdentifierNode.InnerText = $HostIdentifier 74 | $ProjectXml.Save("$UserProjectXmlFile") 75 | 76 | # Install plugin 77 | $PluginRepository = "$env:LOCALAPPDATA\JetBrains\plugins" 78 | Remove-Item "$PluginRepository\${PluginId}.${Version}" -Recurse -ErrorAction Ignore 79 | Invoke-Exe $MSBuildPath "/t:Restore;Rebuild;Pack" "$SolutionPath" "/v:minimal" "/p:PackageVersion=$Version" "/p:PackageOutputPath=`"$OutputDirectory`"" 80 | Invoke-Exe $NuGetPath install $PluginId -OutputDirectory "$PluginRepository" -Source "$OutputDirectory" -DependencyVersion Ignore 81 | 82 | Write-Output "Re-installing experimental hive" 83 | Invoke-Exe "$InstallerFile" "/VsVersion=$VisualStudioMajorVersion.0" "/SpecificProductNames=ReSharper" "/Hive=$RootSuffix" "/Silent=True" 84 | } else { 85 | Write-Warning "Plugin is already installed. To trigger reinstall, delete $UserProjectXmlFile." 86 | } 87 | 88 | Invoke-Exe $MSBuildPath "/t:Restore;Rebuild" "$SolutionPath" "/v:minimal" 89 | Invoke-Exe $DevEnvPath "/rootSuffix $RootSuffix" "/ReSharper.Internal" "/ReSharper.LogFile $PSScriptRoot\ReSharper.log" "/ReSharper.LogLevel Trace" 90 | -------------------------------------------------------------------------------- /MyAwesomePlugin/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem GRADLE JVM WRAPPER START MARKER 40 | 41 | setlocal 42 | set BUILD_DIR=%LOCALAPPDATA%\gradle-jvm 43 | set JVM_TARGET_DIR=%BUILD_DIR%\jdk-17.0.3.1_windows-x64_bin-d6ede5\ 44 | 45 | set JVM_URL=https://download.oracle.com/java/17/archive/jdk-17.0.3.1_windows-x64_bin.zip 46 | 47 | set IS_TAR_GZ=0 48 | set JVM_TEMP_FILE=gradle-jvm.zip 49 | 50 | if /I "%JVM_URL:~-7%"==".tar.gz" ( 51 | set IS_TAR_GZ=1 52 | set JVM_TEMP_FILE=gradle-jvm.tar.gz 53 | ) 54 | 55 | set POWERSHELL=%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe 56 | 57 | if not exist "%JVM_TARGET_DIR%" MD "%JVM_TARGET_DIR%" 58 | 59 | if not exist "%JVM_TARGET_DIR%.flag" goto downloadAndExtractJvm 60 | 61 | set /p CURRENT_FLAG=<"%JVM_TARGET_DIR%.flag" 62 | if "%CURRENT_FLAG%" == "%JVM_URL%" goto continueWithJvm 63 | 64 | :downloadAndExtractJvm 65 | 66 | PUSHD "%BUILD_DIR%" 67 | if errorlevel 1 goto fail 68 | 69 | echo Downloading %JVM_URL% to %BUILD_DIR%\%JVM_TEMP_FILE% 70 | if exist "%JVM_TEMP_FILE%" DEL /F "%JVM_TEMP_FILE%" 71 | "%POWERSHELL%" -nologo -noprofile -Command "Set-StrictMode -Version 3.0; $ErrorActionPreference = \"Stop\"; (New-Object Net.WebClient).DownloadFile('%JVM_URL%', '%JVM_TEMP_FILE%')" 72 | if errorlevel 1 goto fail 73 | 74 | POPD 75 | 76 | RMDIR /S /Q "%JVM_TARGET_DIR%" 77 | if errorlevel 1 goto fail 78 | 79 | MKDIR "%JVM_TARGET_DIR%" 80 | if errorlevel 1 goto fail 81 | 82 | PUSHD "%JVM_TARGET_DIR%" 83 | if errorlevel 1 goto fail 84 | 85 | echo Extracting %BUILD_DIR%\%JVM_TEMP_FILE% to %JVM_TARGET_DIR% 86 | 87 | if "%IS_TAR_GZ%"=="1" ( 88 | tar xf "..\\%JVM_TEMP_FILE%" 89 | ) else ( 90 | "%POWERSHELL%" -nologo -noprofile -command "Set-StrictMode -Version 3.0; $ErrorActionPreference = \"Stop\"; Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('..\\%JVM_TEMP_FILE%', '.');" 91 | ) 92 | if errorlevel 1 goto fail 93 | 94 | DEL /F "..\%JVM_TEMP_FILE%" 95 | if errorlevel 1 goto fail 96 | 97 | POPD 98 | 99 | echo %JVM_URL%>"%JVM_TARGET_DIR%.flag" 100 | if errorlevel 1 goto fail 101 | 102 | :continueWithJvm 103 | 104 | set JAVA_HOME= 105 | for /d %%d in ("%JVM_TARGET_DIR%"*) do if exist "%%d\bin\java.exe" set JAVA_HOME=%%d 106 | if not exist "%JAVA_HOME%\bin\java.exe" ( 107 | echo Unable to find java.exe under %JVM_TARGET_DIR% 108 | goto fail 109 | ) 110 | 111 | endlocal & set JAVA_HOME=%JAVA_HOME% 112 | 113 | @rem GRADLE JVM WRAPPER END MARKER 114 | 115 | @rem Find java.exe 116 | if defined JAVA_HOME goto findJavaFromJavaHome 117 | 118 | set JAVA_EXE=java.exe 119 | %JAVA_EXE% -version >NUL 2>&1 120 | if %ERRORLEVEL% equ 0 goto execute 121 | 122 | echo. 123 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 124 | echo. 125 | echo Please set the JAVA_HOME variable in your environment to match the 126 | echo location of your Java installation. 127 | 128 | goto fail 129 | 130 | :findJavaFromJavaHome 131 | set JAVA_HOME=%JAVA_HOME:"=% 132 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 133 | 134 | if exist "%JAVA_EXE%" goto execute 135 | 136 | echo. 137 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 138 | echo. 139 | echo Please set the JAVA_HOME variable in your environment to match the 140 | echo location of your Java installation. 141 | 142 | goto fail 143 | 144 | :execute 145 | @rem Setup the command line 146 | 147 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 148 | 149 | 150 | @rem Execute Gradle 151 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 152 | 153 | :end 154 | @rem End local scope for the variables with windows NT shell 155 | if %ERRORLEVEL% equ 0 goto mainEnd 156 | 157 | :fail 158 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 159 | rem the _cmd.exe /c_ return code! 160 | set EXIT_CODE=%ERRORLEVEL% 161 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 162 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 163 | exit /b %EXIT_CODE% 164 | 165 | :mainEnd 166 | if "%OS%"=="Windows_NT" endlocal 167 | 168 | :omega 169 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin/DiyMacroDef.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using JetBrains.DocumentModel; 4 | using JetBrains.ProjectModel; 5 | using JetBrains.ReSharper.Feature.Services.LiveTemplates.Hotspots; 6 | using JetBrains.ReSharper.Feature.Services.LiveTemplates.Macros; 7 | using JetBrains.ReSharper.Psi; 8 | 9 | namespace ReSharperPlugin.MyAwesomePlugin 10 | { 11 | [MacroDefinition("etReplEmpty", 12 | ResourceType = typeof(Strings), 13 | DescriptionResourceName = nameof(Strings.etReplEmpty_Short_Text), 14 | LongDescriptionResourceName = nameof(Strings.etReplEmpty_Long_Text))] 15 | public class EtReplEmptyMacroDef : SimpleMacroDefinition 16 | { 17 | public override string GetPlaceholder(IDocument document, ISolution solution, IEnumerable parameters) 18 | { 19 | return Evaluate(document.GetPsiSourceFile(solution)); 20 | } 21 | 22 | public static string Evaluate(IPsiSourceFile sourceFile) 23 | { 24 | var str = sourceFile?.GetLocation().NameWithoutExtension ?? ""; 25 | if (str.EndsWith("Handler")) 26 | { 27 | return str.Replace("Handler", ""); 28 | } 29 | 30 | if (str.EndsWith("Help")) 31 | { 32 | return str.Replace("Help", ""); 33 | } 34 | 35 | if (str.EndsWith("ClientSystem")) 36 | { 37 | return str.Replace("ClientSystem", ""); 38 | } 39 | 40 | if (str.EndsWith("ServerSystem")) 41 | { 42 | return str.Replace("ServerSystem", ""); 43 | } 44 | 45 | if (str.EndsWith("System")) 46 | { 47 | return str.Replace("System", ""); 48 | } 49 | 50 | return str; 51 | 52 | } 53 | 54 | public override bool CanBeEvaluatedWithoutCommit => true; 55 | } 56 | 57 | [MacroImplementation(Definition = typeof(EtReplEmptyMacroDef), ScopeProvider = typeof(PsiImpl))] 58 | public class EtReplEmptyMacroDefImpl : SimpleMacroImplementation 59 | { 60 | public override HotspotItems GetLookupItems(IHotspotContext context) 61 | { 62 | var sourceFile = context.ExpressionRange.Document.GetPsiSourceFile(context.SessionContext.Solution); 63 | return MacroUtil.SimpleEvaluateResult(EtReplEmptyMacroDef.Evaluate(sourceFile)); 64 | } 65 | } 66 | 67 | // 68 | [MacroDefinition("etHandlerReversal", 69 | ResourceType = typeof(Strings), 70 | DescriptionResourceName = nameof(Strings.etHandlerReversal_Short_Text), 71 | LongDescriptionResourceName = nameof(Strings.etHandlerReversal_Long_Text))] 72 | public class EtHandlerUtilMacroDef : SimpleMacroDefinition 73 | { 74 | public override string GetPlaceholder(IDocument document, ISolution solution, IEnumerable parameters) 75 | { 76 | return Evaluate(document.GetPsiSourceFile(solution)); 77 | } 78 | 79 | public static string Evaluate(IPsiSourceFile sourceFile) 80 | { 81 | var str = sourceFile?.GetLocation().NameWithoutExtension ?? ""; 82 | 83 | // 这个是消息 反转 84 | if ((str.IndexOf("_", StringComparison.Ordinal) != -1) && ((str.IndexOf("2", StringComparison.Ordinal) != -1) && str.EndsWith("Handler"))) 85 | { 86 | char[] separator = new char[] { '_' }; 87 | string[] strArray = str.Split(separator); 88 | if (strArray.Length == 2) 89 | { 90 | char[] chArray2 = new char[] { '2' }; 91 | string[] strArray2 = strArray[0].Split(chArray2); 92 | if (strArray2.Length == 2) 93 | { 94 | string[] textArray1 = new string[] { strArray2[1], "2", strArray2[0], "_", strArray[1].Replace("Handler", "") }; 95 | return string.Concat(textArray1); 96 | } 97 | } 98 | } 99 | 100 | return str; 101 | 102 | } 103 | 104 | public override bool CanBeEvaluatedWithoutCommit => true; 105 | } 106 | 107 | [MacroImplementation(Definition = typeof(EtHandlerUtilMacroDef), ScopeProvider = typeof(PsiImpl))] 108 | public class EtHandlerUtilMacroDefImpl : SimpleMacroImplementation 109 | { 110 | public override HotspotItems GetLookupItems(IHotspotContext context) 111 | { 112 | var sourceFile = context.ExpressionRange.Document.GetPsiSourceFile(context.SessionContext.Solution); 113 | return MacroUtil.SimpleEvaluateResult(EtHandlerUtilMacroDef.Evaluate(sourceFile)); 114 | } 115 | } 116 | 117 | // 118 | [MacroDefinition("etSplit0", 119 | ResourceType = typeof(Strings), 120 | DescriptionResourceName = nameof(Strings.etSplit0_Short_Text), 121 | LongDescriptionResourceName = nameof(Strings.etSplit0_Long_Text))] 122 | public class EtSplit0MacroDef : SimpleMacroDefinition 123 | { 124 | public override string GetPlaceholder(IDocument document, ISolution solution, IEnumerable parameters) 125 | { 126 | return Evaluate(document.GetPsiSourceFile(solution)); 127 | } 128 | 129 | public static string Evaluate(IPsiSourceFile sourceFile) 130 | { 131 | var str = sourceFile?.GetLocation().NameWithoutExtension ?? ""; 132 | 133 | if ((str.IndexOf("_", StringComparison.Ordinal) != -1)) 134 | { 135 | char[] separator = new char[] { '_' }; 136 | string[] strArray = str.Split(separator); 137 | return strArray[0]; 138 | } 139 | 140 | return str; 141 | 142 | } 143 | 144 | public override bool CanBeEvaluatedWithoutCommit => true; 145 | } 146 | 147 | [MacroImplementation(Definition = typeof(EtSplit0MacroDef), ScopeProvider = typeof(PsiImpl))] 148 | public class EtSplit0MacroDefImpl : SimpleMacroImplementation 149 | { 150 | public override HotspotItems GetLookupItems(IHotspotContext context) 151 | { 152 | var sourceFile = context.ExpressionRange.Document.GetPsiSourceFile(context.SessionContext.Solution); 153 | return MacroUtil.SimpleEvaluateResult(EtSplit0MacroDef.Evaluate(sourceFile)); 154 | } 155 | } 156 | 157 | } -------------------------------------------------------------------------------- /MyAwesomePlugin/build.gradle: -------------------------------------------------------------------------------- 1 | // Reference https://www.jetbrains.org/intellij/sdk/docs/tutorials/build_system/gradle_guide.html 2 | import org.apache.tools.ant.taskdefs.condition.Os 3 | 4 | plugins { 5 | id 'java' 6 | id 'org.jetbrains.kotlin.jvm' version '1.7.20' 7 | id 'org.jetbrains.intellij' version '1.10.1' // https://github.com/JetBrains/gradle-intellij-plugin/releases 8 | id 'com.jetbrains.rdgen' version '2023.1.2' // https://github.com/JetBrains/rd/releases 9 | id 'me.filippov.gradle.jvm.wrapper' version '0.14.0' 10 | } 11 | 12 | ext { 13 | isWindows = Os.isFamily(Os.FAMILY_WINDOWS) 14 | rdLibDirectory = { 15 | new File(setupDependencies.idea.get().classes, "lib/rd") 16 | } 17 | } 18 | 19 | repositories { 20 | maven { 21 | allowInsecureProtocol = true 22 | url 'https://cache-redirector.jetbrains.com/intellij-repository/snapshots' } 23 | maven { 24 | allowInsecureProtocol = true 25 | url 'https://cache-redirector.jetbrains.com/maven-central' } 26 | 27 | maven { url 'https://maven.aliyun.com/repository/public/' } 28 | maven { url 'https://maven.aliyun.com/repository/spring/'} 29 | maven { url 'https://maven.aliyun.com/repository/google/'} 30 | maven { url 'https://maven.aliyun.com/repository/gradle-plugin/'} 31 | maven { url 'https://maven.aliyun.com/repository/spring-plugin/'} 32 | maven { url 'https://maven.aliyun.com/repository/grails-core/'} 33 | maven { url 'https://maven.aliyun.com/repository/apache-snapshots/'} 34 | } 35 | 36 | wrapper { 37 | gradleVersion = '7.6' 38 | distributionType = Wrapper.DistributionType.ALL 39 | distributionUrl = "https://cache-redirector.jetbrains.com/services.gradle.org/distributions/gradle-${gradleVersion}-all.zip" 40 | } 41 | 42 | version = ext.PluginVersion 43 | 44 | tasks.named("processResources") { 45 | from("dependencies.json", { into "META-INF" }) 46 | } 47 | 48 | sourceSets { 49 | main { 50 | java.srcDir 'src/rider/main/java' 51 | kotlin.srcDir 'src/rider/main/kotlin' 52 | resources.srcDir 'src/rider/main/resources' 53 | } 54 | } 55 | 56 | compileKotlin { 57 | kotlinOptions { jvmTarget = "17" } 58 | } 59 | 60 | task setBuildTool { 61 | doLast { 62 | ext.args = [] 63 | ByteArrayOutputStream stdout = new ByteArrayOutputStream() 64 | if (isWindows) { 65 | exec { 66 | executable "${rootDir}\\tools\\vswhere.exe" 67 | args '-latest','-property','installationPath','-products','*' 68 | standardOutput = stdout 69 | workingDir rootDir 70 | } 71 | List files = new FileNameFinder().getFileNames("${stdout.toString().trim()}\\MSBuild", "**/MSBuild.exe") 72 | ext.executable = files.get(0) 73 | ext.args << "/v:minimal" 74 | } else { 75 | ext.executable = "dotnet" 76 | ext.args << "msbuild" 77 | } 78 | ext.args << "${DotnetSolution}" 79 | ext.args << "/p:Configuration=${BuildConfiguration}" 80 | ext.args << "/p:HostFullIdentifier=" 81 | } 82 | } 83 | 84 | task compileDotNet { 85 | dependsOn setBuildTool 86 | doLast { 87 | def arguments = setBuildTool.args.clone() 88 | arguments << "/t:Restore;Rebuild" 89 | exec { 90 | executable setBuildTool.executable 91 | args arguments 92 | workingDir rootDir 93 | } 94 | } 95 | } 96 | 97 | task testDotNet { 98 | doLast { 99 | exec { 100 | executable "dotnet" 101 | args "test","${DotnetSolution}","--logger","GitHubActions" 102 | workingDir rootDir 103 | } 104 | } 105 | } 106 | 107 | buildPlugin { 108 | doLast { 109 | copy { 110 | from "${buildDir}/distributions/${rootProject.name}-${version}.zip" 111 | into "${rootDir}/output" 112 | } 113 | 114 | // TODO: See also org.jetbrains.changelog: https://github.com/JetBrains/gradle-changelog-plugin 115 | def changelogText = file("${rootDir}/CHANGELOG.md").text 116 | def changelogMatches = changelogText =~ /(?s)(-.+?)(?=##|$)/ 117 | def changeNotes = changelogMatches.collect { 118 | it[1].replaceAll(/(?s)- /, "\u2022 ").replaceAll(/`/, "").replaceAll(/,/, "%2C").replaceAll(/;/, "%3B") 119 | }.take(1).join("") 120 | 121 | def arguments = setBuildTool.args.clone() 122 | arguments << "/t:Pack" 123 | arguments << "/p:PackageOutputPath=${rootDir}/output" 124 | arguments << "/p:PackageReleaseNotes=${changeNotes}" 125 | arguments << "/p:PackageVersion=${version}" 126 | exec { 127 | executable setBuildTool.executable 128 | args arguments 129 | workingDir rootDir 130 | } 131 | } 132 | } 133 | 134 | intellij { 135 | type = 'RD' 136 | version = "${ProductVersion}" 137 | downloadSources = false 138 | instrumentCode = false 139 | // TODO: add plugins 140 | // plugins = ["uml", "com.jetbrains.ChooseRuntime:1.0.9"] 141 | } 142 | 143 | runIde { 144 | // Match Rider's default heap size of 1.5Gb (default for runIde is 512Mb) 145 | maxHeapSize = "1500m" 146 | 147 | // Rider's backend doesn't support dynamic plugins. It might be possible to work with auto-reload of the frontend 148 | // part of a plugin, but there are dangers about keeping plugins in sync 149 | autoReloadPlugins = false 150 | 151 | // gradle-intellij-plugin will download the default version of the JBR for the snapshot. Update if required 152 | // jbrVersion = "jbr_jcef-11_0_6b765.40" // https://confluence.jetbrains.com/display/JBR/Release+notes 153 | } 154 | 155 | rdgen { 156 | def modelDir = new File(rootDir, "protocol/src/main/kotlin/model") 157 | def csOutput = new File(rootDir, "src/dotnet/${DotnetPluginId}/Rider") 158 | def ktOutput = new File(rootDir, "src/rider/main/kotlin/${RiderPluginId.replace('.','/').toLowerCase()}") 159 | 160 | verbose = true 161 | classpath { 162 | "${rdLibDirectory()}/rider-model.jar" 163 | } 164 | sources "${modelDir}/rider" 165 | hashFolder = "${buildDir}" 166 | packages = "model.rider" 167 | 168 | generator { 169 | language = "kotlin" 170 | transform = "asis" 171 | root = "com.jetbrains.rider.model.nova.ide.IdeRoot" 172 | namespace = "com.jetbrains.rider.model" 173 | directory = "$ktOutput" 174 | } 175 | 176 | generator { 177 | language = "csharp" 178 | transform = "reversed" 179 | root = "com.jetbrains.rider.model.nova.ide.IdeRoot" 180 | namespace = "JetBrains.Rider.Model" 181 | directory = "$csOutput" 182 | } 183 | } 184 | 185 | patchPluginXml { 186 | // TODO: See also org.jetbrains.changelog: https://github.com/JetBrains/gradle-changelog-plugin 187 | def changelogText = file("${rootDir}/CHANGELOG.md").text 188 | def changelogMatches = changelogText =~ /(?s)(-.+?)(?=##|$)/ 189 | 190 | sinceBuild = '222' 191 | untilBuild = '231.*' 192 | 193 | changeNotes = changelogMatches.collect { 194 | it[1].replaceAll(/(?s)\r?\n/, "
\n") 195 | }.take(1).join('') 196 | } 197 | 198 | prepareSandbox { 199 | dependsOn compileDotNet 200 | 201 | def outputFolder = "${rootDir}/src/dotnet/${DotnetPluginId}/bin/${DotnetPluginId}.Rider/${BuildConfiguration}" 202 | def dllFiles = [ 203 | "$outputFolder/${DotnetPluginId}.dll", 204 | "$outputFolder/${DotnetPluginId}.pdb", 205 | // TODO: add additional assemblies 206 | ] 207 | 208 | dllFiles.forEach({ f -> 209 | def file = file(f) 210 | from(file, { into "${rootProject.name}/dotnet" }) 211 | }) 212 | 213 | doLast { 214 | dllFiles.forEach({ f -> 215 | def file = file(f) 216 | if (!file.exists()) throw new RuntimeException("File ${file} does not exist") 217 | }) 218 | } 219 | } 220 | 221 | publishPlugin { 222 | dependsOn testDotNet 223 | dependsOn buildPlugin 224 | token = "${PublishToken}" 225 | 226 | doLast { 227 | exec { 228 | executable "dotnet" 229 | args "nuget","push","output/${DotnetPluginId}.${version}.nupkg","--api-key","${PublishToken}","--source","https://plugins.jetbrains.com" 230 | workingDir rootDir 231 | } 232 | } 233 | } 234 | -------------------------------------------------------------------------------- /MyAwesomePlugin/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # GRADLE JVM WRAPPER START MARKER 121 | BUILD_DIR="${HOME}/.local/share/gradle-jvm" 122 | JVM_ARCH=$(uname -m) 123 | JVM_TEMP_FILE=$BUILD_DIR/gradle-jvm-temp.tar.gz 124 | if [ "$darwin" = "true" ]; then 125 | case $JVM_ARCH in 126 | x86_64) 127 | JVM_URL=https://download.oracle.com/java/17/archive/jdk-17.0.3.1_macos-x64_bin.tar.gz 128 | JVM_TARGET_DIR=$BUILD_DIR/jdk-17.0.3.1_macos-x64_bin-1bcf03 129 | ;; 130 | arm64) 131 | JVM_URL=https://download.oracle.com/java/17/archive/jdk-17.0.3.1_macos-aarch64_bin.tar.gz 132 | JVM_TARGET_DIR=$BUILD_DIR/jdk-17.0.3.1_macos-aarch64_bin-297fa2 133 | ;; 134 | *) 135 | die "Unknown architecture $JVM_ARCH" 136 | ;; 137 | esac 138 | elif [ "$cygwin" = "true" ] || [ "$msys" = "true" ]; then 139 | JVM_URL=https://download.oracle.com/java/17/archive/jdk-17.0.3.1_windows-x64_bin.zip 140 | JVM_TARGET_DIR=$BUILD_DIR/jdk-17.0.3.1_windows-x64_bin-d6ede5 141 | else 142 | JVM_ARCH=$(linux$(getconf LONG_BIT) uname -m) 143 | case $JVM_ARCH in 144 | x86_64) 145 | JVM_URL=https://download.oracle.com/java/17/archive/jdk-17.0.3.1_linux-x64_bin.tar.gz 146 | JVM_TARGET_DIR=$BUILD_DIR/jdk-17.0.3.1_linux-x64_bin-9324ae 147 | ;; 148 | aarch64) 149 | JVM_URL=https://download.oracle.com/java/17/archive/jdk-17.0.3.1_linux-aarch64_bin.tar.gz 150 | JVM_TARGET_DIR=$BUILD_DIR/jdk-17.0.3.1_linux-aarch64_bin-319da6 151 | ;; 152 | *) 153 | die "Unknown architecture $JVM_ARCH" 154 | ;; 155 | esac 156 | fi 157 | 158 | set -e 159 | 160 | if [ -e "$JVM_TARGET_DIR/.flag" ] && [ -n "$(ls "$JVM_TARGET_DIR")" ] && [ "x$(cat "$JVM_TARGET_DIR/.flag")" = "x${JVM_URL}" ]; then 161 | # Everything is up-to-date in $JVM_TARGET_DIR, do nothing 162 | true 163 | else 164 | echo "Downloading $JVM_URL to $JVM_TEMP_FILE" 165 | 166 | rm -f "$JVM_TEMP_FILE" 167 | mkdir -p "$BUILD_DIR" 168 | if command -v curl >/dev/null 2>&1; then 169 | if [ -t 1 ]; then CURL_PROGRESS="--progress-bar"; else CURL_PROGRESS="--silent --show-error"; fi 170 | # shellcheck disable=SC2086 171 | curl $CURL_PROGRESS -L --output "${JVM_TEMP_FILE}" "$JVM_URL" 2>&1 172 | elif command -v wget >/dev/null 2>&1; then 173 | if [ -t 1 ]; then WGET_PROGRESS=""; else WGET_PROGRESS="-nv"; fi 174 | wget $WGET_PROGRESS -O "${JVM_TEMP_FILE}" "$JVM_URL" 2>&1 175 | else 176 | die "ERROR: Please install wget or curl" 177 | fi 178 | 179 | echo "Extracting $JVM_TEMP_FILE to $JVM_TARGET_DIR" 180 | rm -rf "$JVM_TARGET_DIR" 181 | mkdir -p "$JVM_TARGET_DIR" 182 | 183 | case "$JVM_URL" in 184 | *".zip") unzip "$JVM_TEMP_FILE" -d "$JVM_TARGET_DIR" ;; 185 | *) tar -x -f "$JVM_TEMP_FILE" -C "$JVM_TARGET_DIR" ;; 186 | esac 187 | 188 | rm -f "$JVM_TEMP_FILE" 189 | 190 | echo "$JVM_URL" >"$JVM_TARGET_DIR/.flag" 191 | fi 192 | 193 | JAVA_HOME= 194 | for d in "$JVM_TARGET_DIR" "$JVM_TARGET_DIR"/* "$JVM_TARGET_DIR"/Contents/Home "$JVM_TARGET_DIR"/*/Contents/Home; do 195 | if [ -e "$d/bin/java" ]; then 196 | JAVA_HOME="$d" 197 | fi 198 | done 199 | 200 | if [ '!' -e "$JAVA_HOME/bin/java" ]; then 201 | die "Unable to find bin/java under $JVM_TARGET_DIR" 202 | fi 203 | 204 | # Make it available for child processes 205 | export JAVA_HOME 206 | 207 | set +e 208 | 209 | # GRADLE JVM WRAPPER END MARKER 210 | 211 | # Determine the Java command to use to start the JVM. 212 | if [ -n "$JAVA_HOME" ] ; then 213 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 214 | # IBM's JDK on AIX uses strange locations for the executables 215 | JAVACMD=$JAVA_HOME/jre/sh/java 216 | else 217 | JAVACMD=$JAVA_HOME/bin/java 218 | fi 219 | if [ ! -x "$JAVACMD" ] ; then 220 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 221 | 222 | Please set the JAVA_HOME variable in your environment to match the 223 | location of your Java installation." 224 | fi 225 | else 226 | JAVACMD=java 227 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 228 | 229 | Please set the JAVA_HOME variable in your environment to match the 230 | location of your Java installation." 231 | fi 232 | 233 | # Increase the maximum file descriptors if we can. 234 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 235 | case $MAX_FD in #( 236 | max*) 237 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 238 | # shellcheck disable=SC3045 239 | MAX_FD=$( ulimit -H -n ) || 240 | warn "Could not query maximum file descriptor limit" 241 | esac 242 | case $MAX_FD in #( 243 | '' | soft) :;; #( 244 | *) 245 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 246 | # shellcheck disable=SC3045 247 | ulimit -n "$MAX_FD" || 248 | warn "Could not set maximum file descriptor limit to $MAX_FD" 249 | esac 250 | fi 251 | 252 | # Collect all arguments for the java command, stacking in reverse order: 253 | # * args from the command line 254 | # * the main class name 255 | # * -classpath 256 | # * -D...appname settings 257 | # * --module-path (only if needed) 258 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 259 | 260 | # For Cygwin or MSYS, switch paths to Windows format before running java 261 | if "$cygwin" || "$msys" ; then 262 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 263 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 264 | 265 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 266 | 267 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 268 | for arg do 269 | if 270 | case $arg in #( 271 | -*) false ;; # don't mess with options #( 272 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 273 | [ -e "$t" ] ;; #( 274 | *) false ;; 275 | esac 276 | then 277 | arg=$( cygpath --path --ignore --mixed "$arg" ) 278 | fi 279 | # Roll the args list around exactly as many times as the number of 280 | # args, so each arg winds up back in the position where it started, but 281 | # possibly modified. 282 | # 283 | # NB: a `for` loop captures its iteration list before it begins, so 284 | # changing the positional parameters here affects neither the number of 285 | # iterations, nor the values presented in `arg`. 286 | shift # remove old arg 287 | set -- "$@" "$arg" # push replacement arg 288 | done 289 | fi 290 | 291 | # Collect all arguments for the java command; 292 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 293 | # shell script including quotes and variable substitutions, so put them in 294 | # double quotes to make sure that they get re-expanded; and 295 | # * put everything else in single quotes, so that it's not re-expanded. 296 | 297 | set -- \ 298 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 299 | -classpath "$CLASSPATH" \ 300 | org.gradle.wrapper.GradleWrapperMain \ 301 | "$@" 302 | 303 | # Stop when "xargs" is not available. 304 | if ! command -v xargs >/dev/null 2>&1 305 | then 306 | die "xargs is not available" 307 | fi 308 | 309 | # Use "xargs" to parse quoted args. 310 | # 311 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 312 | # 313 | # In Bash we could simply go: 314 | # 315 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 316 | # set -- "${ARGS[@]}" "$@" 317 | # 318 | # but POSIX shell has neither arrays nor command substitution, so instead we 319 | # post-process each arg (as a line of input to sed) to backslash-escape any 320 | # character that might be a shell metacharacter, then use eval to reverse 321 | # that process (while maintaining the separation between arguments), and wrap 322 | # the whole thing up as a single "set" statement. 323 | # 324 | # This will of course break if any of these variables contains a newline or 325 | # an unmatched quote. 326 | # 327 | 328 | eval "set -- $( 329 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 330 | xargs -n1 | 331 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 332 | tr '\n' ' ' 333 | )" '"$@"' 334 | 335 | exec "$JAVACMD" "$@" 336 | -------------------------------------------------------------------------------- /plugin-2023/et8codetip.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | True 13 | ETServerAMActorLocationRpcHandler 14 | 14 15 | 9 16 | 17 | 18 | 19 | True 20 | ETServerAMRpcHandler 21 | 17 22 | 23 | 24 | 25 | 6 26 | 27 | 28 | 29 | 30 | 31 | 32 | 7 33 | True 34 | ETComponent 35 | 16 36 | 8 37 | True 38 | ETComponentM 39 | 11 40 | False 41 | True 42 | ETComponent 43 | 12 44 | True 45 | ETEntityModelC 46 | 10 47 | True 48 | ETAMActorLocationHandler 49 | 13 50 | True 51 | ETServerAMActorRpcHandler 52 | 15 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | True 115 | True 116 | True 117 | etReplEmpty() 118 | -1 119 | 0 120 | True 121 | True 122 | 2.0 123 | InCSharpFile 124 | aStaticSystem 125 | True 126 | public static class $NAME1$System 127 | { 128 | 129 | } 130 | True 131 | True 132 | True 133 | 0 134 | 135 | 136 | 137 | True 138 | True 139 | 2.0 140 | InCSharpFile 141 | aAMActorLocationRpcHandler 142 | True 143 | using System; 144 | 145 | namespace ET 146 | { 147 | [MessageLocationHandler(SceneType.Map)] 148 | public class $NAME1$Handler : MessageLocationHandler<Unit, $NAME1$, $NAME1$> 149 | { 150 | protected override async ETTask Run(Unit unit, $NAME1$ request, $NAME1$ response) 151 | { 152 | await ETTask.CompletedTask; 153 | } 154 | } 155 | } 156 | 157 | True 158 | True 159 | True 160 | 0 161 | True 162 | True 163 | 2.0 164 | InCSharpFile 165 | aATimer 166 | True 167 | [Invoke(TimerInvokeType.$NAME1$)] 168 | public class $NAME1$Time: ATimer<$NAME1$> 169 | { 170 | protected override void Run($NAME1$ self) 171 | { 172 | 173 | } 174 | } 175 | True 176 | True 177 | 178 | 179 | 180 | 181 | True 182 | 0 183 | True 184 | etReplEmpty() 185 | -1 186 | 1 187 | 188 | 189 | True 190 | True 191 | 2.0 192 | InCSharpFile 193 | aStaticAsyncMethod 194 | True 195 | public static async ETTask $NAME1$(this $RESP$ self) 196 | { 197 | 198 | } 199 | True 200 | True 201 | cs 202 | ETComponent 203 | True 204 | &ETServerAMActorRpcHandler 205 | True 206 | getAlphaNumericFileNameWithoutExtension() 207 | -1 208 | 0 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | True 217 | etReplEmpty() 218 | -1 219 | 2 220 | True 221 | etHandlerReversal() 222 | -1 223 | 1 224 | CSharp 225 | True 226 | True 227 | InCSharpProjectFile 228 | True 229 | 230 | using System; 231 | 232 | namespace ET.Server 233 | { 234 | [MessageHandler(SceneType.Map)] 235 | public class $CLASS$ : MessageHandler<Scene, $Req$,$RESP$> 236 | { 237 | protected override async ETTask Run(Scene scene, $Req$ request, $RESP$ response) 238 | { 239 | await ETTask.CompletedTask; 240 | $END$ 241 | } 242 | } 243 | } 244 | ET/Server 245 | True 246 | True 247 | True 248 | 0 249 | 250 | 251 | 252 | True 253 | True 254 | 2.0 255 | InCSharpFile 256 | aAMActorRpcHandler 257 | True 258 | using System; 259 | 260 | namespace ET 261 | { 262 | [MessageHandler(SceneType.Demo)] 263 | public class $NAME1$Handler: MessageHandler<Scene, $NAME1$, $NAME1$> 264 | { 265 | protected override async ETTask Run(Scene scene, $NAME1$ request, $NAME1$ response) 266 | { 267 | 268 | await ETTask.CompletedTask; 269 | } 270 | } 271 | } 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | True 309 | True 310 | 311 | 312 | 313 | 314 | True 315 | 0 316 | True 317 | etReplEmpty() 318 | -1 319 | 1 320 | True 321 | True 322 | 2.0 323 | InCSharpFile 324 | aStaticMethod 325 | True 326 | public static void $NAME1$(this $RESP$ self) 327 | { 328 | 329 | } 330 | True 331 | True 332 | cs 333 | ETComponent 334 | True 335 | &ETServerAMHandler 336 | True 337 | getAlphaNumericFileNameWithoutExtension() 338 | -1 339 | 0 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | True 348 | etReplEmpty() 349 | -1 350 | 1 351 | 352 | 353 | 354 | CSharp 355 | True 356 | True 357 | InCSharpProjectFile 358 | True 359 | 360 | using System; 361 | 362 | namespace ET.Client 363 | { 364 | [MessageSessionHandler(SceneType.Gate)] 365 | public class $CLASS$ : MessageSessionHandler<$Req$> 366 | { 367 | protected override async ETTask Run(Session session, $Req$ message) 368 | { 369 | await ETTask.CompletedTask; 370 | $END$ 371 | } 372 | } 373 | } 374 | ET/Server 375 | True 376 | True 377 | True 378 | 0 379 | 380 | 381 | 382 | True 383 | True 384 | 2.0 385 | InCSharpFile 386 | aAMRpcHandler 387 | True 388 | using System; 389 | 390 | namespace ET 391 | { 392 | [MessageSessionHandler(SceneType.Gate)] 393 | public class $NAME1$Handler : MessageSessionHandler<$NAME1$, $NAME1$> 394 | { 395 | protected override async ETTask Run(Session session, $NAME1$ request, $NAME1$ response, Action reply) 396 | { 397 | 398 | await ETTask.CompletedTask; 399 | } 400 | } 401 | } 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | True 454 | True 455 | True 456 | 0 457 | True 458 | True 459 | 2.0 460 | InCSharpFile 461 | aStaticAsyncHelpMethod 462 | True 463 | public static async ETTask<int> $NAME1$(Scene clientScene) 464 | { 465 | try 466 | { 467 | 468 | } 469 | catch (Exception e) 470 | { 471 | Log.Error(e); 472 | return ErrorCode.ERR_NetWorkError; 473 | } 474 | return ErrorCode.ERR_Success; 475 | } 476 | True 477 | True 478 | True 479 | True 480 | 2.0 481 | InCSharpFile 482 | aCheckERR_Success 483 | True 484 | if (errCode != ErrorCode.ERR_Success) 485 | { 486 | Log.Error(errCode.ToString()); 487 | return; 488 | } 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | True 605 | True 606 | cs 607 | ETEvent 608 | True 609 | &ETEvent 610 | True 611 | getAlphaNumericFileNameWithoutExtension() 612 | -1 613 | 0 614 | True 615 | etSplit0() 616 | -1 617 | 1 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | CSharp 626 | True 627 | True 628 | InCSharpProjectFile 629 | True 630 | 631 | namespace ET.Client 632 | { 633 | [Event(SceneType.Client)] 634 | public class $CLASS$ : AEvent<EventType.$EventName$> 635 | { 636 | protected override async ETTask Run(Scene scene, EventType.$EventName$ args) 637 | { 638 | await ETTask.CompletedTask; 639 | $END$ 640 | } 641 | } 642 | } 643 | ET/Component 644 | True 645 | True 646 | True 647 | 0 648 | True 649 | True 650 | 2.0 651 | InCSharpFile 652 | aNumer 653 | True 654 | public const int $NAME1$ = 1002; 655 | public const int $NAME1$Base = $NAME1$ * 10 + 1; 656 | public const int $NAME1$Add = $NAME1$ * 10 + 2; 657 | public const int $NAME1$Pct = $NAME1$ * 10 + 3; 658 | public const int $NAME1$FinalAdd = $NAME1$ * 10 + 4; 659 | public const int $NAME1$FinalPct = $NAME1$ * 10 + 5; 660 | True 661 | True 662 | True 663 | 0 664 | True 665 | True 666 | 2.0 667 | InCSharpFile 668 | aAMActorLocationHandler 669 | True 670 | using System; 671 | 672 | namespace ET 673 | { 674 | [MessageLocationHandler(SceneType.Map)] 675 | public class $NAME1$Handler : MessageLocationHandler<Unit, $NAME1$> 676 | { 677 | protected override async ETTask Run(Unit unit, $NAME1$ message) 678 | { 679 | 680 | await ETTask.CompletedTask; 681 | } 682 | } 683 | } 684 | True 685 | True 686 | True 687 | True 688 | etReplEmpty() 689 | -1 690 | 1 691 | 692 | 693 | True 694 | etReplEmpty() 695 | -1 696 | 0 697 | True 698 | True 699 | 2.0 700 | InCSharpFile 701 | aMsg2Proto 702 | True 703 | public static void FromMessage(this $classname$ self, $Proto$Proto proto) 704 | { 705 | 706 | } 707 | 708 | public static $Proto$Proto ToMessage(this $classname$ self) 709 | { 710 | return new $Proto$Proto() 711 | { 712 | 713 | }; 714 | } 715 | True 716 | True 717 | cs 718 | ETComponent 719 | True 720 | &ETComponentSystem 721 | True 722 | etReplEmpty() 723 | -1 724 | 0 725 | 726 | 727 | 728 | True 729 | getDefaultNamespace() 730 | -1 731 | 1 732 | CSharp 733 | True 734 | True 735 | InCSharpProjectFile 736 | True 737 | 738 | namespace $NAMESPACE$ 739 | { 740 | [EntitySystemOf(typeof($CLASS$))] 741 | [FriendOf(typeof($CLASS$))] 742 | public static partial class $CLASS$System 743 | { 744 | [EntitySystem] 745 | private static void Awake(this $CLASS$ self) 746 | { 747 | 748 | } 749 | [EntitySystem] 750 | private static void Destroy(this $CLASS$ self) 751 | { 752 | 753 | } 754 | [EntitySystem] 755 | private static void Deserialize(this $CLASS$ self) 756 | { 757 | foreach (Entity entity in self.Children.Values) 758 | { 759 | // self.AddContainer(entity as ItemDB); 760 | } 761 | } 762 | public static void Test(this $CLASS$ self) 763 | { 764 | } 765 | $END$ 766 | } 767 | } 768 | 769 | ET/Component 770 | False 771 | True 772 | True 773 | cs 774 | ETComponent 775 | True 776 | &ETServerAMActorLocationHandler 777 | True 778 | getAlphaNumericFileNameWithoutExtension() 779 | -1 780 | 0 781 | 782 | 783 | 784 | True 785 | etReplEmpty() 786 | -1 787 | 1 788 | 789 | 790 | 791 | 792 | CSharp 793 | True 794 | True 795 | InCSharpProjectFile 796 | True 797 | 798 | namespace ET.Server 799 | { 800 | [MessageLocationHandler(SceneType.Map)] 801 | public class $CLASS$ : MessageLocationHandler<Unit, $MSG$> 802 | { 803 | protected override async ETTask Run(Unit unit, $MSG$ message) 804 | { 805 | await ETTask.CompletedTask; 806 | $END$ 807 | } 808 | } 809 | } 810 | ET/Server 811 | True 812 | True 813 | cs 814 | ETComponent 815 | True 816 | &ETComponent 817 | True 818 | getAlphaNumericFileNameWithoutExtension() 819 | -1 820 | 0 821 | 822 | 823 | 824 | True 825 | getDefaultNamespace() 826 | -1 827 | 1 828 | CSharp 829 | True 830 | True 831 | InCSharpProjectFile 832 | True 833 | using System.Collections.Generic; 834 | namespace $NAMESPACE$ 835 | { 836 | [ComponentOf()] 837 | public class $CLASS$ :Entity,IAwake,IDestroy,IDeserialize,ITransfer,IUnitCache 838 | { 839 | $END$ 840 | } 841 | } 842 | ET/Component 843 | True 844 | True 845 | cs 846 | ETComponent 847 | True 848 | &ETServerAMActorLocationRpcHandler 849 | True 850 | getAlphaNumericFileNameWithoutExtension() 851 | -1 852 | 0 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | True 861 | etReplEmpty() 862 | -1 863 | 2 864 | True 865 | etHandlerReversal() 866 | -1 867 | 1 868 | CSharp 869 | True 870 | True 871 | InCSharpProjectFile 872 | True 873 | 874 | using System; 875 | 876 | namespace ET.Server 877 | { 878 | [MessageLocationHandler(SceneType.Map)] 879 | public class $CLASS$ : MessageLocationHandler<Unit, $Req$,$Resp$> 880 | { 881 | protected override async ETTask Run(Unit unit, $Req$ request, $Resp$ response) 882 | { 883 | await ETTask.CompletedTask; 884 | $END$ 885 | } 886 | } 887 | } 888 | ET/Server 889 | True 890 | True 891 | cs 892 | ETComponent 893 | True 894 | &ETServerAMRpcHandler 895 | True 896 | getAlphaNumericFileNameWithoutExtension() 897 | -1 898 | 0 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | True 907 | etReplEmpty() 908 | -1 909 | 2 910 | True 911 | etHandlerReversal() 912 | -1 913 | 1 914 | CSharp 915 | True 916 | True 917 | InCSharpProjectFile 918 | True 919 | 920 | using System; 921 | 922 | namespace ET.Server 923 | { 924 | [MessageSessionHandler(SceneType.Gate)] 925 | public class $CLASS$ : MessageSessionHandler<$Req$,$RESP$> 926 | { 927 | protected override async ETTask Run(Session session, $Req$ request, $RESP$ response) 928 | { 929 | await ETTask.CompletedTask; 930 | $END$ 931 | } 932 | } 933 | } 934 | ET/Server 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | -------------------------------------------------------------------------------- /MyAwesomePlugin/src/dotnet/ReSharperPlugin.MyAwesomePlugin/Templates/et7.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | True 13 | ETServerAMActorLocationRpcHandler 14 | 14 15 | 9 16 | 17 | 18 | 19 | True 20 | ETServerAMRpcHandler 21 | 17 22 | 23 | 24 | 25 | 6 26 | 27 | 28 | 29 | 30 | 31 | 32 | 7 33 | True 34 | ETComponent 35 | 16 36 | 8 37 | True 38 | ETComponentM 39 | 11 40 | False 41 | True 42 | ETComponent 43 | 12 44 | True 45 | ETEntityModelC 46 | 10 47 | True 48 | ETAMActorLocationHandler 49 | 13 50 | True 51 | ETServerAMActorRpcHandler 52 | 15 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | True 102 | True 103 | True 104 | 0 105 | True 106 | True 107 | 2.0 108 | InCSharpFile 109 | aStaticSystem 110 | True 111 | public static class $NAME1$System 112 | { 113 | 114 | } 115 | True 116 | True 117 | True 118 | 0 119 | 120 | 121 | 122 | True 123 | True 124 | 2.0 125 | InCSharpFile 126 | aAMActorLocationRpcHandler 127 | True 128 | using System; 129 | 130 | namespace ET 131 | { 132 | [ActorMessageHandler(SceneType.Map)] 133 | public class $NAME1$Handler : AMActorLocationRpcHandler<Unit, $NAME1$, $NAME1$> 134 | { 135 | protected override async ETTask Run(Unit unit, $NAME1$ request, $NAME1$ response) 136 | { 137 | await ETTask.CompletedTask; 138 | } 139 | } 140 | } 141 | 142 | True 143 | True 144 | True 145 | 0 146 | True 147 | True 148 | 2.0 149 | InCSharpFile 150 | aATimer 151 | True 152 | [Invoke(TimerInvokeType.$NAME1$)] 153 | public class $NAME1$Time: ATimer<$NAME1$> 154 | { 155 | protected override void Run($NAME1$ self) 156 | { 157 | 158 | } 159 | } 160 | True 161 | True 162 | 163 | 164 | 165 | 166 | True 167 | 0 168 | True 169 | etReplEmpty() 170 | -1 171 | 1 172 | 173 | 174 | True 175 | True 176 | 2.0 177 | InCSharpFile 178 | aStaticAsyncMethod 179 | True 180 | public static async ETTask $NAME1$(this $RESP$ self) 181 | { 182 | 183 | } 184 | True 185 | True 186 | cs 187 | ETComponent 188 | True 189 | &ETServerAMActorRpcHandler 190 | True 191 | getAlphaNumericFileNameWithoutExtension() 192 | -1 193 | 0 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | True 202 | etReplEmpty() 203 | -1 204 | 2 205 | True 206 | etHandlerReversal() 207 | -1 208 | 1 209 | CSharp 210 | True 211 | True 212 | InCSharpProjectFile 213 | True 214 | 215 | using System; 216 | 217 | namespace ET.Server 218 | { 219 | [ActorMessageHandler(SceneType.LoginCenter)] 220 | public class $CLASS$ : AMActorRpcHandler<Scene, $Req$,$RESP$> 221 | { 222 | protected override async ETTask Run(Scene scene, $Req$ request, $RESP$ response) 223 | { 224 | await ETTask.CompletedTask; 225 | $END$ 226 | } 227 | } 228 | } 229 | ET/Server 230 | True 231 | True 232 | True 233 | 0 234 | 235 | 236 | 237 | True 238 | True 239 | 2.0 240 | InCSharpFile 241 | aAMActorRpcHandler 242 | True 243 | using System; 244 | 245 | namespace ET 246 | { 247 | [ActorMessageHandler(SceneType.LoginCenter)] 248 | public class $NAME1$Handler: AMActorRpcHandler<Scene, $NAME1$, $NAME1$> 249 | { 250 | protected override async ETTask Run(Scene scene, $NAME1$ request, $NAME1$ response) 251 | { 252 | 253 | await ETTask.CompletedTask; 254 | } 255 | } 256 | } 257 | True 258 | True 259 | True 260 | True 261 | 2.0 262 | InCSharpFile 263 | aSelfView 264 | True 265 | self.View. 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | True 294 | True 295 | 296 | 297 | 298 | 299 | True 300 | 0 301 | True 302 | etReplEmpty() 303 | -1 304 | 1 305 | True 306 | True 307 | 2.0 308 | InCSharpFile 309 | aStaticMethod 310 | True 311 | public static void $NAME1$(this $RESP$ self) 312 | { 313 | 314 | } 315 | True 316 | True 317 | cs 318 | ETComponent 319 | True 320 | &ETServerAMHandler 321 | True 322 | getAlphaNumericFileNameWithoutExtension() 323 | -1 324 | 0 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | True 333 | etReplEmpty() 334 | -1 335 | 1 336 | 337 | 338 | 339 | CSharp 340 | True 341 | True 342 | InCSharpProjectFile 343 | True 344 | 345 | using System; 346 | 347 | namespace ET.Client 348 | { 349 | [MessageHandler(SceneType.Client)] 350 | public class $CLASS$ : AMHandler<$Req$> 351 | { 352 | protected override async ETTask Run(Session session, $Req$ message) 353 | { 354 | await ETTask.CompletedTask; 355 | $END$ 356 | } 357 | } 358 | } 359 | ET/Server 360 | True 361 | True 362 | True 363 | 0 364 | 365 | 366 | 367 | True 368 | True 369 | 2.0 370 | InCSharpFile 371 | aAMRpcHandler 372 | True 373 | using System; 374 | 375 | namespace ET 376 | { 377 | [MessageHandler(SceneType.Account)] 378 | public class $NAME1$Handler : AMRpcHandler<$NAME1$, $NAME1$> 379 | { 380 | protected override async ETTask Run(Session session, $NAME1$ request, $NAME1$ response, Action reply) 381 | { 382 | 383 | await ETTask.CompletedTask; 384 | } 385 | } 386 | } 387 | True 388 | True 389 | True 390 | 0 391 | True 392 | True 393 | 2.0 394 | InCSharpFile 395 | aAwakeSystem 396 | True 397 | [ObjectSystem] 398 | public class $NAME1$AwakeSystem: AwakeSystem<$NAME1$> 399 | { 400 | protected override void Awake($NAME1$ self) 401 | { 402 | } 403 | } 404 | True 405 | True 406 | True 407 | 0 408 | True 409 | True 410 | 2.0 411 | InCSharpFile 412 | aCheckSceneTypeErr 413 | True 414 | if (scene.SceneType != SceneType.$NAME1$) 415 | { 416 | Log.Error($"请求的Scene错误,当前Scene为:{scene.SceneType}"); 417 | response.Error = ErrorCode.Err_RequestSceneTypeError; 418 | return; 419 | } 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | True 448 | True 449 | True 450 | 0 451 | True 452 | True 453 | 2.0 454 | InCSharpFile 455 | aStaticAsyncHelpMethod 456 | True 457 | public static async ETTask<int> $NAME1$(Scene clientScene) 458 | { 459 | try 460 | { 461 | 462 | } 463 | catch (Exception e) 464 | { 465 | Log.Error(e); 466 | return ErrorCode.ERR_NetWorkError; 467 | } 468 | return ErrorCode.ERR_Success; 469 | } 470 | True 471 | True 472 | True 473 | True 474 | 2.0 475 | InCSharpFile 476 | aCheckERR_Success 477 | True 478 | if (errCode != ErrorCode.ERR_Success) 479 | { 480 | Log.Error(errCode.ToString()); 481 | return; 482 | } 483 | True 484 | True 485 | True 486 | 2 487 | True 488 | 1 489 | True 490 | 3 491 | True 492 | 0 493 | True 494 | True 495 | 2.0 496 | InCSharpFile 497 | aServerCallRpc 498 | True 499 | $Response$ $msgResponse$ = ($Response$)await MessageHelper.CallActor($InstanceId$, new $Request$(){}); 500 | if ($msgResponse$.Error != ErrorCode.ERR_Success) 501 | { 502 | response.Error = $msgResponse$.Error; 503 | reply(); 504 | session?.Disconnect().Coroutine(); 505 | return; 506 | } 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | True 558 | True 559 | True 560 | 0 561 | True 562 | True 563 | 2.0 564 | InCSharpFile 565 | aDeserializeSystem 566 | True 567 | [ObjectSystem] 568 | public class $NAME1$DeserializeSystem : DeserializeSystem<$NAME1$> 569 | { 570 | protected override void Deserialize($NAME1$ self) 571 | { 572 | foreach (Entity entity in self.Children.Values) 573 | { 574 | self.AddContainer(entity as Item); 575 | } 576 | } 577 | } 578 | True 579 | True 580 | True 581 | 0 582 | True 583 | 1 584 | True 585 | True 586 | 2.0 587 | InCSharpFile 588 | aCoroutineLock 589 | True 590 | using (await CoroutineLockComponent.Instance.Wait(CoroutineLockType.$NAME1$,$NAME2$)) 591 | { 592 | 593 | } 594 | 595 | True 596 | True 597 | True 598 | True 599 | 2.0 600 | InCSharpFile 601 | aCheckSessionLockingComponent 602 | True 603 | // 防止重复请求 604 | if (session.GetComponent<SessionLockingComponent>() != null) 605 | { 606 | response.Error = ErrorCode.RequestRepeatedly; 607 | reply(); 608 | session.Disconnect().Coroutine(); 609 | return; 610 | } 611 | True 612 | True 613 | True 614 | 0 615 | True 616 | True 617 | 2.0 618 | InCSharpFile 619 | aDestroySystem 620 | True 621 | 622 | [ObjectSystem] 623 | public class $NAME1$DestroySystem: DestroySystem<$NAME1$> 624 | { 625 | protected override void Destroy($NAME1$ self) 626 | { 627 | } 628 | } 629 | 630 | True 631 | True 632 | cs 633 | ETEvent 634 | True 635 | &ETEvent 636 | True 637 | getAlphaNumericFileNameWithoutExtension() 638 | -1 639 | 0 640 | True 641 | etSplit0() 642 | -1 643 | 1 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | CSharp 652 | True 653 | True 654 | InCSharpProjectFile 655 | True 656 | 657 | namespace ET.Client 658 | { 659 | [Event(SceneType.Client)] 660 | public class $CLASS$ : AEvent<EventType.$EventName$> 661 | { 662 | protected override async ETTask Run(Scene scene, EventType.$EventName$ args) 663 | { 664 | await ETTask.CompletedTask; 665 | $END$ 666 | } 667 | } 668 | } 669 | ET/Component 670 | True 671 | True 672 | True 673 | 0 674 | True 675 | True 676 | 2.0 677 | InCSharpFile 678 | aAMActorLocationHandler 679 | True 680 | using System; 681 | 682 | namespace ET 683 | { 684 | [ActorMessageHandler(SceneType.Map)] 685 | public class $NAME1$Handler : AMActorLocationHandler<Unit, $NAME1$> 686 | { 687 | protected override async ETTask Run(Unit unit, $NAME1$ message) 688 | { 689 | 690 | await ETTask.CompletedTask; 691 | } 692 | } 693 | } 694 | True 695 | True 696 | True 697 | True 698 | etReplEmpty() 699 | -1 700 | 1 701 | 702 | 703 | True 704 | 0 705 | True 706 | True 707 | 2.0 708 | InCSharpFile 709 | aMsg2Proto 710 | True 711 | public static void FromMessage(this $classname$ self, $Proto$ proto) 712 | { 713 | 714 | } 715 | 716 | public static $Proto$ ToMessage(this $classname$ self) 717 | { 718 | return new $Proto$() 719 | { 720 | 721 | }; 722 | } 723 | True 724 | True 725 | cs 726 | ETComponent 727 | True 728 | &ETComponentSystem 729 | True 730 | etReplEmpty() 731 | -1 732 | 0 733 | 734 | 735 | 736 | True 737 | getDefaultNamespace() 738 | -1 739 | 1 740 | CSharp 741 | True 742 | True 743 | InCSharpProjectFile 744 | True 745 | 746 | namespace $NAMESPACE$ 747 | { 748 | [ObjectSystem] 749 | public class $CLASS$AwakeSystem: AwakeSystem<$CLASS$> 750 | { 751 | protected override void Awake($CLASS$ self) 752 | { 753 | 754 | } 755 | } 756 | [ObjectSystem] 757 | public class $CLASS$DestroySystem: DestroySystem<$CLASS$> 758 | { 759 | protected override void Destroy($CLASS$ self) 760 | { 761 | 762 | } 763 | } 764 | [ObjectSystem] 765 | public class $CLASS$DeserializeSystem : DeserializeSystem<$CLASS$> 766 | { 767 | protected override void Deserialize($CLASS$ self) 768 | { 769 | foreach (Entity entity in self.Children.Values) 770 | { 771 | // self.AddContainer(entity as Item); 772 | } 773 | } 774 | } 775 | 776 | [FriendOf(typeof($CLASS$))] 777 | public static class $CLASS$System 778 | { 779 | public static void Test(this $CLASS$ self) 780 | { 781 | } 782 | $END$ 783 | } 784 | } 785 | 786 | ET/Component 787 | False 788 | True 789 | True 790 | cs 791 | ETComponent 792 | True 793 | &ETServerAMActorLocationHandler 794 | True 795 | getAlphaNumericFileNameWithoutExtension() 796 | -1 797 | 0 798 | 799 | 800 | 801 | True 802 | etReplEmpty() 803 | -1 804 | 1 805 | 806 | 807 | 808 | 809 | CSharp 810 | True 811 | True 812 | InCSharpProjectFile 813 | True 814 | 815 | namespace ET.Server 816 | { 817 | [ActorMessageHandler(SceneType.Map)] 818 | public class $CLASS$ : AMActorLocationHandler<Unit, $MSG$> 819 | { 820 | protected override async ETTask Run(Unit unit, $MSG$ message) 821 | { 822 | await ETTask.CompletedTask; 823 | $END$ 824 | } 825 | } 826 | } 827 | ET/Server 828 | True 829 | True 830 | cs 831 | ETComponent 832 | True 833 | &ETComponent 834 | True 835 | getAlphaNumericFileNameWithoutExtension() 836 | -1 837 | 0 838 | 839 | 840 | 841 | True 842 | getDefaultNamespace() 843 | -1 844 | 1 845 | CSharp 846 | True 847 | True 848 | InCSharpProjectFile 849 | True 850 | using System.Collections.Generic; 851 | namespace $NAMESPACE$ 852 | { 853 | [ComponentOf()] 854 | public class $CLASS$ :Entity,IAwake,IDestroy,IDeserialize,ITransfer,IUnitCache 855 | { 856 | $END$ 857 | } 858 | } 859 | ET/Component 860 | True 861 | True 862 | cs 863 | ETComponent 864 | True 865 | &ETServerAMActorLocationRpcHandler 866 | True 867 | getAlphaNumericFileNameWithoutExtension() 868 | -1 869 | 0 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | True 878 | etReplEmpty() 879 | -1 880 | 2 881 | True 882 | etHandlerReversal() 883 | -1 884 | 1 885 | CSharp 886 | True 887 | True 888 | InCSharpProjectFile 889 | True 890 | 891 | using System; 892 | 893 | namespace ET.Server 894 | { 895 | [ActorMessageHandler(SceneType.Map)] 896 | public class $CLASS$ : AMActorLocationRpcHandler<Unit, $Req$,$Resp$> 897 | { 898 | protected override async ETTask Run(Unit unit, $Req$ request, $Resp$ response) 899 | { 900 | await ETTask.CompletedTask; 901 | $END$ 902 | } 903 | } 904 | } 905 | ET/Server 906 | True 907 | True 908 | cs 909 | ETComponent 910 | True 911 | &ETServerAMRpcHandler 912 | True 913 | getAlphaNumericFileNameWithoutExtension() 914 | -1 915 | 0 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | True 924 | etReplEmpty() 925 | -1 926 | 2 927 | True 928 | etHandlerReversal() 929 | -1 930 | 1 931 | CSharp 932 | True 933 | True 934 | InCSharpProjectFile 935 | True 936 | 937 | using System; 938 | 939 | namespace ET.Server 940 | { 941 | [MessageHandler(SceneType.Account)] 942 | public class $CLASS$ : AMRpcHandler<$Req$,$RESP$> 943 | { 944 | protected override async ETTask Run(Session session, $Req$ request, $RESP$ response) 945 | { 946 | await ETTask.CompletedTask; 947 | $END$ 948 | } 949 | } 950 | } 951 | ET/Server 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | --------------------------------------------------------------------------------