vprimachenko / Sublime-Colorcoder

Semantic highlight for Sublime Text
290 stars 25 forks source link

auto create color/language custom theme #3

Closed farfromrefug closed 10 years ago

farfromrefug commented 10 years ago

I am very interested by your plugin but the fact that we have to maintain a custom theme/language for any combination seems really tough.

Couldn't you auto generated those files? https://github.com/Kronuz/ColorHighlighter does that for the theme at least and it's very practical

vprimachenko commented 10 years ago

something like this is actually on the roadmap

farfromrefug commented 10 years ago

great to hear! Thanks

vprimachenko commented 10 years ago

added in last commit

farfromrefug commented 10 years ago

Just tried it. Doesn't look like the theme is created

theme loaded
Traceback (most recent call last):
  File "colorcoder in /Volumes/data/mguillon/Library/Application Support/Sublime Text 3/Installed Packages/Colorcoder.sublime-package", line 84, in <lambda>
  File "colorcoder in /Volumes/data/mguillon/Library/Application Support/Sublime Text 3/Installed Packages/Colorcoder.sublime-package", line 122, in modify_color_scheme
  File "./plistlib.py", line 90, in writePlist
FileNotFoundError: [Errno 2] No such file or directory: '/Volumes/data/mguillon/Library/Application Support/Sublime Text 3/Packages/Colorcoder/Tubster (SL) (Colorcode).tmTheme'

Looking at the directory, no such file exist. I should mention that i use ColorHilghlighter too.

vprimachenko commented 10 years ago

actually that would be the modified copy of the theme... damn i don't have a mac to debug this

please try to replace sublime.packages_path() with sublime.installed_packages_path() in the plugin code and rerun the command

vprimachenko commented 10 years ago

@farfromrefug also did you install the plugin via package control or github? does /Volumes/data/mguillon/Library/Application Support/Sublime Text 3/Packages/Colorcoder/ exist at all?

farfromrefug commented 10 years ago

So i installed the package through PC using your repo url. So to do the test i had to moved the package from a "sublime-package" to an unzipped folder. I then made the modification and still no luck

Package Control: Skipping automatic upgrade, last run at 2014-02-19 14:17:10, next run at 2014-02-19 15:17:10 or after
Traceback (most recent call last):
  File "/Volumes/data/mguillon/Library/Application Support/Sublime Text 3/Packages/Colorcoder/colorcoder.py", line 84, in <lambda>
    sublime.active_window().show_input_panel("Lightness and Saturation","0.5 0.5",lambda text: modify_color_scheme(*map(str,text.split(' '))),None,None)
  File "/Volumes/data/mguillon/Library/Application Support/Sublime Text 3/Packages/Colorcoder/colorcoder.py", line 122, in modify_color_scheme
    plistlib.writePlist(cs,"%s%s" % (sublime.installed_packages_path(),newname))
  File "./plistlib.py", line 90, in writePlist
FileNotFoundError: [Errno 2] No such file or directory: '/Volumes/data/mguillon/Library/Application Support/Sublime Text 3/Installed Packages/Colorcoder/Tubster (SL) (Colorcode).tmTheme'
SublimeLinter: jshint activated: /usr/local/bin/jshint 

But is that the correct path to get the "User" folder inside packages? That s where ColorHighlighter put the theme. Maybe you should do look at its code.

Thanks for support

vprimachenko commented 10 years ago

@farfromrefug my thanks for helping me diagnose this - plase remove all Colorcoder stuff and try this packageit will show a few more debug messages

vprimachenko commented 10 years ago

also drop by freenode.net#colorcoder, lets discuss it there

farfromrefug commented 10 years ago

ok great news, that one works!

Colorcoder: name=Packages/User/Tubster (SL).tmTheme
Colorcoder: newname=/Colorcoder/Tubster (SL) (Colorcode).tmTheme
Colorcoder: pp=/Volumes/data/mguillon/Library/Application Support/Sublime Text 3/Packages
PP/Colorcoder does not exists - creating
about to write to /Volumes/data/mguillon/Library/Application Support/Sublime Text 3/Packages/Colorcoder/Tubster (SL) (Colorcode).tmTheme
setting color_scheme to Packages/Colorcoder/Tubster (SL) (Colorcode).tmTheme
found 1 files for base name Flatland Dark.sublime-theme
ApplySyntax: Syntax already set to Packages/XML/XML.tmLanguage
theme loaded

Now it does really do what it is supposed to do. I think it is "colorising" functions instead of variables (or a mix) Here is a java example. See that TAG is colorised, but classes and functions are too.And 'preferences' and 'systemProperties' are not And here is a javascript example.

Does that mean those languages need a special language file?

vprimachenko commented 10 years ago

this or add more scopes to plugins list (scopes setting)