question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PHP: Non-namespaced classes do not render coverage

See original GitHub issue

Describe the bug I have a project that contains both namespaced and non-namespaced classes. I generate coverage for both. The coverage is shown in namespaced classes, but is omitted at non-namespaced classes

To Reproduce Steps to reproduce the behaviour:

  1. create a project with both a non-namespaced (“global”) and a namespaced php class
  2. create coverage report with phpunit
  3. open file and render coverage or enable watch

Expected behaviour See coverage in gutter.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macos
  • Extension Version 2.4.3

vscode:

Version: 1.44.2
Commit: ff915844119ce9485abfe8aa9076ec76b5300ddd
Date: 2020-04-16T17:07:18.473Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 18.7.0

Additional context (logs)

namespaced classes:

[1587629969374][coverageservice]: READY
[1587629969458][coverageservice]: RENDERING
[1587629969462][renderer][section test name]: SomeNamespaced\Thing
[1587629969463][renderer][section file path]: /path/to/my/classes/SomeNamespaced/Thing.php
[1587629969472][coverageservice]: READY

non-namespaced class:

[1587629974310][coverageservice]: RENDERING
[1587629974310][coverageservice]: READY
[1587629974423][coverageservice]: RENDERING
[1587629974432][coverageservice]: READY
[1587629987700][coverageservice]: RENDERING
[1587629987701][coverageservice]: READY
[1587630108756][coverageservice]: RENDERING
[1587630108758][coverageservice]: READY
<!-- Here I tried to load via cmd+shift+7 -->
[1587630115283][coverageservice]: LOADING
[1587630126231][coverageservice]: Loading 2 file(s)
[1587630126279][coverageservice]: Loaded 2 data file(s)
[1587630126896][coverageservice]: Caching 265 coverage(s)
[1587630126896][printDataCoverage]: Coverage -> 265
[1587630126896][coverageservice]: READY
[1587630126897][coverageservice]: RENDERING

edit I’ve adapted the reproduction to explicitly mention to have both namespaced and non-namespaced classes in the same project.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
ryanlukercommented, Jun 24, 2020

@webmaster777 release should be live, you can also install the vsix manually from the release if you have auto updates off https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix https://github.com/ryanluker/vscode-coverage-gutters/releases/tag/v2.4.4

0reactions
ryanlukercommented, Jun 24, 2020

@webmaster777 thanks for the reminder! I am doing the release this morning and it should be available shortly. I am trying to get this process to be more automatic (when a new release tag is created it should deploy a new version to the vscode marketplace but I haven’t got there quite yet). https://github.com/ryanluker/vscode-coverage-gutters/issues/212 https://github.com/ryanluker/vscode-coverage-gutters/issues/225

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inconsistent code coverage in non-executed classes #5768
Lines 10, 11, & 13 are correctly marked as not executable in ... processing, and rendering functionality for PHP code coverage information.
Read more >
PHPUnit coverage now incomplete as class' opening brace is ...
This is not a bug. Xdebug can only scans items (files, functions, methods) when they are loaded and code coverage is enabled. The...
Read more >
Rendering - CommonMark for PHP
Renderers are responsible for converting the parsed AST elements into their HTML representation. All block renderers should implement NodeRendererInterface and ...
Read more >
Hooks FAQ - React
Should I use Hooks, classes, or a mix of both? Do Hooks cover all use cases for classes? Do Hooks replace render props...
Read more >
React's render() Doesn't... Render - DEV Community ‍ ‍
Cover image for React's render() Doesn't... Render ... If there is no render() function, the class won't compile as a React component.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found