-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add CSS-Intellisense plugin #8939
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some problems:
- sort your package correctly
- remove the package_control.json and sublime-package.json files from the package, package control will take care of those
- you shouldn't read settings on plugin load: they're always served from memory can be read at will. that way you also ensure you get the latest version of the setting as users edit them.
- similarly you will want to update your package on any changes to the settings, also when those don't happen through your specific commands - and not through polling as you're doing with with the cache refresh how. there should be event listeners you could use.
In general I understand the utility (although I wonder if a language service wouldn't be a better approach). However, it seems to be very much set up for a single project. You might want to investigate the use of project settings to allow users to set up "css_folders" for different projects. If you working on many projects those "global" settings will just continue to grow over time.
In its current state I would say the package is a bit too naive to be generally useful (although I can totally see how it works well for you). Maybe you can get others to contribute insights and maybe even code, for instance by talking about it on the Sublime forums and Discord.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automated testing result: SUCCESS
Repo link: CSS Intellisense
Packages added:
- CSS Intellisense
Processing package "CSS Intellisense"
- All checks passed
Looks like you re-formatted the entire JSON file. Please don't do that 😉 |
If you have all your settings covered in your default settings file, it's better to not have those default duplicated in both settings.get calls and the defaults for the class properties. You end up effectively defining your defaults 4 times and they get out of sync (have a close look at your scopes setting for instance). I wonder if the way you handle settings now, where they're both user settings and temporary caches, doesn't cause issues somewhere down the line. You miss out on Sublime's default handling of automatically updating settings internally whenever users change settings. You seem to end up going deeper and deeper into that rabbit hole, having to call your load_settings method every time your package wants to do anything. Maybe it makes sense to separate "pure" settings from the caches. That way you can simply use Sublime's api to get and set settings like |
Please respond to the feedback to continue the review. |
My package is CSS-Intellisense
My package is similar to "IntelliSense for CSS class names in HTML" from vscode However it should still be added because very useful when developing html page.