Skip to content

Commit

Permalink
Merge pull request #33 from k--kato/#32
Browse files Browse the repository at this point in the history
Fixed #32 Parameters are not returned
  • Loading branch information
Keisuke KATO authored Jan 30, 2017
2 parents 8aada6a + f74d764 commit 26ba08a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 0.0.13 (January 31, 2017)

* bug fix - Parameters are not returned . See [#32](https://github.com/k--kato/vscode-docomment/issues/32).

## 0.0.12 (January 21, 2017)

* bug fix - Output document puts cursor in wrong place. See [#26](https://github.com/k--kato/vscode-docomment/issues/26).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docomment",
"version": "0.0.12",
"version": "0.0.13",
"publisher": "k--kato",
"engines": {
"vscode": "^1.8.0"
Expand Down
3 changes: 2 additions & 1 deletion src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ export class SyntacticAnalysisCSharp {

public static GetMethodParamNameList(code: string): Array<string> {
if (code === null) return null;
const params: RegExpMatchArray = code.match(/[\w\S]\s+[\w\S]+\s*\(([^)]*)\)/);
const removedAttrCode: string = code.replace(/^\s*\[.+?\]/, ''); // FIXME:
const params: RegExpMatchArray = removedAttrCode.match(/[\w\S]\s+[\w\S]+\s*\(([^)]*)\)/);

const isMatched = (params === null || params.length !== 2);
if (isMatched) return null;
Expand Down
4 changes: 4 additions & 0 deletions test/TestData/X.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@ public void Save(string data, Action<AchievementSavedResponse> onComplete = null
public Collection<T> Filter(Func<T, bool> queryFirst, Func<T, U, V> querySecond) { return null; }
public void Test(string options) : base(options) { }
public void Testing2(string String1, string String2, string String3) : base() { }
[HttpGet]
[Route("{userId}")]
public object Get(int userId) { return null; }
public object Get(int[] userId, string[] val) { return null; }
}
}

0 comments on commit 26ba08a

Please sign in to comment.