Skip to content
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

.brackets.json doesn't seem to be changing settings #12

Closed
AhoyLemon opened this issue May 22, 2014 · 24 comments
Closed

.brackets.json doesn't seem to be changing settings #12

AhoyLemon opened this issue May 22, 2014 · 24 comments

Comments

@AhoyLemon
Copy link

I'm guessing this is me doing something wrong, but I'm editing the .brackets.json file and it's not changing the output.

.brackets.json is located in the root folder, here's what I've got in it...

{
"path": {
/* default options /
"frontend/scss/recon.scss": {
"sass.enabled": true,
"sass.options": {
"output": "recon-sassy.css",
"includePaths": ["frontend/scss/partials/"],
"imagePath": null,
"sourceComments": "map",
"sourceMap": "recon-sassy.css.map"
"outputStyle": "compressed"
}
},
/
disable compiling @import files in this project /
"frontend/scss/partials/
.scss": {
"sass.enabled": false
}
}
}

Tried a couple things now, but no matter what, I still get the .css file exporting the same way it did when I started.

@jasonsanjose
Copy link
Owner

Oh, so JSON doesn't actually support /* */ comments, that was in my README for documentation. Try taking that out.

@AhoyLemon
Copy link
Author

Drat. Comments removed, still not getting a recon-sassy file.

{
    "path": {
        "frontend/scss/recon.scss": {
            "sass.enabled": true,
            "sass.options": {
                "output": "recon-sassy.css",
                "includePaths": ["frontend/scss/partials/"],
                "imagePath": null,
                "sourceComments": "map",
                "sourceMap": "recon-sassy.css.map"
                "outputStyle": "nested"
            }
        },
        "frontend/scss/partials/*.scss": {
            "sass.enabled": false
        }
    }
}

@jasonsanjose
Copy link
Owner

Restart Brackets? I haven't hooked up preferences change handling quite yet.

@AhoyLemon
Copy link
Author

Just restarted Brackets and then the laptop for good measure. It's still
writing to recon.css

(sorry, I know tech support is no fun. I'm just not sure what I'm botching
here)

On Thu, May 22, 2014 at 12:39 PM, Jason San Jose
[email protected]:

Restart?


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-43919878
.

@jasonsanjose
Copy link
Owner

Man, I gotta get the compiler error UI finished soon. That would really help.

Try removing includePaths. And just in case there's any confusion, the output file should be relative to the input, so you should see frontend/scss/recon-sassy.scss

@AhoyLemon
Copy link
Author

I'm on a Windows8 laptop. do you think that might be the source of the problem? I'm guessing it's mostly been tested on a Mac?

I just tried a new project and made a new .brackets.json file and test.scss, then...

{
    "path": {
        "test.scss": {
            "sass.enabled": true,
            "sass.options": {
                "output": "dsajdlsadsa.css",
            }
        }
    }
}

Saved and it outputted test.css and test.css.map

eta: Fixed typo in paste.

@jasonsanjose
Copy link
Owner

Ah, there may be a related windows bug here #8 tracking this bug sass/node-sass#231.

@AhoyLemon
Copy link
Author

Oh, that makes sense. I'll try this again tomorrow when I'm on my work Mac to verify Widows is the problem. ("C:\Sites\Recon\frontend\scss": didn't work either)

@AhoyLemon
Copy link
Author

Okay, now I'm on a Mac. Created a new .brackets.json, gave it the code below, made some changes to recon.scss and saved. No recon-sassy still.

{
    "path": {
        "frontend/scss/recon.scss": {
            "sass.enabled": true,
            "sass.options": {
                "output": "recon-sassy.css",
                "imagePath": null,
                "sourceComments": "map",
                "sourceMap": "recon-sassy.css.map"
                "outputStyle": "nested"
            }
        },
        "frontend/scss/partials/*.scss": {
            "sass.enabled": false
        }
    }
}

@jasonsanjose
Copy link
Owner

Bummer. Well, I'm pretty close to getting compiler errors in the UI. As soon as that's ready I'll update this bug. Thanks for helping debug. I appreciate the help.

@AhoyLemon
Copy link
Author

Of course. Let me know if I can do anything else to help.

@jasonsanjose
Copy link
Owner

Would you like to try a beta with compiler errors?

Open Extension Manager, choose Install from URL..., and paste https://github.com/jasonsanjose/brackets-sass/releases/download/0.2.0-1/jasonsanjose.brackets-sass.zip.

You should get compiler errors when you switch to a SCSS file or whenever you save.

@AhoyLemon
Copy link
Author

Got it installed, here's what happens:
Made some changes to recon.scss. Can see changes in the live preview (I did body { background-color:pink; } on line 2 just to see), but then when I look inside of recon.css the style never made it in. Haven't seen a compiler error.

Made a new file called test.scss inside of the scss directory, and gave it a couple of simple styles. It exported to .css (as in [blank].css)

Oh hang on, now I see: If I hit save on either test.scss or recon.scss, the results end up in .css

(This is on OS X)

@jasonsanjose
Copy link
Owner

For the compiler warning, just to be sure, you'll see a yellow warning icon in the status bar. You may need to click the icon to make the panel appear.

image

I'll try to reproduce the bug about a ".css" file output. That sounds pretty odd. If you have a simple project structure and .brackets.json that you can share as a gist at https://gist.github.com/, that would save me some time narrowing down the bug. Thanks again for the help.

@jasonsanjose
Copy link
Owner

Nevermind @AhoyLemon. I figured out the problem that produces .css. Will post an update soon.

@jasonsanjose
Copy link
Owner

So, 2 updates:

  • Fixed a bug when preferences could not be read, output would go to .css file
  • Updated README.md to fix a missing comma the the .brackets.json template

@AhoyLemon Here's an updated build for you to test https://github.com/jasonsanjose/brackets-sass/releases/download/0.2.0-2/jasonsanjose.brackets-sass.zip.

I should have seen the missing comma in your original report, see

"sourceMap": "recon-sassy.css.map"

Sorry about that. Let me know what you find.

@AhoyLemon
Copy link
Author

Tried a couple things here. Rerote the .brackets.json file a couple of ways, broke and fixed the .scss file, tried out a different blank .scss file, and the only error I get is SCSS has timed out after waiting for 10000 ms., and then it fails to compile.

EDIT: Fixed.

@AhoyLemon
Copy link
Author

Started a new project with test.scss just to see if I could make something happen. Gave it good code body { background-color:lime; } hit save and it compiled to .css. Gave it bad code body { background color:lime a { color:$newcolor; } and it didn't compile, telling me again SCSS as timed out after waiting for 10000 ms.

EDIT: Fixed.

@AhoyLemon
Copy link
Author

Okay, I'm thinking my personal version of Brackets on this computer was getting weird, because I fixed the issue by reinstalling Brackets. Deleted the version I had (sprint39), installed a new copy of Sprint39, and now you're plugin is linting my sass. I tried to give it a { background-color: $undefined; } and it correctly pointed out my variable wasn't defined. It does however only do 1, so if I do a:hover { color:$fakecolor; } on the next line it only notices the first.

But anyway, the linting works out now which is great. Unfortunately I'm still no closer to getting the .brackets.json file to work.

@jasonsanjose
Copy link
Owner

Seeing a single compile error is expected. Unfortunately, libsass fails fast.

Well, back to the original bug then right? What does your .brackets.json file look like today?

@AhoyLemon
Copy link
Author

Maybe this will help:

I put together a new project with just the HTML5 boilerplate bones and tried to get it going.

https://github.com/AhoyLemon/Brackets-Sass-test

Currently, using this setup and the latest version of your plugin, no file is created on save. If I rename .brackets.json and restart, it'll build test.css

@jasonsanjose
Copy link
Owner

Got it. There was a problem handling the sourceMap preferences. Try https://github.com/jasonsanjose/brackets-sass/releases/download/0.2.0-3/jasonsanjose.brackets-sass.zip.

@AhoyLemon
Copy link
Author

Whoooooo! sassy.css created, and it's reading my settings changes. Totally working now, thank you so much.

@jasonsanjose
Copy link
Owner

Of course. Thank you for being patient and reporting the bug.

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

No branches or pull requests

2 participants