diff --git a/.travis.yml b/.travis.yml index 128dbd1..6e18bee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,11 @@ os: - osx - linux +cache: + bundler: true + directories: + - node_modules # NPM packages + before_install: - if [ $TRAVIS_OS_NAME == "linux" ]; then export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0; diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c0f65e1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,19 @@ +# Change Log + +## 0.0.8 (December 2, 2016) + +* bug fix - Adds extra param for `Func`. 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) diff --git a/package.json b/package.json index 4414094..f5accf4 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "docomment", - "version": "0.0.7", + "version": "0.0.8", "publisher": "k--kato", "engines": { - "vscode": "^1.3.x" + "vscode": "^1.7.x" }, "displayName": "C# XML Documentation Comments", "description": "Generate C# XML documentation comments for ///", @@ -45,20 +45,22 @@ "dependencies": { }, "devDependencies": { - "typescript": "^1.8.10", - "vscode": "^0.11.14", - "tslint": "^3.13.0", - "istanbul": "^0.4.4", - "coveralls": "^2.11.9", - "mocha": "^2.5.3", - "mocha-lcov-reporter": "^1.2.0" + "typescript": "^2.0.10", + "vscode": "^1.0.3", + "tslint": "^4.0.2", + "istanbul": "^0.4.5", + "coveralls": "^2.11.15", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "@types/node": "^6.0.40", + "@types/mocha": "^2.2.33" }, "extensionDependencies": [ ], "isAMD": false, "scripts": { - "vscode:prepublish": "node ./node_modules/vscode/bin/compile", - "compile": "node ./node_modules/vscode/bin/compile -p ./", + "vscode:prepublish": "tsc -p ./", + "compile": "tsc -watch -p ./", "watch": "node ./node_modules/vscode/bin/compile -watch -p ./", "test": "node ./node_modules/vscode/bin/test", "coverage_travis": "./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- -R spec --ui tdd ./out/test/**/*.js", diff --git a/src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts b/src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts index 27cccf4..7e040cd 100644 --- a/src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts +++ b/src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts @@ -96,10 +96,19 @@ export class SyntacticAnalysisCSharp { let paramName: Array = new Array(); 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]); } diff --git a/test/TestData/X.cs b/test/TestData/X.cs index 71eb838..b0b4626 100644 --- a/test/TestData/X.cs +++ b/test/TestData/X.cs @@ -27,5 +27,7 @@ public class Nested{} // "T:N.X.Nested" [Route("{time}/{location}")] [HttpGet] public async Task GetInfoForTime(string location, double time) + public Collection Filter(Func query) { } + public Collection Filter(Func queryFirst, Func querySecond) { } } } diff --git a/tsconfig.json b/tsconfig.json index 5a3f246..0828973 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,15 @@ { "compilerOptions": { "module": "commonjs", - "target": "es5", + "target": "es6", "outDir": "out", - "noLib": true, + "lib": [ + "es6" + ], "sourceMap": true }, "exclude": [ - "node_modules" + "node_modules", + ".vscode-test" ] } \ No newline at end of file diff --git a/typings/node.d.ts b/typings/node.d.ts deleted file mode 100644 index 5ed7730..0000000 --- a/typings/node.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// \ No newline at end of file diff --git a/typings/vscode-typings.d.ts b/typings/vscode-typings.d.ts deleted file mode 100644 index 5590dc8..0000000 --- a/typings/vscode-typings.d.ts +++ /dev/null @@ -1 +0,0 @@ -///