strange handling of null language for when a grammar we don't support is debugged
This commit is contained in:
parent
554ba8db83
commit
49c6a113ad
|
@ -322,6 +322,26 @@ debug = () ->
|
||||||
|
|
||||||
# Language
|
# Language
|
||||||
language = beautifier.getLanguage(grammarName, filePath)
|
language = beautifier.getLanguage(grammarName, filePath)
|
||||||
|
|
||||||
|
if not language?
|
||||||
|
# if the grammar is Null Grammar we probably should not be debugging it
|
||||||
|
title = "Atom Beautify is unable to identify a language"
|
||||||
|
detail = "Atom Beautify is unable to identify a language for provided grammar of: `#{grammarName}`. "
|
||||||
|
if grammarName == 'Null Grammar'
|
||||||
|
detail += "Please select a grammar before running Atom Beautify: Help Debug Editor."
|
||||||
|
else
|
||||||
|
detail += """
|
||||||
|
This very likely means that this grammar is not yet supported. If you would like to request \
|
||||||
|
support for this file and its language, please create an issue \
|
||||||
|
for Atom Beautify at #{pkg.bugs.url}
|
||||||
|
"""
|
||||||
|
atom?.notifications.addWarning(title, {
|
||||||
|
detail
|
||||||
|
dismissable : true
|
||||||
|
})
|
||||||
|
# if we don't know the language stop trying to debug
|
||||||
|
return ""
|
||||||
|
|
||||||
addInfo('Original File Language', language.name)
|
addInfo('Original File Language', language.name)
|
||||||
|
|
||||||
# Get current editor's text
|
# Get current editor's text
|
||||||
|
|
Loading…
Reference in New Issue