Coder Social home page Coder Social logo

Comments (5)

ryanluker avatar ryanluker commented on July 18, 2024 1

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.

ryanluker avatar ryanluker commented on July 18, 2024 1

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 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.

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.

mattseddon avatar mattseddon commented on July 18, 2024

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 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.

cameronelliott avatar cameronelliott commented on July 18, 2024

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.

ryanluker avatar ryanluker commented on July 18, 2024

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)

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.