Sublime Forum

(ST3) ColorHelper

#35

Okay, full SCSS and Sass support should now be in (project scanning and everything). Also made just about every option configurable, so you can turn off whatever you don’t like or don’t use.

So, feature wise, I am going to freeze this. From now on, I will be taking input about current functionality, fixing bugs, possibly cutting features if people feel they don’t make sense or aren’t practical, and tweaking the look.

So please do give feedback, before we get to a final release.

0 Likes

#36

Hi,
This plugin has a ton of potential and I love how it’s shaping up to be, however, I am having some issues though with the indexing (I am assuming) in a big plone project, and the plugin_host ends up eating all my cpu for quite some time. Would it be possible to have a setting to turn off indexing?

0 Likes

#37

At a quick glance, everything seems to work pretty damn good (at least in a single file mode). These day i’ll start a new project and i’ll be able to give a more complete feedback (i.e. find bugs) :sunglasses:

Thanks!

0 Likes

#38

At first sight, sublime became very sluggish (plugin_host.exe uses up to 25% cpu) when i try to open a fairly large project (e.g. laravel codebase). Disabling the plugin will make everything goes smooth again.

0 Likes

#39

@iamntz, I will need a bit of info.

  1. How sluggish are we talking?

  2. Do you get console errors.

  3. If you turn off “enable_project_palette”: false, and restarting, do things pick up (this is the only thing that has to do with big projects; if this doesn’t help it can’t be the indexing).

  4. Try turning off “enable_current_file_palette”: true, (maybe it has to do with a big file)?

I was running this in really large projects. Some projects we have at work are very, very large; once built, they take up over a gig with object files and source code and other crap. They don’t have any real web stuff (or very little), so it probably isn’t indexing many files, but it would have to crawl the entire tree. If you know of a public repo that would be good for me to try, please point me at a link. The whole process is threaded, but python threads are not truly parallel. Maybe I need more than a big project, but the right kind of project to see your problem?

0 Likes

#40

Setting “enable_project_palette”: false solves the problem for me. This is in a project of approx 4GB counting about 127k files, mostly python files. No errors in the console with debug set to true.

0 Likes

#41

I can try and push project size to reproduce, but it may be that project indexing needs to be an external process. If that is the case, I will need a cross platform solution, and may need to disable project indexing until that time. I figured this might be the route I would have to take.

0 Likes

#42

I pushed a couple of fixes, but I also disabled project indexing for now. I need to look into it more. Anyone is welcome to try it, but it appears it may work best in small projects. If you discover anything helpful about the project indexer, then please do share, but I am already aware of performance; though I need to spend more time to try and reproduce.

0 Likes

#43

I think I ran into the same issue with my smart color picker plugin when I tried to run a thread indexer on a large project. I think the multiprocessing module would be better since that module makes better use of multi-core processors, but for the life of me I cannot figure out how to implement it through sublime.

For a plugin I am writing for work I am looking at writing a C# program that will do my indexing as an external process which is what you had talked about doing. All of my users for this plugin are on windows, but making something cross platform may be tough. If I finish the tool and get good performance I will let you know!

0 Likes

#44

The solution needs to be cross platform, not the tool, but I don’t think it would be too hard to have both.

Sublime bombs on multiprocessor, so that is out of the question. I could rely on OSXs and Linux’s python and just call an external python script. That is actually pretty easy. Windows doesn’t come with python installed, so I could bundle a python app with the same code.

I think this would be easily doable.

0 Likes

#45

Updated the opening post. Will finally have an official release soon in conjunction with Markdown Tooltips (mdpopups) as it will be a dependency. Never got around to scanning entire projects, but that is still in the pipe.

0 Likes

#46

It has finally released.

0 Likes

#47

FYI, if you use the Jinja2 package and try to use any package with the mdpopups dependency (such as this one) the Jinja2 package will clash with the jinja2 dependency. There is nothing I can do about that, but there is discussion with the guys over at Package Control of how we are going to fix this, and how we can prevent this moving forward.

0 Likes

#48

Jinja issues should be resolved.

0 Likes

#49

Now that I have this released, I am actually getting feedback which is good, so expect some improvments coming soon.

One big thing coming is a colorpicker built in to the tooltip. It will be optional, so if you want to use the ColorPicker package instead, you are free to do so:

0 Likes

#50

Great plugin!
Now i would like to use it in js files and other files with custom extension (rjss), can we do that?
This would be a great addition!
Thanks

0 Likes

#51

In the case of javascript, I would see the documentation. There is a setting where you can define scopes that are activated for auto-popup. Try to be specific so that we aren’t indexing the entire file. In your case, I would probably do something like (this is not exact) “source.js string.quoted”. The idea is to search quoted strings only in javascript. You can use the plugin ScopeHunter to get the best scopes (or some similar plugin).

Keep in mind, there are commands in the command palette to manually call the color info, palette, or color picker panel. So even if auto-popup isn’t enabled, you can still call up the tooltip when needed.

Note: currently on save, ColorHelper indexes all the colors in the current file and creates a palette. I don’t currently have this ignored in large files, so I am not sure how this scales in really, really large files yet (though if this is a problem, you can turn off indexing the whole file in the settings). I plan to address this in the future.

Anyways, glad you like it. As this is the first time it has been exposed to a large audience, there will probably be some bugs here and there. But it is getting more solid every day.

0 Likes

#52

[quote=“facelessuser”]Now that I have this released, I am actually getting feedback which is good, so expect some improvments coming soon.

One big thing coming is a colorpicker built in to the tooltip. It will be optional, so if you want to use the ColorPicker package instead, you are free to do so:[/quote]

I thought of this too when I saw a more recent screenshot. If you make the images smaller (think 1x1 px) you could probably emulate a pretty detailed picker like we know from image manipulation software (like hue slider and lumination/satuation grid). Only thing I’m unsure about is whether it will be too hard to actually click one of these pixels since you’re probably not allowed to move your mouse away from the link.

0 Likes

#53

Yeah, Sublime not only scales images but distorts them vertically. I’m not sure yet how 1X1 px pics would look. I do plan on refining the things as I eventually upgrade the color box image generator to generate border single border sides. I should be able to make things a little more compact. I also haven’t tested yet how much HTML I can safely push through the tooltip. The color map would be cached, so you only have to wait once for it to generate.

The color picker has already been released. In time I do plan on playing with ways to improve it, but it is pretty functional currently. Once I get past some other improvements and features, I plan on experimenting and pushing it more to see what I can ultimately get out of it.

0 Likes

#54

[quote=“facelessuser”]In the case of javascript, I would see the documentation. There is a setting where you can define scopes that are activated for auto-popup. Try to be specific so that we aren’t indexing the entire file. In your case, I would probably do something like (this is not exact) “source.js string.quoted”. The idea is to search quoted strings only in javascript. You can use the plugin ScopeHunter to get the best scopes (or some similar plugin).

Keep in mind, there are commands in the command palette to manually call the color info, palette, or color picker panel. So even if auto-popup isn’t enabled, you can still call up the tooltip when needed.

Note: currently on save, ColorHelper indexes all the colors in the current file and creates a palette. I don’t currently have this ignored in large files, so I am not sure how this scales in really, really large files yet (though if this is a problem, you can turn off indexing the whole file in the settings). I plan to address this in the future.

Anyways, glad you like it. As this is the first time it has been exposed to a large audience, there will probably be some bugs here and there. But it is getting more solid every day.[/quote]

Ok thanks it works great!
You mention commands in the command palette. Does it mean i can for example “shift+click” to the popup?
Thanks

0 Likes