diff --git a/Commands/Validate Syntax.tmCommand b/Commands/Validate Syntax.tmCommand new file mode 100644 index 0000000..5c1cfc5 --- /dev/null +++ b/Commands/Validate Syntax.tmCommand @@ -0,0 +1,41 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby18 +require ENV['TM_SUPPORT_PATH'] + '/lib/textmate' +require 'yaml' + +begin + YAML.load(STDIN.read) + puts "Valid YAML, no errors" +rescue ArgumentError => error + puts error.message + TextMate.go_to :line => $1, :column => ($2.to_i + 1) if error.message =~ /line (\d+).*col (\d+)/ +end + + input + selection + inputFormat + text + keyEquivalent + ^V + name + Validate Syntax + outputCaret + afterOutput + outputFormat + text + outputLocation + toolTip + scope + source.yaml + uuid + 249C3B83-1F1D-4563-A5B7-DC208820BEA1 + version + 2 + +