Giter VIP home page Giter VIP logo

Comments (5)

ota-meshi avatar ota-meshi commented on June 5, 2024 1

It is possible to opt out of a specific language by excluding it from the setting of the "stylelint.validate" option in #79.
However, specific languages can also be excluded from codeActionsOnSave using the options currently available.

  "[javascript]": {
    "editor.codeActionsOnSave": {
      "source.fixAll.stylelint": false
    }
  }

https://github.com/stylelint/vscode-stylelint#editorcodeactionsonsave

I think the problem is that non-CSS-like languages are targeted by default. So I think it is necessary to change the default option of "stylelint.validate".
I think "stylelint.validate" should be configured with css, scss, sass, less, html, vue, postcss and sugarss by default.
Users can add javascript, markdown and etc. by configuration according to their needs.
However, this will be a breaking change.

from vscode-stylelint.

axelboc avatar axelboc commented on June 5, 2024

With the latest version of VSCode, editor.codeActionsOnSaveTimeout is now deprecated. VSCode no longers stops all formatting when stylelint takes too long; instead, it shows a popup when the formatting starts taking too long. It doesn't remove the issue, especially not when it comes to all file types being affected.

from vscode-stylelint.

ntwb avatar ntwb commented on June 5, 2024

Thanks, @axelboc, will try to debug this via some tests today if possible

We had added this to our docs, so I'll remove that now:

https://github.com/stylelint/vscode-stylelint#commands
Also note that there is a time budget of 750ms to run code actions on save which might not be enough for large files. You can increase the time budget using the editor.codeActionsOnSaveTimeout setting.

And for reference:

https://code.visualstudio.com/updates/v1_42#_handling-slow-save-operations
Handling slow save operations#

VS Code allows extensions to change a file's contents when saving files to disk. Features like Format on Save and Fix on Save are examples. However, saving is a critical operation and extensions doing processing during a save must finish quickly so that the actual save operation can proceed. "Quickly" used to be enforced by VS Code, where VS Code would cancel extension save operations after a timeout. That enforcement guaranteed speedy saving but could be frustrating because sometimes expected processing would not happen.

With this release, we have given up the timeout-based approach and instead show a progress notification that allows you to cancel extensions participating in save ("Save Participants"). The notification lets you know that save operations are running and you can decide if you want to wait for a save participant to finish or not.

from vscode-stylelint.

jeddy3 avatar jeddy3 commented on June 5, 2024

What's most surprising to me is that it affects non-CSS files

stylelint supports more languages than just CSS.

and it shouldn't take so long on CSS files either anyway

We're tracking this in stylelint/stylelint#2454

It doesn't remove the issue, especially not when it comes to all file types being affected.

I agree. We need to make it easy for users to opt-out of certain language support.

@ota-meshi Will #79 resolve this? If so, I think we can close this once we've merged and documented this feature.

from vscode-stylelint.

adalinesimonian avatar adalinesimonian commented on June 5, 2024

v1 will only enable validation/actions/formatting for documents with language identifiers css, less, and postcss by default, following in line with changes in Stylelint 14 which remove the syntax option and require explicitly opting in to validating non-CSS files using customSyntax and overrides. I think this should resolve this issue, so I'm going to close it. Post-v1 release, which should be happening shortly, if this is not addressed, please feel free to reopen the issue.

from vscode-stylelint.

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.