Skip to content

Commit

Permalink
fixed Adds extra param for Func<T, bool> #19
Browse files Browse the repository at this point in the history
  • Loading branch information
k--kato committed Dec 1, 2016
1 parent 62ef677 commit e447670
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Change Log

## 0.0.8 (December 2, 2016)

* bug fix - Adds extra param for `Func<T, bool>`. See [#19](https://github.com/k--kato/vscode-docomment/issues/19).

## 0.0.7 (July 11, 2016)

## 0.0.6 (Jun 24, 2016)

## 0.0.5 (April 2, 2016)

## 0.0.4 (February 7, 2016)

## 0.0.3 (January 24, 2016)

## 0.0.2 (January 14, 2016)

## 0.0.1 (January 4, 2016)
17 changes: 13 additions & 4 deletions src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,19 @@ export class SyntacticAnalysisCSharp {

let paramName: Array<string> = new Array<string>();
params[1].split(',').forEach(param => {
const hasOptionaParam: boolean = param.match(/\S+\s+\S+\s*=/) !== null;
const name: RegExpMatchArray = (hasOptionaParam)
? param.match(/\S+\s+(\S+)\s*=.*/)
: param.match(/(\S+)\s*$/);
const hasOptionalParam: boolean = param.match(/\S+\s+\S+\s*=/) !== null;
const hasGenericParam: boolean = param.match(/[<]/) !== null;
const hasTypeInfo: boolean = param.match(/[\w\W]+\s+[\w\W]+/) !== null;
let name: RegExpMatchArray = null;
if (hasOptionalParam) {
name = param.match(/\S+\s+(\S+)\s*=.*/)
} else if (hasGenericParam) {
name = null; // SKIP
} else if (!hasTypeInfo) {
name = null; // SKIP
} else {
name = param.match(/(\S+)\s*$/);
}
if (name !== null && name.length === 2) {
paramName.push(name[1]);
}
Expand Down
2 changes: 2 additions & 0 deletions test/TestData/X.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ public class Nested{} // "T:N.X.Nested"
[Route("{time}/{location}")]
[HttpGet]
public async Task<string> GetInfoForTime(string location, double time)
public Collection<T> Filter(Func<T, bool> query) { }
public Collection<T> Filter(Func<T, bool> queryFirst, Func<T, U, V> querySecond) { }
}
}

0 comments on commit e447670

Please sign in to comment.