Sass 3.3でコンパイラーの出すエラー・メッセージがちょっと変わる(った)。Vimプラグインの構文チェッカーで最も有名と思われるSyntasticでは既に反映されているので、これ使っている人は最新版にするだけで良い。僕みたいに使ってない人は書きかえる必要がある。

エラー・メッセージの3.3になって変わった所は色々あるんだけど、最も大きな変更点はミックスイン内部などでエラーが有った場合にそのミックスインの名前などが出るようになったところ。

$ scss --trace --check test.scss
test.scss:2:in `test': Undefined variable: "$foo". (Sass::SyntaxError)

test.scsstestというミックスインでエラーがあるとこうなる(--traceオプション付きの場合)。少なくともこれに対応してやらないとエラーの取りこぼしが起き、エラーがあるのにQuickFixウィンドウに何も出ないとか起きる。

if exists("current_compiler")
  finish
endif
let current_compiler = "sass_scss"

if exists(":CompilerSet") != 2
  command -nargs=* CompilerSet setlocal <args>
endif

let s:cpo_save = &cpo
set cpo&vim

CompilerSet makeprg=scss\ --check\ --trace\ %

CompilerSet errorformat=
      \%f:%l:\ %m,
      \%f:%l:in\ %.%#:\ %m,
      \%-G%.%#

let &cpo = s:cpo_save
unlet s:cpo_save

SassのCLIアプリケーションは--traceオプションを付けてるとVimのerrorformatを書きやすくなる。自前でSassのコンパイラー・プラグインを用意する場合は付けるの前提で書くとすごく楽。