From e92a283230882b104ebeb95639505efafb5afee8 Mon Sep 17 00:00:00 2001 From: k--kato Date: Thu, 29 Dec 2016 22:28:19 +0900 Subject: [PATCH] fixed Parameters not correctly identified when documenting constructor which chains to a base class constructor. #22 --- CHANGELOG.md | 6 ++++- package.json | 13 +++++------ .../SyntacticAnalysisCSharp.ts | 2 +- test/TestData/X.cs | 6 +++-- test/TestData/project.json | 22 +++++++++---------- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d946f6b..a45823e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ # Change Log +## 0.0.10 (December 29, 2016) + +* bug fix - Parameters not correctly identified when documenting constructor which chains to a base class constructor. See [#22](https://github.com/k--kato/vscode-docomment/issues/22). + ## 0.0.9 (December 11, 2016) -* bug fix - Expansion is triggering in a lot of cases when it shouldn't . See [#16](https://github.com/k--kato/vscode-docomment/issues/16). +* bug fix - Expansion is triggering in a lot of cases when it shouldn't. See [#16](https://github.com/k--kato/vscode-docomment/issues/16). ## 0.0.8 (December 2, 2016) diff --git a/package.json b/package.json index f1388ff..171d4a6 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "docomment", - "version": "0.0.9", + "version": "0.0.10", "publisher": "k--kato", "engines": { - "vscode": "^1.7.0" + "vscode": "^1.8.0" }, "displayName": "C# XML Documentation Comments", "description": "Generate C# XML documentation comments for ///", @@ -45,19 +45,18 @@ "dependencies": { }, "devDependencies": { - "typescript": "^2.0.10", + "typescript": "^2.1.4", "vscode": "^1.0.3", - "tslint": "^4.0.2", + "tslint": "^4.2.0", "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" + "@types/node": "^6.0.54", + "@types/mocha": "^2.2.35" }, "extensionDependencies": [ ], - "isAMD": false, "scripts": { "vscode:prepublish": "tsc -p ./", "compile": "tsc -watch -p ./", diff --git a/src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts b/src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts index f44e14d..6c77579 100644 --- a/src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts +++ b/src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts @@ -90,7 +90,7 @@ export class SyntacticAnalysisCSharp { public static GetMethodParamNameList(code: string): Array { if (code === null) return null; - const params: RegExpMatchArray = code.match(/[\w\S]\s+[\w\S]+\s*\((.*)\)/); + const params: RegExpMatchArray = code.match(/[\w\S]\s+[\w\S]+\s*\(([^)]*)\)/); const isMatched = (params === null || params.length !== 2); if (isMatched) return null; diff --git a/test/TestData/X.cs b/test/TestData/X.cs index b0b4626..4818ddd 100644 --- a/test/TestData/X.cs +++ b/test/TestData/X.cs @@ -16,9 +16,9 @@ public X(int i){} // "M:N.X.#ctor(System.Int32)" public event D d; // "E:N.X.d" public int this[string s]{get{return 1;}} // "P:N.X.Item(System.String)" public class Nested{} // "T:N.X.Nested" - public delegate void D(int i); // "T:N.X.D" + public delegate void D(int i); // "T:N.X.D" public static explicit operator int(X x){return 1;} // "M:N.X.op_Explicit(N.X)~System.Int32" - public DbSet Directors { get; set; } + public DbSet Directors { get; set; } public List bb(string s, ref List y, void * z){return 1;} // "M:N.X.bb(System.String,System.Int32@,=System.Void*)" int bb(string s, ref int y, void * z){return 1;} // "M:N.X.bb(System.String,System.Int32@,=System.Void*)" int Generate(int level); @@ -29,5 +29,7 @@ public class Nested{} // "T:N.X.Nested" public async Task GetInfoForTime(string location, double time) public Collection Filter(Func query) { } public Collection Filter(Func queryFirst, Func querySecond) { } + public Test(string options) : base(options) + public Testing2(string String1, string String2, string String3) : base() } } diff --git a/test/TestData/project.json b/test/TestData/project.json index 8b8cda1..26970a0 100644 --- a/test/TestData/project.json +++ b/test/TestData/project.json @@ -1,20 +1,20 @@ { "version": "1.0.0-*", "buildOptions": { - "emitEntryPoint": false + "debugType": "portable", + "emitEntryPoint": true }, "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.0-rc2-*" - } + "Microsoft.Extensions.PlatformAbstractions": "1.1.0" }, "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dnxcore50", - "portable-net45+win8" - ] + "netcoreapp1.1": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.1.0" + } + } } } -} +} \ No newline at end of file