Fixes #839. Throw error if languages have same namespace

Also fix XTemplate & Riot.js
This commit is contained in:
Glavin Wiechert 2016-03-02 12:47:28 -04:00
parent 3a6763a25c
commit 3f51b02e25
3 changed files with 8 additions and 2 deletions

View File

@ -262,6 +262,12 @@ module.exports = class Beautifiers extends EventEmitter
beautifiers = lang.beautifiers
optionName = "language_#{lang.namespace}"
# Check if namespace has already been used
if _.has(flatOptions, "#{optionName}_disabled")
error = new Error("Language named '#{name}' has an already used namespace #{lang.namespace}.")
atom.notifications?.addError(error.message, {
stack: error.stack, detail: error.message, dismissable : true})
throw error
# Add Language configurations
flatOptions["#{optionName}_disabled"] = {

View File

@ -2,7 +2,7 @@ module.exports = {
name: "Riot.js"
description: "Riot.js HTML based templating language"
namespace: "html"
namespace: "riot"
fallback: ['html', 'mustache']
###

View File

@ -1,7 +1,7 @@
module.exports = {
name: "XTemplate"
namespace: "html"
namespace: "xtemplate"
fallback: ['html','mustache']
###