-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : added config option to
compileOnSave
with default to true
closes #66
- Loading branch information
Showing
5 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var packageName = 'atom-typescript'; | ||
function getConfig(name) { | ||
return atom.config.get(packageName + '.' + name); | ||
} | ||
var Config = (function () { | ||
function Config() { | ||
this.schema = { | ||
compileOnSave: { | ||
title: 'Compile on save', | ||
type: 'boolean', | ||
default: true | ||
} | ||
}; | ||
} | ||
Object.defineProperty(Config.prototype, "compileOnSave", { | ||
get: function () { | ||
return getConfig('compileOnSave'); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return Config; | ||
})(); | ||
var config = new Config(); | ||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
///ts:ref=globals | ||
/// <reference path="../../globals.ts"/> ///ts:ref:generated | ||
|
||
// Documentation https://atom.io/docs/api/v0.177.0/Config and http://json-schema.org/examples.html | ||
// To add a new setting you need to add to | ||
// schema | ||
// getter/setter | ||
|
||
var packageName = 'atom-typescript'; | ||
function getConfig<T>(name: string): T { | ||
return atom.config.get(packageName + '.' + name); | ||
} | ||
|
||
class Config { | ||
schema = { | ||
compileOnSave: { | ||
title: 'Compile on save', | ||
type: 'boolean', | ||
default: true | ||
} | ||
} | ||
get compileOnSave() { return getConfig<boolean>('compileOnSave') } | ||
} | ||
var config = new Config(); | ||
export = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47739d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. Closes #67 . 9:50pm after a working day. Time to sleep ❤️