Немного рефакторинга
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
// <auto-generated/>
|
|
||||||
|
|
||||||
namespace RPCTest.Implementation
|
|
||||||
{
|
|
||||||
public sealed class GenerativeParametersTestClass
|
|
||||||
{
|
|
||||||
public int Increment(<!L param>)
|
|
||||||
{
|
|
||||||
return i + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -37,7 +37,6 @@
|
|||||||
<EmbeddedResource Include="PartialInterface.cstmpl"/>
|
<EmbeddedResource Include="PartialInterface.cstmpl"/>
|
||||||
<EmbeddedResource Include="RemoteEndpoint.cstmpl"/>
|
<EmbeddedResource Include="RemoteEndpoint.cstmpl"/>
|
||||||
<EmbeddedResource Include="RemoteTypeBinder.cstmpl"/>
|
<EmbeddedResource Include="RemoteTypeBinder.cstmpl"/>
|
||||||
<EmbeddedResource Include="TestClass.cstmpl" />
|
|
||||||
<None Remove="MethodRepo.cstmpl"/>
|
<None Remove="MethodRepo.cstmpl"/>
|
||||||
<EmbeddedResource Include="MethodRepo.cstmpl"/>
|
<EmbeddedResource Include="MethodRepo.cstmpl"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ namespace mROA.Codegen
|
|||||||
#if !DONT_ADD
|
#if !DONT_ADD
|
||||||
var template = TemplateReader.FromEmbeddedResource("TestClass.cstmpl");
|
var template = TemplateReader.FromEmbeddedResource("TestClass.cstmpl");
|
||||||
template.AddDefine("param", "System.Int32 i");
|
template.AddDefine("param", "System.Int32 i");
|
||||||
|
|
||||||
context.AddSource("TestClass.g.cs", SourceText.From(template.Compile(), Encoding.UTF8));
|
context.AddSource("TestClass.g.cs", SourceText.From(template.Compile(), Encoding.UTF8));
|
||||||
context.AddSource("CoCodegenMethodRepository.g.cs", SourceText.From(coCodegenRepoCode, Encoding.UTF8));
|
context.AddSource("CoCodegenMethodRepository.g.cs", SourceText.From(coCodegenRepoCode, Encoding.UTF8));
|
||||||
#endif
|
#endif
|
||||||
@@ -564,7 +564,7 @@ namespace mROA.Codegen
|
|||||||
{
|
{
|
||||||
return parameter.Type.ToUnityString() + " " + parameter.Name;
|
return parameter.Type.ToUnityString() + " " + parameter.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string ToFullString(ITypeSymbol type)
|
private static string ToFullString(ITypeSymbol type)
|
||||||
{
|
{
|
||||||
return type.ToUnityString();
|
return type.ToUnityString();
|
||||||
@@ -612,16 +612,18 @@ namespace mROA.Codegen
|
|||||||
{
|
{
|
||||||
var parts = type.ToDisplayParts();
|
var parts = type.ToDisplayParts();
|
||||||
|
|
||||||
if (parts.Any(i => i.Kind == SymbolDisplayPartKind.Keyword)) return parts.ToUnityString();
|
if (parts.Any(i => i.Kind == SymbolDisplayPartKind.Keyword))
|
||||||
|
return parts.ToUnityString();
|
||||||
|
|
||||||
return type.ToDisplayString();
|
return type.ToDisplayString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string ToUnityString(this IParameterSymbol parameter)
|
public static string ToUnityString(this IParameterSymbol parameter)
|
||||||
{
|
{
|
||||||
return parameter.Type.ToUnityString() + " " + parameter.Name;
|
return parameter.Type.ToUnityString() + " " + parameter.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string ToUnityString(this ImmutableArray<SymbolDisplayPart> parts)
|
public static string ToUnityString(this ImmutableArray<SymbolDisplayPart> parts)
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
|
|||||||
Reference in New Issue
Block a user