diff --git a/src/Domain/Lang/DocommentDomainCSharp.ts b/src/Domain/Lang/DocommentDomainCSharp.ts index 33c2feb..80305b8 100644 --- a/src/Domain/Lang/DocommentDomainCSharp.ts +++ b/src/Domain/Lang/DocommentDomainCSharp.ts @@ -129,6 +129,7 @@ export class DocommentDomainCSharp extends DocommentDomain { let genericList: Array = null; let paramNameList: Array = null; let hasReturn = false; + let hasValue = false; switch (codeType) { case CodeType.Namespace: @@ -158,7 +159,7 @@ export class DocommentDomainCSharp extends DocommentDomain { case CodeType.Field: break; case CodeType.Property: - hasReturn = SyntacticAnalysisCSharp.HasPropertyReturn(code); + hasValue = true; break; case CodeType.Comment: return '/// '; @@ -168,7 +169,7 @@ export class DocommentDomainCSharp extends DocommentDomain { return ''; } - return this.GeneSummary(code, genericList, paramNameList, hasReturn); + return this.GeneSummary(code, genericList, paramNameList, hasReturn, hasValue); } /* @implements */ @@ -208,7 +209,7 @@ export class DocommentDomainCSharp extends DocommentDomain { * Private Method *-----------------------------------------------------------------------*/ - private GeneSummary(code: string, genericList: Array, paramNameList: Array, hasReturn: boolean): string { + private GeneSummary(code: string, genericList: Array, paramNameList: Array, hasReturn: boolean, hasValue: boolean): string { let docommentList: Array = new Array(); @@ -236,6 +237,11 @@ export class DocommentDomainCSharp extends DocommentDomain { docommentList.push(''); } + /* */ + if (hasValue) { + docommentList.push(''); + } + // Format const indentBaseLine: string = this._vsCodeApi.ReadLineAtCurrent(); const indent: string = StringUtil.GetIndent(code, indentBaseLine, this._config.insertSpaces, this._config.detectIdentation); diff --git a/test/TestData/X.cs b/test/TestData/X.cs index 2469e78..e79e9f4 100644 --- a/test/TestData/X.cs +++ b/test/TestData/X.cs @@ -45,6 +45,8 @@ public void Testing2(string String1, string String2, string String3) : base() { public string Test(T obj) where T : class { } public static BoolVector operator |(BoolScalar a, BoolVector b) { } public string[] ss = new string[2] { } + public string Foo { get; set; } + public string Bar { get; set; } = "bar"; } class NodeItem where T : System.IComparable, new() { } class SpecialNodeItem : NodeItem where T : System.IComparable, new() { }