Code Monkey home page Code Monkey logo

vscode-coverage-highlighter's Introduction


logo

Code Coverage Highlighter

This is a Visual Studio Code extension that allows you to see your code coverage.

Marketplace Version Build Status codecov Greenkeeper badge


Who can use it?

Does your project use tests? What about code coverage tool? When your development environment prepares coverage report, this extension will highlight your code fragments.

Supported formats

This extension supports several code coverage formats. Depending on the format only code lines or certain fragments can be be highlighted.

Format Search pattern Fragments highlighting
LCOV coverage/lcov*.info No
Istanbul coverage/coverage-final.json Yes
Cobertura cov*.xml No

Highlight examples

Appearance depends on your code coverage format and configuration.

Code with highlighted fragments

Istanbul file is providing fragment highlighting:

Code fragments example

Code with highlighted lines

The LCOV format was used there. Only uncovered lines were highlighted. This format doesn't support fragment highlighting:

Code lines example

Alternative appearance

You can enable wholeLine mode. It will look especially good when your coverage format doesn't support fragments:

Code lines with wholeLine option

Status bar

Whereas extension be able to find coverage file, it will add icon to your status bar. There will be average code coverage percentage. Click on eye-icon will switch coverage displaying.

Code lines with wholeLine option

Configuration

You can adjust some of the configuration options.

Coverage report files

The extension will search coverage report files at start. Also it will start file system watcher. When file with target pattern will be changed, this extension will try to read it.

"vscode-coverage-highlighter.files": [
    "coverage/coverage-final.json",
    "coverage/lcov*.info",
    "cov*.xml"
]

Show coverage by-default

When the target files would be found, should extension highlight coverage immediately? Coverage could be hidden instead. Click on eye on status bar will highlight coverage.

"vscode-coverage-highlighter.defaultState": "enable"

Highlight whole line or text only

This is an appearance option. When it is the true, a line will be highlighted wholly. Otherwise, only text will be highlighted.

"vscode-coverage-highlighter.wholeLine": false

The colors

The extension supports two colors. For covered and uncovered lines. It would be optimal to write colors in rgba notation. Because highlight with alpha channel wouldn't hide the other decorations.

You also can disable one or more colors completely. Just pass empty string for color and decoration won't be shown.

"vscode-coverage-highlighter.coveredColor": "rgba(20, 250, 20, 0.1)",
"vscode-coverage-highlighter.unCoveredColor": "rgba(255, 20, 20, 0.4)"

Show diagnostic messages

You also can enable following option to show diagnostic information on your Problems tab. Each uncovered range will be mentioned there.

"vscode-coverage-highlighter.showDiagnostic": false

Commands

Open the Command Palette and type Code Coverage

  • Toggle coverage display: When text has been highlighted it will hide highlighting. By clicking on eye on your status bar you can do the same.

vscode-coverage-highlighter's People

Contributors

greenkeeper[bot] avatar localjo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.