Lint active tabs in the editor, when opened or modified.
One question, i noticed that i need to open (and focus) the erroring file in order to find the errors. i had suggested the problems tab idea because i was hoping i would be able to see errors in closed workspace files so that i know which files i need to open and fix. is that impossible?
https://user-images.githubusercontent.com/175330/191370815-4049e181-32b0-4c7c-b931-d421d29e3fc8.mp4
Originally posted by @jjenzz in https://github.com/willofindie/vscode-cssvar/issues/73#issuecomment-1252951874
@phoenisx in response to your https://github.com/willofindie/vscode-cssvar/issues/73#issuecomment-1253164323, could a "lint on save" option work? for example, if i am in a file type that the extension watches and i remove a var, hitting CMD+S would activate linter for all files and list issues in problems tab?
It should! Even I was thinking of only looking for file stats to recalculate the dependent files using the CSS variables.
A few queries before I start working on this (which would be possible only after the next week, as I will be away):
- I guess you are looking for something like
--watchmode, that recalculates the linting warn/errors for all dependent files the moment any source file changes? - Or are you looking for linting updates only for all the open tabs?
I think it's the former. Correct me if I am wrong 👍🏽
yes, something like the former but not sure if continually watching is necessary if it is going to cause the cpu issues you had described before.
i was thinking that when i add/remove a var from any of the files listed in cssvar.files and then save, the save could trigger a lint check across all files (no watching) and list errors in problems tab. then the lint check can behave like it does now when i open an erroring file - resolving the error would lint focused file only because it is the only file that changed.
which would be possible only after the next week, as I will be away
no problem at all, no rush ofc. i'm super grateful that you're even paying attention to my ideas 😅
on second thoughts, i wonder if any of this is really needed given my comment here https://github.com/willofindie/vscode-cssvar/issues/77#issuecomment-1254859450
I still feel adding a watch mode to this extension would be great. Since this extension now already supports linting.
Using a separate library just to enable CSS custom property lints would be too much if they are not using stylelint or any other lint system.
Anyways, that's an option left for the users to decide!! 😉