PHP: Non-namespaced classes do not render coverage
See original GitHub issueDescribe 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:
- create a project with both a non-namespaced (“global”) and a namespaced php class
- create coverage report with phpunit
- 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:
- Created 3 years ago
- Comments:10 (10 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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
@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