Skip to content

Commit

Permalink
Fix var assignment cases
Browse files Browse the repository at this point in the history
  • Loading branch information
farie82 committed Nov 3, 2022
1 parent 7bcff4e commit 1de735f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/auto_dmdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ export class AutoDmDoc {

const position = this.editor.selection.active;


const parameterRegex: RegExp = /\((.*)\)/;

const procLine = this.getFullProc(position.line + 1, this.editor.document);

if (!procLine) {
Expand All @@ -27,6 +24,7 @@ export class AutoDmDoc {
return;
}

const parameterRegex: RegExp = /\((.*)\)/;
const paramBody = procLine.match(parameterRegex)!;

const argNames = this.getArgs(paramBody);
Expand Down Expand Up @@ -66,7 +64,7 @@ export class AutoDmDoc {
}

private getArgs(paramBody: string | RegExpMatchArray) {
const argumentsRegex: RegExp = /[^\s,]+/g;
const argumentsRegex: RegExp = /[A-Za-z_][^\s,=]*/g;
const argNameRegex: RegExp = /[^\/]+$/
const argValues = paramBody[1].match(argumentsRegex);
let argNames: string[] = [];
Expand Down

0 comments on commit 1de735f

Please sign in to comment.