Skip to content

Commit 20c60b6

Browse files
Added code generation for OnXyz and SendXyz methods (1/2) (#256)
* Added code generation * Added a few examples * Added custom method names * Updated with class name
1 parent eb589ef commit 20c60b6

25 files changed

+2636
-218
lines changed

Directory.Build.targets

+5
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,10 @@
4343
<PackageReference Update="Xunit.SkippableFact" Version="1.4.8" />
4444
<PackageReference Update="System.IO.Pipelines" Version="4.7.1"/>
4545
<PackageReference Update="Nerdbank.Streams" Version="2.4.60" />
46+
<PackageReference Update="CodeGeneration.Roslyn.Attributes" Version="0.7.63" PrivateAssets="all" />
47+
<PackageReference Update="CodeGeneration.Roslyn.Engine" Version="0.7.63" />
48+
<PackageReference Update="CodeGeneration.Roslyn.Tool" Version="0.7.63" PrivateAssets="all" />
49+
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="3.4.0" />
50+
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.4.0" />
4651
</ItemGroup>
4752
</Project>

LSP.sln

+30-5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Protocol", "src\Protocol\Pr
4444
EndProject
4545
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "src\Server\Server.csproj", "{E540868F-438E-4F7F-BBB7-010D6CB18A57}"
4646
EndProject
47-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7E4A7675-45F3-4636-88AC-2C158C1A140D}"
48-
ProjectSection(SolutionItems) = preProject
49-
cake.config = cake.config
50-
EndProjectSection
51-
EndProject
5247
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dap.Protocol", "src\Dap.Protocol\Dap.Protocol.csproj", "{F2C9D555-118E-442B-A953-9A7B58A53F33}"
5348
EndProject
5449
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dap.Server", "src\Dap.Server\Dap.Server.csproj", "{E1A9123B-A236-4240-8C82-A61BD85C3BF4}"
@@ -73,6 +68,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testing", "src\Testing\Test
7368
EndProject
7469
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JsonRpc.Testing", "src\JsonRpc.Testing\JsonRpc.Testing.csproj", "{202BA1AB-25DA-44ED-B962-FD82FCC74543}"
7570
EndProject
71+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JsonRpc.Generators", "src\JsonRpc.Generators\JsonRpc.Generators.csproj", "{DE259174-73DC-4532-B641-AD218971EE29}"
72+
EndProject
73+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generation.Tests", "test\Generation.Tests\Generation.Tests.csproj", "{671FFF78-BDD2-4389-B29C-BFD183DA9120}"
74+
EndProject
7675
Global
7776
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7877
Debug|Any CPU = Debug|Any CPU
@@ -293,6 +292,30 @@ Global
293292
{202BA1AB-25DA-44ED-B962-FD82FCC74543}.Release|x64.Build.0 = Release|Any CPU
294293
{202BA1AB-25DA-44ED-B962-FD82FCC74543}.Release|x86.ActiveCfg = Release|Any CPU
295294
{202BA1AB-25DA-44ED-B962-FD82FCC74543}.Release|x86.Build.0 = Release|Any CPU
295+
{DE259174-73DC-4532-B641-AD218971EE29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
296+
{DE259174-73DC-4532-B641-AD218971EE29}.Debug|Any CPU.Build.0 = Debug|Any CPU
297+
{DE259174-73DC-4532-B641-AD218971EE29}.Debug|x64.ActiveCfg = Debug|Any CPU
298+
{DE259174-73DC-4532-B641-AD218971EE29}.Debug|x64.Build.0 = Debug|Any CPU
299+
{DE259174-73DC-4532-B641-AD218971EE29}.Debug|x86.ActiveCfg = Debug|Any CPU
300+
{DE259174-73DC-4532-B641-AD218971EE29}.Debug|x86.Build.0 = Debug|Any CPU
301+
{DE259174-73DC-4532-B641-AD218971EE29}.Release|Any CPU.ActiveCfg = Release|Any CPU
302+
{DE259174-73DC-4532-B641-AD218971EE29}.Release|Any CPU.Build.0 = Release|Any CPU
303+
{DE259174-73DC-4532-B641-AD218971EE29}.Release|x64.ActiveCfg = Release|Any CPU
304+
{DE259174-73DC-4532-B641-AD218971EE29}.Release|x64.Build.0 = Release|Any CPU
305+
{DE259174-73DC-4532-B641-AD218971EE29}.Release|x86.ActiveCfg = Release|Any CPU
306+
{DE259174-73DC-4532-B641-AD218971EE29}.Release|x86.Build.0 = Release|Any CPU
307+
{671FFF78-BDD2-4389-B29C-BFD183DA9120}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
308+
{671FFF78-BDD2-4389-B29C-BFD183DA9120}.Debug|Any CPU.Build.0 = Debug|Any CPU
309+
{671FFF78-BDD2-4389-B29C-BFD183DA9120}.Debug|x64.ActiveCfg = Debug|Any CPU
310+
{671FFF78-BDD2-4389-B29C-BFD183DA9120}.Debug|x64.Build.0 = Debug|Any CPU
311+
{671FFF78-BDD2-4389-B29C-BFD183DA9120}.Debug|x86.ActiveCfg = Debug|Any CPU
312+
{671FFF78-BDD2-4389-B29C-BFD183DA9120}.Debug|x86.Build.0 = Debug|Any CPU
313+
{671FFF78-BDD2-4389-B29C-BFD183DA9120}.Release|Any CPU.ActiveCfg = Release|Any CPU
314+
{671FFF78-BDD2-4389-B29C-BFD183DA9120}.Release|Any CPU.Build.0 = Release|Any CPU
315+
{671FFF78-BDD2-4389-B29C-BFD183DA9120}.Release|x64.ActiveCfg = Release|Any CPU
316+
{671FFF78-BDD2-4389-B29C-BFD183DA9120}.Release|x64.Build.0 = Release|Any CPU
317+
{671FFF78-BDD2-4389-B29C-BFD183DA9120}.Release|x86.ActiveCfg = Release|Any CPU
318+
{671FFF78-BDD2-4389-B29C-BFD183DA9120}.Release|x86.Build.0 = Release|Any CPU
296319
EndGlobalSection
297320
GlobalSection(SolutionProperties) = preSolution
298321
HideSolutionNode = FALSE
@@ -316,6 +339,8 @@ Global
316339
{91919C54-3638-4A3C-963A-327D78368EE3} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
317340
{A1EC39EE-AA1F-4EC9-9939-28C3532585C9} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
318341
{202BA1AB-25DA-44ED-B962-FD82FCC74543} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
342+
{DE259174-73DC-4532-B641-AD218971EE29} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
343+
{671FFF78-BDD2-4389-B29C-BFD183DA9120} = {2F323ED5-EBF8-45E1-B9D3-C014561B3DDA}
319344
EndGlobalSection
320345
GlobalSection(ExtensibilityGlobals) = postSolution
321346
SolutionGuid = {D38DD0EC-D095-4BCD-B8AF-2D788AF3B9AE}

src/Dap.Protocol/Dap.Protocol.csproj

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
<ItemGroup>
1212
<ProjectReference Include="..\JsonRpc\JsonRpc.csproj" />
13+
<ProjectReference Include="..\JsonRpc.Generators\JsonRpc.Generators.csproj" OutputItemType="CodeGenerationRoslynPlugin" PrivateAssets="all" />
14+
<PackageReference Include="CodeGeneration.Roslyn.Tool" />
1315
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
1416
<_Parameter1>OmniSharp.Extensions.LanguageServer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100391db875e68eb4bfef49ce14313b9e13f2cd3cc89eb273bbe6c11a55044c7d4f566cf092e1c77ef9e7c75b1496ae7f95d925938f5a01793dd8d9f99ae0a7595779b71b971287d7d7b5960d052078d14f5ce1a85ea5c9fb2f59ac735ff7bc215cab469b7c3486006860bad6f4c3b5204ea2f28dd4e1d05e2cca462cfd593b9f9f</_Parameter1>
1517
</AssemblyAttribute>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<Sdk Name="CodeGeneration.Roslyn.PluginMetapackage.Sdk" Version="0.7.63"/>
3+
4+
<PropertyGroup>
5+
<TargetFramework>netstandard1.0</TargetFramework>
6+
<AssemblyName>OmniSharp.Extensions.JsonRpc.Generation</AssemblyName>
7+
<RootNamespace>OmniSharp.Extensions.JsonRpc.Generation</RootNamespace>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<ProjectReference Include="../JsonRpc/JsonRpc.csproj"/>
12+
<NupkgAdditionalDependency Include="OmniSharp.Extensions.JsonRpc.Generators" IncludeAssets="all"/>
13+
</ItemGroup>
14+
15+
</Project>

0 commit comments

Comments
 (0)