Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svelte.svelte-vscode won't format CSS files #1453

Closed
mjswensen opened this issue Apr 21, 2022 · 2 comments
Closed

svelte.svelte-vscode won't format CSS files #1453

mjswensen opened this issue Apr 21, 2022 · 2 comments

Comments

@mjswensen
Copy link

Describe the bug

The README for the VS Code extension states that it supports formatting CSS (via Prettier). However, VS Code reports that the extension cannot format CSS files.

image

Reproduction

  1. Install the Svelte for VS Code extension
  2. Configure the following in your VS Code settings:
{
	"editor.defaultFormatter": "svelte.svelte-vscode",
	"editor.formatOnSave": true
}
  1. Author a vanilla CSS file with poor formatting:
html,
body {
	font-size: 12px;
	background-color: slategray;


}
  1. Save the file; note that it does not get formatted
  2. Open the command palette and select "Format Document"; see the error "Extension 'Svelte for VS Code' is configured as formatter but it cannot format 'CSS'-files"

Expected behaviour

From the README, I expected svelte.svelte-vscode to be able to format these file types (using Prettier under the hood):

  • *.svelte
  • *.css
  • *.js
    • *.json (since it is essentially a subset of JavaScript)
  • *.html

System Info

  • OS: macOS 12.3.1
  • IDE: VS Code version: 1.66.2 (Universal)
  • Svelte for VS Code version: v105.16.0

Which package is the issue about?

Svelte for VS Code

Additional Information, eg. Screenshots

No response

@mjswensen mjswensen added the bug Something isn't working label Apr 21, 2022
@jasonlyu123 jasonlyu123 removed the bug Something isn't working label Apr 21, 2022
@jasonlyu123
Copy link
Member

All of the features mentioned in the svelte VSCdode Readme are the features within a svelte file. Like CSS is for the style tag in a svelte file.

@mjswensen
Copy link
Author

I see, thanks for the clarification @jasonlyu123 .

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

No branches or pull requests

2 participants