     grammarName = editor.getGrammar().name.toLowerCase()
     isCSS  = grammarName is 'css'
     isScss = grammarName is 'scss'
+    isSass = grammarName is 'sass'
     isLess = grammarName is 'less'
     isHTML = grammarName is 'html'
 
     syntax = 'css'
     if isCSS  then syntax = 'css'
     if isScss then syntax = 'scss'
+    if isSass then syntax = 'sass'
     if isLess then syntax = 'less'
     if isHTML then syntax = 'css'
 

        sorted = csscomb.processString(selected, {
          syntax: syntax
        })
        if isCSS
          sorted = CSSBeautify(sorted, {
            indent: '  '
          })
        editor.setTextInBufferRange(editor.getSelectedBufferRange(), sorted)
      catch e
        console.log(e)


module.exports =

  config:
    executeOnSave:
      title: 'Execute on save'
      description: 'Execute sorting CSS property on save.'
      type: 'boolean'
      default: false

  activate: (state) ->
    atom.commands.add 'atom-workspace', 'csscomb:execute', () => @execute()
    @editorObserver = atom.workspace.observeTextEditors (editor) =>
      editor.getBuffer().onWillSave () =>
        if (@isExecuteOnSave())
          @execute()

  deactivate: ->
    @editorObserver.dispose()

  isExecuteOnSave: ->
    atom.config.get('atom-csscomb.executeOnSave')

  execute: ->
    editor = atom.workspace.getActiveTextEditor()
