Skip to content

Commit

Permalink
Fixing compile issues with new npm version.
Browse files Browse the repository at this point in the history
Signed-off-by: Lars Egeberg Hansen <[email protected]>
  • Loading branch information
Lars Egeberg Hansen committed May 24, 2024
1 parent 85ca1dc commit 5b33b0b
Show file tree
Hide file tree
Showing 5 changed files with 308 additions and 300 deletions.
Binary file modified build/distributions/cobol-check-0.2.10.zip
Binary file not shown.
Binary file modified vs-code-extension/Cobol-check/bin/cobol-check-0.2.10.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion vs-code-extension/client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ export async function activate(context: ExtensionContext) {
const lineNo = test.range!.start.line;
const fileCoverage = coveredLines.get(test.uri!.toString());
if (fileCoverage) {
fileCoverage[lineNo]!.executionCount++;
// fileCoverage[lineNo]!.executionCount++;
(fileCoverage[lineNo]!.executed as number)++;
}
}

Expand Down
237 changes: 121 additions & 116 deletions vs-code-extension/client/src/vscode.proposed.testCoverage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,136 +63,141 @@ declare module 'vscode' {
constructor(covered: number, total: number);
}

/* ******************************************************************************** */
/* Below classes is out commented because they have been moved to standard npm code */
/* in the file index.d.ts */
/* ******************************************************************************** */

/**
* Contains coverage metadata for a file.
*/
export class FileCoverage {
/**
* File URI.
*/
readonly uri: Uri;

/**
* Statement coverage information. If the reporter does not provide statement
* coverage information, this can instead be used to represent line coverage.
*/
statementCoverage: CoveredCount;

/**
* Branch coverage information.
*/
branchCoverage?: CoveredCount;

/**
* Function coverage information.
*/
functionCoverage?: CoveredCount;

/**
* Detailed, per-statement coverage. If this is undefined, the editor will
* call {@link TestCoverageProvider.resolveFileCoverage} when necessary.
*/
detailedCoverage?: DetailedCoverage[];

/**
* Creates a {@link FileCoverage} instance with counts filled in from
* the coverage details.
* @param uri Covered file URI
* @param detailed Detailed coverage information
*/
static fromDetails(uri: Uri, details: readonly DetailedCoverage[]): FileCoverage;

/**
* @param uri Covered file URI
* @param statementCoverage Statement coverage information. If the reporter
* does not provide statement coverage information, this can instead be
* used to represent line coverage.
* @param branchCoverage Branch coverage information
* @param functionCoverage Function coverage information
*/
constructor(
uri: Uri,
statementCoverage: CoveredCount,
branchCoverage?: CoveredCount,
functionCoverage?: CoveredCount,
);
}
// export class FileCoverage {
// /**
// * File URI.
// */
// readonly uri: Uri;

// /**
// * Statement coverage information. If the reporter does not provide statement
// * coverage information, this can instead be used to represent line coverage.
// */
// statementCoverage: CoveredCount;

// /**
// * Branch coverage information.
// */
// branchCoverage?: CoveredCount;

// /**
// * Function coverage information.
// */
// functionCoverage?: CoveredCount;

// /**
// * Detailed, per-statement coverage. If this is undefined, the editor will
// * call {@link TestCoverageProvider.resolveFileCoverage} when necessary.
// */
// detailedCoverage?: DetailedCoverage[];

// /**
// * Creates a {@link FileCoverage} instance with counts filled in from
// * the coverage details.
// * @param uri Covered file URI
// * @param detailed Detailed coverage information
// */
// static fromDetails(uri: Uri, details: readonly DetailedCoverage[]): FileCoverage;

// /**
// * @param uri Covered file URI
// * @param statementCoverage Statement coverage information. If the reporter
// * does not provide statement coverage information, this can instead be
// * used to represent line coverage.
// * @param branchCoverage Branch coverage information
// * @param functionCoverage Function coverage information
// */
// constructor(
// uri: Uri,
// statementCoverage: CoveredCount,
// branchCoverage?: CoveredCount,
// functionCoverage?: CoveredCount,
// );
// }

/**
* Contains coverage information for a single statement or line.
*/
export class StatementCoverage {
/**
* The number of times this statement was executed. If zero, the
* statement will be marked as un-covered.
*/
executionCount: number;

/**
* Statement location.
*/
location: Position | Range;

/**
* Coverage from branches of this line or statement. If it's not a
* conditional, this will be empty.
*/
branches: BranchCoverage[];

/**
* @param location The statement position.
* @param executionCount The number of times this statement was
* executed. If zero, the statement will be marked as un-covered.
* @param branches Coverage from branches of this line. If it's not a
* conditional, this should be omitted.
*/
constructor(executionCount: number, location: Position | Range, branches?: BranchCoverage[]);
}
// export class StatementCoverage {
// /**
// * The number of times this statement was executed. If zero, the
// * statement will be marked as un-covered.
// */
// executionCount: number;

// /**
// * Statement location.
// */
// location: Position | Range;

// /**
// * Coverage from branches of this line or statement. If it's not a
// * conditional, this will be empty.
// */
// branches: BranchCoverage[];

// /**
// * @param location The statement position.
// * @param executionCount The number of times this statement was
// * executed. If zero, the statement will be marked as un-covered.
// * @param branches Coverage from branches of this line. If it's not a
// * conditional, this should be omitted.
// */
// constructor(executionCount: number, location: Position | Range, branches?: BranchCoverage[]);
// }

/**
* Contains coverage information for a branch of a {@link StatementCoverage}.
*/
export class BranchCoverage {
/**
* The number of times this branch was executed. If zero, the
* branch will be marked as un-covered.
*/
executionCount: number;

/**
* Branch location.
*/
location?: Position | Range;

/**
* @param executionCount The number of times this branch was executed.
* @param location The branch position.
*/
constructor(executionCount: number, location?: Position | Range);
}
// export class BranchCoverage {
// /**
// * The number of times this branch was executed. If zero, the
// * branch will be marked as un-covered.
// */
// executionCount: number;

// /**
// * Branch location.
// */
// location?: Position | Range;

// /**
// * @param executionCount The number of times this branch was executed.
// * @param location The branch position.
// */
// constructor(executionCount: number, location?: Position | Range);
// }

/**
* Contains coverage information for a function or method.
*/
export class FunctionCoverage {
/**
* The number of times this function was executed. If zero, the
* function will be marked as un-covered.
*/
executionCount: number;

/**
* Function location.
*/
location: Position | Range;

/**
* @param executionCount The number of times this function was executed.
* @param location The function position.
*/
constructor(executionCount: number, location: Position | Range);
}

export type DetailedCoverage = StatementCoverage | FunctionCoverage;
// export class FunctionCoverage {
// /**
// * The number of times this function was executed. If zero, the
// * function will be marked as un-covered.
// */
// executionCount: number;

// /**
// * Function location.
// */
// location: Position | Range;

// /**
// * @param executionCount The number of times this function was executed.
// * @param location The function position.
// */
// constructor(executionCount: number, location: Position | Range);
// }

// export type DetailedCoverage = StatementCoverage | FunctionCoverage;

}
Loading

0 comments on commit 5b33b0b

Please sign in to comment.