Can't set themes with Base16 Syntax package


#1

Hi guys …

I’m trying to get Base16 Syntax package to work. But I cant seem to get any syntax highlighting at all. I just get a darkish gray fontcolor.

In the dev console I get:

Error compiling less stylesheet: /home/g00nz/.atom/packages/base16-syntax/themes/styles/dark.less
Line number: 1
’/home/g00nz/.atom/packages/base16-syntax/themes/schemes/atelier-dune.less’ wasn’t found theme-manager-plus.coffee:34
ThemeManagerPlus.loadLessStylesheet theme-manager-plus.coffee:34
ThemeManagerPlus.requireLessStylesheet theme-manager-plus.coffee:19
Base16.enableTheme base16.coffee:33
Base16SelectListView.selectItemView base16-select-list-view.coffee:33
module.exports.SelectListView.selectNextItemView /usr/share/atom/resources/app/src/select-list-view.js:237
(anonymous function) /usr/share/atom/resources/app/src/select-list-view.js:93
jQuery.event.dispatch /usr/share/atom/resources/app/node_modules/space-pen/vendor/jquery.js:4676
elemData.handle /usr/share/atom/resources/app/node_modules/space-pen/vendor/jquery.js:4360
module.exports.KeymapManager.dispatchCommandEvent /usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:400
module.exports.KeymapManager.handleKeyboardEvent /usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:181
module.exports.WindowEventHandler.onKeydown /usr/share/atom/resources/app/src/window-event-handler.js:137

Does the package got any dependencies or? Ive checked the scheme directory and I got the .less files in the right place.

Best regards
/Roger


#2

Works fine for me:

How did you install it, via the Settings View I assume?
Can you also post a screenshot of what it looks like for you?

What’s the Atom version?


#3

Base16 Syntax does not need any other dependencies. I added the ‘ThemeManagerPlus’ class to support dynamic import statements (it allows me to prepend a string to a stylesheet when it needs to be loaded). I hope that one day Atom’s ThemeManager class will support this, so that changing less variables or imports becomes much easier.

I assume you get a result like this, since this is what happens when the stylesheet cannot be loaded:

Does this error also occur if you type in Base16 Syntax: Select Theme in the Command Palette and select your desired theme from there?

I also realize my fallback isn’t working. If a theme for whatever reason can not be found (for example if a user types in something funny in the Settings View) it should load the default theme. Hopefully I can fix this tomorrow, but that won’t solve the issue you are having.


#4

@batjko: Alchiadus posted the exact screen that I get. I installed it from the settings/packages screen by searching for it. I guess I can remove it and try it with apm instead.

@Alchiadus: Ya, the screenshot is exactly what I get. And yes, I have tried to use the Command Palette and I see the themes, but no matter what I select Im still left with the error and the posted screenshot. I’ve verified that att got the .less files for the themes in my ~/.atom/packages/base16-syntax/themes/schemes. In the styles directory I got 2 files, light.less and dark.less.

UPDATE:
Same thing pulling it in with apm.


#5

I’ve tried to copy the path from the error message with ‘cat’ infront off it and I get the output of the less file. Still my development console tells me it cant find it.

I’ve also checked the UNIX permissions and Im the owner of the dirs and files, got rw on files, rwx on dirs.


#6

Have you tried restarting Atom? I occasionally see this when installing a new theme because something gets borked with the unload/reload theme process.


#7

Yes, tried multiple times and had it closed while installing the package with apm.


#8

Thanks, that was going to be my next question.

I was unaware of this and I have never had this happen but this could be a good starting point for me to start investigating. I have to manually load / remove the stylesheets when needed.

@rogernordqvist: Does the default theme load after installation or do you get an unstyled view right from the start?


#9

I got the unstyled view from the beginning. Never seen any colors at all :slight_smile:


#10

If this can be a clue, I’ve compiled atom on another machine (virtual) as I am running nvm on this one and I dont want a systemwide node.js. Both machines are 14.04 64bit though. Built a dpkg that I have installed on my regular workstation.

On a machine where you build it against a systemwide node.js installation, does any environment variables get set durring installation? Is my enviornment complete after a dpkg package installation?

UPDATE:

  • I’ve deleted nvm, removed .npm and .nvm and .atom.
  • Installed systemwide node.js
  • cloned latest atom repo, built it and installed it with the grunt method.
  • Installed Base16-Syntax again.

I still get the same result as the screenshot you posted, @Alchiadus
Trying to change themes yields the same result. No colors.

What atom builds are you running guys? My previous was .121, now after rebuild 124.
Have something changed in the later releases perhaps?


#11

I was using Atom 0.120.0, updated to 0.123.0. On my Windows machine everything works fine. To try to replicate your issue I installed the package on an Ubuntu 14.04 machine with Atom 0.123.0 and I also got the error you are seeing. Before releasing the package I tested it on the same Ubuntu machine with Atom 0.120.0 and had no problems. I will investigate further tomorrow.


#12

Thank god you’ve been able to replicate the problem so you dont think Im crazy …

Appreciate you effort!


#13

I think one major difference since v120 is that the React Editor is now turned on by default.
Might be worth checking what it looks like with that setting turned off (and the file reloaded).


#14

OK, I’ve tried with and without React (with and without acceleration). Same result, restarted atom between tests.


#15

I would say the major differences are node v0.11.13 and Chrome 36 being shipped in Atom.
I’m not sure why React or hardware acceleration could have an impact on the compilation of less files.

It seems to me that this is an issue with a package, because I can’t find the theme-manager-plus.coffee file in atom sources. There’s a theme-manager.coffee but no theme-manager-plus.coffee.


#16

For what I can understand and see, you got the file: theme-manager-plus.coffee in the /lib directory of the Base16-Syntax plugin itself.


#17

Correct, that’s part of the package. I needed a way to dynamically change import statements (or variables) in less stylesheets. I could not find a way to do this properly, so I created theme-manager-plus.coffee to do that. The sooner I can get rid of it the better, but I haven’t found another way to change less import statements.

@rogernordqvist: I manged to find and hopefully fix the issue. The import statement used an absolute path created by path.join and for some reason if I change it to a relative path, it can find the imported stylesheet. I released an update, could you verify this solved the problem for you?


#18

That is the same theme I am using. Could it be causing this issue?


#19

If you did atom --safe it should have not loaded the theme but you said the issue didn’t go away.

(Also, edited your post to put the link on its own line to make the link prettier. I hope you don’t mind.)


#20

@Alchiadus
Sure, could you perhaps provide me with a diff so I’m not changing anything I’m not suppossed to :blush: