Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Doesn't refresh with config changes #80

Closed
corysimmons opened this issue Feb 8, 2016 · 13 comments
Closed

Doesn't refresh with config changes #80

corysimmons opened this issue Feb 8, 2016 · 13 comments

Comments

@corysimmons
Copy link

Seems to read the config one time when Atom is first loaded. As a result, any time I need to change something in my config I need to restart Atom completely. Kind of annoying when I'm making a config from scratch and need to restart Atom every minute for tons of rules.

@corysimmons
Copy link
Author

Actually, to be more specific about this problem, it only requires a restart when I have an invalid rule in there (like something set to false).

After I remove the invalid rule and save. I can close my stylesheet and reopen it and it still doesn't update. I still have to restart Atom completely.

Even so, it would be nice to not even have to reopen the file, much less the editor on any changes to the config file.

@Arcanemagus Arcanemagus added the Bug label Feb 8, 2016
@Arcanemagus
Copy link
Member

Hmmm, I wonder if this is a bug in cosmicconfig? This package doesn't really do any processing of the config file on its own.

Do you get an error shown in Atom saying "Unable to parse stylelint configuration"?

@corysimmons
Copy link
Author

No I don't. It just seems like it's still using the same old config until I restart Atom.

@davidtheclark
Copy link
Contributor

It's not a bug with cosmiconfig or stylelint, it's just the way this plugin works, right? — loading the config upfront and not refreshing it. If you searched out the configuration file every time you ran the linter, or if you somehow watched the config file for changes and updated accordingly, you should get those updates.

I wonder how the eslint plugin does this? Because I think that config changes are updated without restarting Atom.

@corysimmons, One shortcut in the meanwhile is to just Reload Atom (on Mac it's View > Reload), which I've found refreshes plugin settings.

@corysimmons
Copy link
Author

@davidtheclark I've actually migrated back to Sublime Text. Atom is amazing.. It's plugin system is amazing.. but no one can deny it's insanely slow. It didn't really bother me until I started adding in all the linters. Now it just crawls.

@Arcanemagus
Copy link
Member

@davidtheclark Actually it is attempting to determine the config on every lint call (here), which is why this makes no sense to me unless cosmicconfig is somehow caching the results.

linter-eslint also reconfigures everything on every lint call, but it does all this work in a separate worker thread so the time spent working on that doesn't block Atom. For the newer configuration options it seems to handle changes properly, but it seems that we might still be hitting an eslint bug in there with caching the results.

(For the longest time eslint simply did a require(configPath) which works just fine when running on the CLI... but we have a permanently running worker thread which they apparently never thought of somebody doing and it cached the configuration like all require calls do.)

@corysimmons If you are having issues with performance you can either disable linting on the fly or simply bump up the delay before it triggers a lint (I personally use 1500 ms). Admittedly though there is a lot of work that can be done to improve things, just not enough people working on it to get all the linter plugins done.

@corysimmons
Copy link
Author

If you are having issues with performance you can either disable linting on the fly or simply bump up the delay before it triggers a lint (I personally use 1500 ms).

Nah, it seems like a big problem with Atom that will take months to years of talking to decide upon a course of action (yay GitHub) and probably a complete rewrite to solve. I should be able to run a few plugins side-by-side without my editor crawling.

Relevant to all these issues and your comment: I'm getting tired of wasting time trying to make broken tools work for me, and if there are alternatives out there I'm going to use them instead.

Admittedly though there is a lot of work that can be done to improve things, just not enough people working on it to get all the linter plugins done.

Isn't Atom a GitHub project? Why didn't they develop this key feature? Why don't they spend some of their billions of dollars on developers? This kind of fundamental stuff (a linter that can handle 2 or 3 syntaxes without dying) is built right into VSCode.

I'm beginning to think if a 1.0.0+ project is broken and there are better alternatives out there, the maintainer of those projects should shut them down and they should put their efforts towards the alternative instead of blowing money on advertising.

This prevents broken projects from wasting hours, days, weeks, of people's time.

@keithamus had the maturity to do this at mysticatea/npm-run-all#10 and as a result a much better tool will be made that everyone can enjoy instead of dozens of broken tools that generally do the same thing.

@davidtheclark
Copy link
Contributor

@Arcanemagus: Neither stylelint nor cosmiconfig should be caching any results. Weird. At some point soonish I will try to look into it and see if I can find any clues as to why this isn't working as expected.

@Arcanemagus
Copy link
Member

@corysimmons I wasn't saying you shouldn't use what works for you, just suggesting ways to help mitigate the issues you were seeing if you were still interested in Atom. Also it sounds like from your comments you feel that the "AtomLinter" org is in some way related to GitHub or the official Atom repo, just wanted to clarify that this is a third party collection of tools...

@davidtheclark I've never been able to reproduce it, and the few people that have reported it have stopped responding to requests for steps to reproduce it, so I haven't been able to get far on it 😕.

@corysimmons
Copy link
Author

Also it sounds like from your comments you feel that the "AtomLinter" org is in some way related to GitHub or the official Atom repo, just wanted to clarify that this is a third party collection of tools...

No, I know AtomLinter is community. I was complaining that GitHub was too cheap to pay for a team of developers to do it right (be able to run 2 or 3 linters without Atom crawling).

@davidtheclark
Copy link
Contributor

@Arcanemagus: You're right -- I'm not able to reproduce (even when putting deliberate errors in the config as suggested). I'm trying on Mac. Tomorrow when I'm back at work I'll give it a shot on a Linux machine and possibly a Windows machine, too.

@davidtheclark
Copy link
Contributor

I also cannot reproduce in Linux or Windows.

@Arcanemagus
Copy link
Member

Marking this as closed as nobody has been able to reproduce this and the steps given do not show this issue.

If anyone sees this again please file a new issue and include any information you can on how to reproduce this.

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

No branches or pull requests

3 participants