Skip to content

Commit

Permalink
Merge pull request #4 from k--kato/fix/#3
Browse files Browse the repository at this point in the history
Fix/#3
  • Loading branch information
Keisuke KATO committed Jan 24, 2016
2 parents 4bbf4eb + 281893f commit 480fc89
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
*.vsix
coverage
.vscode-test
npm-debug.log
Binary file modified images/docomment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.2",
"version": "0.0.3",
"publisher": "k--kato",
"engines": {
"vscode": "^0.10.6"
Expand Down
20 changes: 15 additions & 5 deletions src/Domain/Lang/DocommentDomainCSharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,21 @@ export class DocommentDomainCSharp extends DocommentDomain {
return '';
}

return this.GeneSummary(code, paramNameList, hasReturn);
}

/* @implements */
public MoveCursorTo(docomment: string): void {
const curPosition = this._vsCodeApi.GetActivePosition();
this._vsCodeApi.MoveSelection(curPosition.line + 1, curPosition.character + 2);
}


/*-------------------------------------------------------------------------
* Private Method
*-----------------------------------------------------------------------*/

private GeneSummary(code: string, paramNameList: Array<string>, hasReturn: boolean): string {

let docommentList: Array<string> = new Array<string>();

Expand Down Expand Up @@ -157,9 +172,4 @@ export class DocommentDomainCSharp extends DocommentDomain {
return docomment;
}

/* @implements */
public MoveCursorTo(docomment: string): void {
const curPosition = this._vsCodeApi.GetActivePosition();
this._vsCodeApi.MoveSelection(curPosition.line + 1, curPosition.character + 2);
}
}
2 changes: 1 addition & 1 deletion src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class SyntacticAnalysisCSharp {

public static IsField(code: string): boolean {
if (code === null) return false;
return code.match(/;[ \t]*$/) !== null;
return code.match(/[^()]+;[ \t]*$/) !== null;
}

public static IsMethod(code: string): boolean {
Expand Down
24 changes: 24 additions & 0 deletions test/TestData/X.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace N // "N:N"
{
public unsafe class X // "T:N.X"
{
public X(){} // "M:N.X.#ctor"
public X(int i){} // "M:N.X.#ctor(System.Int32)"
public string q; // "F:N.X.q"
public const double PI = 3.14; // "F:N.X.PI"
public int f(){return 1;} // "M:N.X.f"
public int bb(string s, ref int y, void * z){return 1;} // "M:N.X.bb(System.String,System.Int32@,=System.Void*)"
public int gg(short[] array1, int[,] array){return 0;} // "M:N.X.gg(System.Int16[], System.Int32[0:,0:])"
public static X operator+(X x, X xx){return x;} // "M:N.X.op_Addition(N.X,N.X)"
public int prop {get{return 1;} set{}} // "P:N.X.prop"
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 static explicit operator int(X x){return 1;} // "M:N.X.op_Explicit(N.X)~System.Int32"
public DbSet<Director> Directors { get; set; }
public List<int> bb<int>(string s, ref List<int> 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);
}
}
Empty file added test/TestData/project.json
Empty file.

0 comments on commit 480fc89

Please sign in to comment.