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

Feature suggestion: inline coverage reporting #72

Closed
DonJayamanne opened this issue Nov 13, 2017 · 16 comments · May be fixed by irinazheltisheva/vscode-python#3 or Aqeelkha/vscode-python#4
Closed
Labels
feature-request Request for new features or functionality

Comments

@DonJayamanne
Copy link

From @sfermigier on January 16, 2017 11:28

Issue #183 being now closed, here's an independent issue for a feature suggestion that I find really important: inline reports for coverage.py results (or pytest --cov, etc.).

Copied from original issue: DonJayamanne/pythonVSCode#647

@DonJayamanne
Copy link
Author

From @patrys on January 17, 2017 8:53

Here's an example implementation for Golang: microsoft/vscode-go#143

@DonJayamanne
Copy link
Author

From @cristim on July 27, 2017 10:34

Coming from golang I miss this a lot.

@brettcannon
Copy link
Member

While we don't have the time currently to implement this ourselves, we would consider a PR that could read the coverage report file from coverage.py and display coverage results from that.

@litleleprikon
Copy link

Hi! I actually need this feature and I can implement it but I need to discuss some details

@DonJayamanne
Copy link
Author

Please feel free to post your questions here and we'll be glad to assist you.

@litleleprikon
Copy link

First of all: which format of report should be implemented?
How do you see the coverage view(gutters/highlighted code line/rulers)?
Which settings should be added?

@DonJayamanne
Copy link
Author

First of all: which format of report should be implemented?

That's completely upto you. Since you are writing the code, you need to decide what's best for you. Tip, using a json or similar format world be easier. I haven't checked what formats are available.

How do you see the coverage view(gutters/highlighted code line/rulers)?

You could would need to display the information as code lenses. Users of this feature would want the information easily viewable, and code lenses are the way. Please check the vscode API (samples), on adding code lenses.

Which settings should be added?

Not having checked the API, I have no idea. Since you are implementing this, it's upto you. As a start, just hardcode these, later we can add code that will allow users to configure them.

@brettcannon
Copy link
Member

I would actually specifically say you need to support what coverage.py provides. I actually wouldn't look at a PR that tried to support any other coverage tool.

And wouldn't have a code lens on every line of code be hard to read? Or do code lenses also control the gutter?

@litleleprikon
Copy link

I would actually specifically say you need to support what coverage.py provides. I actually wouldn't look at a PR that tried to support any other coverage tool.

Yes of course coverage.py is most known tool, I'll focus on it.

And wouldn't have a code lens on every line of code be hard to read? Or do code lenses also control the gutter?

In my opinion the best way to show coverage is gutters, but this approach produce an issue that you cannot set a breakpoint when coverage is enabled.

screen shot 2018-05-01 at 01 07 01

Another way is to use code background decoration, but in this way it can be distractive a little bit

screen shot 2018-05-01 at 01 10 40

@DonJayamanne
Copy link
Author

And wouldn't have a code lens on every line of code be hard to read?

Yes, I agree. For some reason I was thinking of profiling. Apologies.

@litleleprikon
The first option is the best (using the gutter).

@litleleprikon
Copy link

Ok, got it. I will start with XML report of coverage.py, gutters and hardcoded settings.

@DonJayamanne
Copy link
Author

@litleleprikon
Please do have a look at the marketplace to see how other extensions do this.

@litleleprikon
Copy link

@DonJayamanne Yeah, already did this and the average way is to use gutters or code background highlighting. Also coverage gutters allow to choose in settings what to use to show coverage info and in my opinion this is the most preferred solution. I can implement it after the first iteration of this feature implementation.

Here is settings for coverage gutters:

  // show or hide the gutter coverage
  "coverage-gutters.showGutterCoverage": true,

  // show or hide the line coverage
  "coverage-gutters.showLineCoverage": false,

  // show or hide the ruler coverage
  "coverage-gutters.showRulerCoverage": false

@DonJayamanne
Copy link
Author

  • What are the two settings (showLineCoverage and showRulerCoverage)?
  • Please have a look at the extension Code Cover (& others) as well.

@litleleprikon
Copy link

What are the two settings (showLineCoverage and showRulerCoverage)?

showLineCoverage is setting for background highlighting and showRullerCoverage is for marks on scroll line:

screen shot 2018-05-01 at 03 21 34

Please have a look at the extension Code Cover (& others) as well.

Ok, will look another extensions to see more examples.

@brettcannon
Copy link
Member

To help manage our issues and to better communicate what the team plans to work on we are closing issues that we don't plan to work on but would accept a pull request from a volunteer for. To be clear, closing this issue does not mean we won't consider a pull request for this enhancement as outlined in our contributing guide, just that the development team has no plans to work on it themselves.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
3 participants