Skip to content

Show an info/error card in VS Code whenever required modules are not installed  #1763

@JL102

Description

@JL102

Describe the bug

I was quite confused as to why "Format Document" in Svelte files seemed to do nothing. Turns out that I didn't have prettier-plugin-svelte installed, and when the Svelte extension attempted to load it, it simply logged an error into the Output tab without notifying me through the UI. I believe the extension should show an error to the user instead of just logging the error.

Reproduction

  1. Set up the Svelte language extension, but EITHER:
    a. Do not install prettier-plugin-svelte in your project OR
    b. Install prettier-plugin-svelte and prettier in a subfolder, i.e. not the root of your Code instance (related to Not formatting monorepo prettier-plugin-svelte#311)
  2. Attempt to format a Svelte file via right click -> Format Document

Expected behaviour

If any required modules are not found, instead of just logging into the output console, the Svelte extension should create an info card in the bottom-right corner of the screen, displaying the error, so the user can understand why it's doing nothing.

System Info

  • OS: Reproducible on both Windows and Ubuntu
  • IDE: VS Code

Which package is the issue about?

None

Additional Information, eg. Screenshots

image
In this screenshot, note that ScoringApp-Serverless is the workspace root, while offline is the Svelte project. The Svelte project has both prettier and prettier-plugin-svelte installed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedFixed in master branch. Pending production release.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions