Comments (5)
Thanks for the issue @phiter!
You are correct that this isn't a hard dependency but instead an optional one if you wish to use to view the coverage reports in vscode.
Preview Report (activated via command palette): Shows you a html preview of your coverage reports in your editor.
https://github.com/ryanluker/vscode-coverage-gutters#common-commands
After looking around the vscode repo, it seems like there is no ability to make an extension optional... microsoft/vscode#6384
@mattseddon might have good insights or more thoughts, but there could also be other ways to using installed extensions without having to add the live server extension as a hard dependency 🤔.
from vscode-coverage-gutters.
AFAIK there are three options:
1. Hard dependency. 2. Rebuild the external extension's functionality internally. 3. Check to see if dependency is installed, if not then prompt to install/explain why the dependant functionality doesn't currently work.
For 3 you can use something along the lines of:
import { extensions } from 'vscode' ... export const isInstalled = (id: string): boolean => !!extensions.all.some(extension => extension.id === id)
or around the boundary of https://github.com/ryanluker/vscode-coverage-gutters/blob/master/src/extension/gutters.ts#L48 you need to check if
ms-vscode.live-server
was returned and show a toast message (window.showErrorMessage
orwindow.showWarningMessage
, probably as a modal)/return early if it wasn't.Hope that helps. Let me know if you need any more context or details.
This helps a ton @mattseddon ! I kinda figured option 3 would be what we would need after I saw the 6+ year old ticket hah 😅.
from vscode-coverage-gutters.
AFAIK there are three options:
- Hard dependency.
- Rebuild the external extension's functionality internally.
- Check to see if dependency is installed, if not then prompt to install/explain why the dependant functionality doesn't currently work.
For 3 you can use something along the lines of:
import { extensions } from 'vscode'
...
export const isInstalled = (id: string): boolean =>
!!extensions.all.some(extension => extension.id === id)
or around the boundary of https://github.com/ryanluker/vscode-coverage-gutters/blob/master/src/extension/gutters.ts#L48 you need to check if ms-vscode.live-server
was returned and show a toast message (window.showErrorMessage
or window.showWarningMessage
, probably as a modal)/return early if it wasn't.
Hope that helps. Let me know if you need any more context or details.
from vscode-coverage-gutters.
I really think Coverage Gutters is awesome, but was a bit surprised and disappointed that Live Preview can't be uninstalled while Coverage Gutters is installed.
Thanks for making Coverage Gutters!
from vscode-coverage-gutters.
I really think Coverage Gutters is awesome, but was a bit surprised and disappointed that Live Preview can't be uninstalled while Coverage Gutters is installed. Thanks for making Coverage Gutters!
Thanks for the input! I felt similar when we were investigating the feature, but it was a vscode extension api limitation last time I checked 🤔. We probably need to implement one of Matt's suggestions above to get around this...
from vscode-coverage-gutters.
Related Issues (20)
- Extension settings do not have the scope property defined HOT 3
- refactoring if clause caused extension to crash HOT 3
- update CHANGELOG.md to make changes extension-visible
- Java example pom issues and failure in mvn install HOT 2
- Cannot seem to watch files outside of VS Code workspace directory HOT 2
- Improve visibility of covered lines HOT 4
- Add support for remote coverage files HOT 3
- Support coverage reports with multiple sources HOT 2
- behavior change suggestion/rfc: statusbar should report `Math.floor` instead of `Math.round` HOT 1
- `Illegal argument: line must be non-negative` when any `detail.line` is 0 HOT 1
- Where does the watcher look for the lcov.info file? HOT 2
- Coverage information fails to render when branch coverage is enabled HOT 1
- Update deploy automation action to use v1 of external action
- Cant read coverage data from cobertura-coverage.xml HOT 1
- Don't highlight tested lines HOT 4
- vsix packaging: drop unused folders HOT 1
- cobertura Status Bar Percentage Wrong with C# Workspace HOT 6
- Attempting to parse cobertura.xml fails after converting from visual studio .coverage binary. HOT 2
- settings: resolve configuration settings HOT 1
- [Documentation] Example Java Gradle Project HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-coverage-gutters.