Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal argument: line must be non-negative when any detail.line is 0 #424

Closed
sfc-gh-wzhao opened this issue Sep 11, 2023 · 1 comment · Fixed by #425
Closed

Illegal argument: line must be non-negative when any detail.line is 0 #424

sfc-gh-wzhao opened this issue Sep 11, 2023 · 1 comment · Fixed by #425
Assignees
Labels
Milestone

Comments

@sfc-gh-wzhao
Copy link
Contributor

sfc-gh-wzhao commented Sep 11, 2023

Describe the bug
When parsing a coverage dat file where leads to section.lines.details or section.branches.details's element in renderer will lead to Illegal argument: line must be non-negative.

To Reproduce
Steps to reproduce the behaviour:

  1. Create a coverage lcov file containing information at line 0.
  2. Enable coverage display

Expected behaviour
They should be ignored and not affect display coverage info.

Screenshots
Traceback:

Error: Illegal argument: line must be non-negative
	at $ (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:10:1101)
	at new n (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:103:4331)
	at new o (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:103:5847)
	at /Users/****/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.11.0/out/src/coverage-system/renderer.js:92:34
	at Array.forEach (<anonymous>)
	at Renderer.filterBranchCoverage (/Users/****/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.11.0/out/src/coverage-system/renderer.js:91:14)
	at /Users/****/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.11.0/out/src/coverage-system/renderer.js:59:18
	at Array.forEach (<anonymous>)
	at Renderer.filterCoverage (/Users/****/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.11.0/out/src/coverage-system/renderer.js:57:18)
	at /Users/****/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.11.0/out/src/coverage-system/renderer.js:36:18
	at Array.forEach (<anonymous>)
	at Renderer.renderCoverage (/Users/****/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.11.0/out/src/coverage-system/renderer.js:25:21)
	at CoverageService.<anonymous> (/Users/****/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.11.0/out/src/coverage-system/coverageservice.js:99:31)
	at Generator.next (<anonymous>)
	at fulfilled (/Users/****/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.11.0/node_modules/tslib/tslib.js:115:62)

Desktop (please complete the following information):

  • OS: macosx
  • Extension Version 2.11.0
  • VSCode Version 1.82.0

Additional context
I think it should be a easy fix by changing the filter in Line 67 and 90 from >= to >.

@ryanluker
Copy link
Owner

@sfc-gh-wzhao Thanks for the ticket and PR!
Taking a look today at open PRs / new tickets so I will adds yours to the queue.

@ryanluker ryanluker added this to the 2.12.0 milestone Sep 17, 2023
@ryanluker ryanluker added the bug label Sep 17, 2023
@ryanluker ryanluker assigned ryanluker and sfc-gh-wzhao and unassigned ryanluker Sep 17, 2023
@ryanluker ryanluker modified the milestones: 2.12.0, 2.11.1 Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants