Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Coverage highlight disappears after switching files #24

Open
jensweigele opened this issue Mar 10, 2021 · 9 comments
Open

Coverage highlight disappears after switching files #24

jensweigele opened this issue Mar 10, 2021 · 9 comments

Comments

@jensweigele
Copy link

Since the latest VSCode update the code coverage highlighting disappears after switching between files nearly always.
Closing all files and open the covered file solves the problem. Switching e.g. between a covered file and the spec file and back, hides the highlighting again - but only if you open the files (not if you just preview them).

I'm using VSCode 1.54.1 on MacOS Big Sur.
Code Coverage Highlighter is installed in Version 1.0.3.

Let me know if you need any other information!

@brikabrak
Copy link

Also happening in VS Codium 1.54.2 on Windows 10, version 1.0.3.

@ssteinvil-forescout
Copy link

The following message appears in the Log (Main) window:

[2021-03-19 14:02:25.871] [renderer8] [error] Cannot read property 'id' of undefined: TypeError: Cannot read property 'id' of undefined
    at ProviderManager.onChangeActive (c:\Users\guestuser\.vscode\extensions\brainfit.vscode-coverage-highlighter-1.0.3\out\src\providerManager.js:49:31)
    at g.fire (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:57:1856)
    at c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:88:43807
    at g.fire (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:57:1836)
    at p.acceptDocumentsAndEditorsDelta (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:87:145142)
    at p.$acceptDocumentsAndEditorsDelta (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:87:143272)
    at c._doInvokeHandler (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:10509)
    at c._invokeHandler (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:10201)
    at c._receiveRequest (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:8871)
    at c._receiveOneMessage (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:7673)
    at c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:5782
    at g.fire (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:57:1836)
    at p.fire (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:15443)
    at c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:106:29119
    at g.fire (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:57:1836)
    at p.fire (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:15443)
    at t._receiveMessage (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:20693)
    at c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:17587
    at g.fire (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:57:1836)
    at l.acceptChunk (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:12808)
    at c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:12156
    at Socket.E (c:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:106:12375)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)

@brikabrak
Copy link

In the meantime I've turned on "vscode-coverage-highlighter.showDiagnostic": true in my user settings to give an idea of what's uncovered in real-time. Seems to still work even after triggering the error above.

@DevilXD
Copy link

DevilXD commented Apr 5, 2021

Looks like, at least according to the VSCode documentation, the window.onDidChangeActiveTextEditor event can occur, with undefined as the parameter.

Doc: https://code.visualstudio.com/api/references/vscode-api#window.onDidChangeActiveTextEditor

This is potentially what's causing the problem. @pilat Could you find some time to look at this please?

@spiderrobb
Copy link

This is by far the best coverage tool I have seen..
but its just broken right now.

It only shows coverage if you have a Single file open.
Really hoping this gets fixed soon

@DevilXD
Copy link

DevilXD commented Apr 22, 2021

To be honest, I just switched to this instead: https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters

You can get it from the extension downloader, by searching for "coverage gutters". Make sure to grab the original, not the fork. The settings are a bit awkward, especially the color naming, but once I've set it up with the same colors as in this extension, I don't think I'll be going back, even if this one gets fixed.
The only "problem" is that it doesn't show coverage percentage on the toolbar at the bottom, and doesn't show coverage after opening the workspace (you need to click the button in the toolbar to enable it manually), but that's planned.

@spiderrobb
Copy link

To be honest, I just switched to this instead: https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters

You can get it from the extension downloader, by searching for "coverage gutters". Make sure to grab the original, not the fork. The settings are a bit awkward, especially the color naming, but once I've set it up with the same colors as in this extension, I don't think I'll be going back, even if this one gets fixed.
The only "problem" is that it doesn't show coverage percentage on the toolbar at the bottom, and doesn't show coverage after opening the workspace (you need to click the button in the toolbar to enable it manually), but that's planned.

I had actually switched from "Coverage Gutters" to this one.
The problem I was having with Coverage gutters is that it shows conditional coverage by line... this means sometimes if you want to view the what part of the line is missing coverage we would generate a coverage report and view it in a browser.
This extension shows what part of the line is conditionally covered which was the point of migrating to this in the first place. I havn't been able to find another extension that removes the need to generate a coverage report while developing like this one has.

AlexHaxe added a commit to AlexHaxe/vscode-coverage-highlighter that referenced this issue Jun 3, 2021
@rfunk
Copy link

rfunk commented Jun 23, 2021

PR #26 fixes this problem for me, making the extension usable again.

@bompus
Copy link

bompus commented Sep 21, 2021

@pilat can you fix this issue? It looks like there is a PR that might resolve it, at least enough to make it usable again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants