Fixes #839. Throw error if languages have same namespace
Also fix XTemplate & Riot.js
This commit is contained in:
parent
3a6763a25c
commit
3f51b02e25
|
@ -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"] = {
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
|||
|
||||
name: "Riot.js"
|
||||
description: "Riot.js HTML based templating language"
|
||||
namespace: "html"
|
||||
namespace: "riot"
|
||||
fallback: ['html', 'mustache']
|
||||
|
||||
###
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module.exports = {
|
||||
|
||||
name: "XTemplate"
|
||||
namespace: "html"
|
||||
namespace: "xtemplate"
|
||||
fallback: ['html','mustache']
|
||||
|
||||
###
|
||||
|
|
Loading…
Reference in New Issue