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

feat: enable extension for CSS files #222

Merged
merged 3 commits into from
Jun 4, 2024
Merged

feat: enable extension for CSS files #222

merged 3 commits into from
Jun 4, 2024

Conversation

ematipico
Copy link
Member

@ematipico ematipico commented May 21, 2024

Summary

The PR enables the extension for CSS files.

Description

I had a couple of issues, not sure if they are relevant:

  • bun updated the lock file, not sure why. I didn't add it to the commit though
  • When debugging the extension using F5, the extension didn't trigger for the CSS files. Is it expected?
  • lefthook triggered when committing, and if it failed
     ┃  check ❯ 
     
     sh: biome: command not found
    

This feature should be released after (together) with the release of v1.8.

Related Issue

N/A

This PR closes #<issue_number>

Checklist

  • I have tested my changes on the following platforms:
    • Windows
    • Linux
    • macOS

package.json Outdated Show resolved Hide resolved
@ematipico ematipico requested a review from nhedger May 21, 2024 09:24
@nhedger
Copy link
Member

nhedger commented May 21, 2024

bun updated the lock file, not sure why. I didn't add it to the commit though

This may happen when using a new version of bun that slightly updates the format of the lockfile.

When debugging the extension using F5, the extension didn't trigger for the CSS files. Is it expected?

Actually, the language must also be registered here

The paxckage.json file dictates which file type the extension should activate on, and the array in main.ts tells which file should be passwe to the LSP.

lefthook triggered when committing, and if it failed

I'll look into this

@ematipico
Copy link
Member Author

Actually, the language must also be registered here

Totally forgot about it! Thank you

@ematipico ematipico force-pushed the feat/add-css-support branch from c285b92 to 0e3f9ed Compare May 21, 2024 10:42
@ematipico
Copy link
Member Author

Screenshot 2024-05-21 at 11 41 01

It works 🚀

package.json Outdated Show resolved Hide resolved
@nhedger nhedger merged commit 2913892 into main Jun 4, 2024
4 checks passed
@nhedger nhedger deleted the feat/add-css-support branch June 4, 2024 19:33
@OliverJAsh
Copy link

OliverJAsh commented Jun 5, 2024

Is there a way to disable this?

Asking because we have these errors after upgrading to Biome 1.8:

image

We are not seeing these errors on the command line. If I understand correctly, with the CLI you have to opt-in.

Listing *.css in files.ignore does not seem to help either.

@ematipico
Copy link
Member Author

You can enable CSS modules parsing, or disable CSS at all until we fix the bug that affects your file

@OliverJAsh
Copy link

OliverJAsh commented Jun 5, 2024

disable CSS at all until we fix the bug that affects your file

Sorry if I'm being slow but I don't see any way to do this (disable CSS parsing)?

https://biomejs.dev/reference/configuration/#css

I tried this but it doesn't help, which makes sense because the error happens during parsing:

biome.jsonc:

  "css": {
    "linter": {
      "enabled": false
    },
    "formatter": {
      "enabled": false
    }
  },

@ematipico
Copy link
Member Author

@OliverJAsh
Copy link

OliverJAsh commented Jun 5, 2024

I understand I can use that to enable parsing for CSS Modules, but I don't want to do that, rather I want to disable CSS parsing altogether. I don't want Biome to run against CSS files in VS Code, like how it already doesn't do that for the CLI (because we haven't opted in).

@nemchik
Copy link

nemchik commented Jun 5, 2024

Sounds like what you want might be related to #97

@ematipico
Copy link
Member Author

I understand I can use that to enable parsing for CSS Modules, but I don't want to do that, rather I want to disable CSS parsing altogether. I don't want Biome to run against CSS files in VS Code, like how it already doesn't do that for the CLI (because we haven't opted in).

I understand that, I will have to think about it and see if I can find a solution for the broader audience.

One day Biome will be a full fledged LSP, so parsing should be something you always get, like the typescript language server in VSCode.

@OliverJAsh
Copy link

OliverJAsh commented Jun 6, 2024

I'm surprised that the the extension still parses CSS files even when they're excluded/ignored in the Biome config file:

biome.jsonc:

  "files": {
    "ignore": [
      "*.css"
    ]
  },

Edit: related issue: biomejs/biome#3749

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

Successfully merging this pull request may close these issues.

4 participants