Skip to content

Commit

Permalink
Merge pull request kasecato#48 from k--kato/kasecato#45
Browse files Browse the repository at this point in the history
fixed kasecato#45 Bug: return tag missing
  • Loading branch information
Keisuke KATO authored Jun 25, 2017
2 parents 362bda4 + af31ab9 commit 0092b71
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 0.0.16 (Jun 25, 2017)

* bug fix - Fix some duping. See [#47](https://github.com/k--kato/vscode-docomment/pull/47).
* bug fix - Bug: return tag missing. See [#45](https://github.com/k--kato/vscode-docomment/issues/45).

## 0.0.15 (May 19, 2017)

Expand Down
20 changes: 14 additions & 6 deletions src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,20 @@ export class SyntacticAnalysisCSharp {

public static HasMethodReturn(code: string): boolean {
if (code === null) return false;
const returns: RegExpMatchArray = code.match(/([\w\S]+)\s+[\w\S]+\s*\(.*\)/);

const isMatched = (returns === null || returns.length !== 2);
if (isMatched) return false;

return (returns[1].match(this.RESERVED_WORDS) === null) ? true : false;
{
const returns: RegExpMatchArray = code.match(/([\w\S]+)\s+[\w\S]+\s*\(.*\)/);
const isMatched = (returns !== null && returns.length === 2);
const isReserved = (returns[1].match(this.RESERVED_WORDS) !== null);
if (isMatched && !isReserved) return true;
}
{
const returns: RegExpMatchArray = code.match(/([\w\S]+)\s+[\w\S]+\s+[\w\S]+\s*\(.*\)/);
const isMatched = (returns !== null && returns.length === 2);
const isReserved = (returns[1].match(this.RESERVED_WORDS) !== null);
if (isMatched && !isReserved) return true;
}

return false;
}

public static HasPropertyReturn(code: string): boolean {
Expand Down
1 change: 1 addition & 0 deletions test/TestData/X.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ public void Testing2(string String1, string String2, string String3) : base() {
[Route("{cameraId}/readings")]
public IActionResult GetReadingsForCamera(int[] cameraId, int[] offset, int[] limit, string orderBy) { return null; }
public string Test<T>(T obj) where T : class { }
public static BoolVector operator |(BoolScalar a, BoolVector b)
}
}

0 comments on commit 0092b71

Please sign in to comment.