Adds disabling of linting
This commit is contained in:
parent
68ba9ee827
commit
deb978614c
@ -2,10 +2,14 @@
|
|||||||
|
|
||||||
module.exports = AtomLanguageMZN =
|
module.exports = AtomLanguageMZN =
|
||||||
config:
|
config:
|
||||||
|
enableLinter:
|
||||||
|
type: 'boolean'
|
||||||
|
default: true
|
||||||
|
description: "Enable linting using `mzn2fzn`"
|
||||||
mzn2fznPath:
|
mzn2fznPath:
|
||||||
type: 'string'
|
type: 'string'
|
||||||
default: 'mzn2fzn'
|
default: 'mzn2fzn'
|
||||||
description: "Path to Minizinc's compiler `mzn2fzn`"
|
description: 'Path to Minizinc\'s compiler `mzn2fzn`'
|
||||||
|
|
||||||
activate: (state) ->
|
activate: (state) ->
|
||||||
console.log 'language-mzn: package loaded,
|
console.log 'language-mzn: package loaded,
|
||||||
|
@ -7,6 +7,7 @@ class LinterMZN
|
|||||||
atom.config.get "language-mzn.#{key}"
|
atom.config.get "language-mzn.#{key}"
|
||||||
|
|
||||||
lint: (textEditor) =>
|
lint: (textEditor) =>
|
||||||
|
if @config 'enableLinter'
|
||||||
return new Promise (resolve, reject) =>
|
return new Promise (resolve, reject) =>
|
||||||
output = ''
|
output = ''
|
||||||
command = @config 'mzn2fznPath'
|
command = @config 'mzn2fznPath'
|
||||||
@ -31,6 +32,8 @@ class LinterMZN
|
|||||||
dismissable: true
|
dismissable: true
|
||||||
handle()
|
handle()
|
||||||
resolve []
|
resolve []
|
||||||
|
else
|
||||||
|
return []
|
||||||
|
|
||||||
parse: (output, filePath) =>
|
parse: (output, filePath) =>
|
||||||
messages = []
|
messages = []
|
||||||
|
Reference in New Issue
Block a user