Skip to content
This repository was archived by the owner on Mar 10, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ Open VSCode Editor and Press `ctrl+P`, type `ext install live-sass`.
```
<hr>

* **`liveSassCompile.settings.watchOnLaunch` :** Set this to `true` if you want Live Sass Compiler to automatically start watching your .sass or .scss file when you open an applicable workspace.
* *Default value is `true`*
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Default is false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah man. What a silly thing to over look :(

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I was confused. I was thinking where you made the mistake - in the docs or project.json..

Anyway, I've published the #41 to marketplace.. so, this PR will be published by tomorrow..

Thanks a lot for your contribution


<hr>


## Extension Dependency
This extension has dependency on _[Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)_ extension for live browser reload.

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@
],
"default": null,
"description": "Automatically add vendor prefixes to unsupported CSS properties (e. g. transform -> -ms-transform). Specify what browsers to target with an array of strings (uses [Browserslist](https://github.com/ai/browserslist)). Pass `null` to turn off. \nDefault is `null`"
},
"liveSassCompile.settings.watchOnLaunch": {
"type": "boolean",
"default": false,
"description": "Set this to `true` if you want Live Sass Compiler to automatically start watching your .sass or .scss file when you open an applicable workspace\nDefault is `false`"
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/StatubarUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ export class StatusBarUi {
return StatusBarUi._statusBarItem;
}

static init() {
static init(watchOnLaunch) {
StatusBarUi.working("Starting...");

setTimeout(function(){
StatusBarUi.notWatching();
},1000);
watchOnLaunch ? StatusBarUi.watching() : StatusBarUi.notWatching();
}, 1000);
}

static watching() {
Expand Down
9 changes: 8 additions & 1 deletion src/appModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ export class AppModel {

constructor() {
this.isWatching = false;
StatusBarUi.init();
let watchOnLaunch = Helper.getConfigSettings<boolean>('watchOnLaunch');

StatusBarUi.init(watchOnLaunch);

if (watchOnLaunch) {
console.log("\"live-sass-compiler\" is set to watch sass files on launch");
this.toggleStatusUI();
}
}

static get basePath(): string {
Expand Down