Skip to content

Commit

Permalink
Many syntax highlight changes - Symbols List - Validation:
Browse files Browse the repository at this point in the history
 * Puppet syntax validation (puppet --parseonly)
 * Symbol List (Class/Node/Define, then resources)
 * Various syntax highlight changes:
  + define, and define parameters
  + class/node names
  + single quoted strings
  + resource title
  + variables
  • Loading branch information
Brice Figureau committed Aug 16, 2008
1 parent 6c4ac48 commit 9eaa9a4
Show file tree
Hide file tree
Showing 6 changed files with 399 additions and 52 deletions.
27 changes: 27 additions & 0 deletions Puppet.tmbundle/Commands/Validate Syntax (puppetparse).tmCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>saveActiveFile</string>
<key>command</key>
<string>#!/usr/bin/env ruby
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate'
puts "Running syntax check...\n"
result = `puppet --color=false --confdir=/tmp/puppet --vardir=/tmp/puppet --parseonly $TM_FILEPATH`
puts result
TextMate.go_to :line =&gt; $1 if result =~ /:(\d+)$/</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>^V</string>
<key>name</key>
<string>Validate Syntax (puppetparse)</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
<string>source.puppet</string>
<key>uuid</key>
<string>1DBD7B78-91F3-4528-9AC9-B71D9E5FE445</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>SymbolList (class|node|define)</string>
<key>scope</key>
<string>source.puppet entity.name.function entity.name.type</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
</dict>
<key>uuid</key>
<string>DCFE74BF-4295-47AB-B91E-66A5761BFA96</string>
</dict>
</plist>
19 changes: 19 additions & 0 deletions Puppet.tmbundle/Preferences/SymbolList (resource).tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>SymbolList (resource)</string>
<key>scope</key>
<string>source.puppet entity.name.section</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<key>symbolTransformation</key>
<string>s/^(.*):/ $1/</string>
</dict>
<key>uuid</key>
<string>13DD53A2-401B-4149-82B0-001374330B40</string>
</dict>
</plist>
51 changes: 51 additions & 0 deletions Puppet.tmbundle/Syntaxes/Puppet.tmDelta
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>changed</key>
<dict>
<key>repository.variable.patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.variable.puppet</string>
</dict>
</dict>
<key>match</key>
<string>(\$)([a-zA-Zx7f-xff\$]|::)([a-zA-Z0-9_x7f-xff\$]|::)*\b</string>
<key>name</key>
<string>variable.other.readwrite.global.puppet</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.variable.puppet</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.variable.puppet</string>
</dict>
</dict>
<key>match</key>
<string>(\$\{)(?:[a-zA-Zx7f-xff\$]|::)(?:[a-zA-Z0-9_x7f-xff\$]|::)*(\})</string>
<key>name</key>
<string>variable.other.readwrite.global.puppet</string>
</dict>
</array>
</dict>
<key>deleted</key>
<array/>
<key>isDelta</key>
<true/>
<key>uuid</key>
<string>AAF4E089-E3C9-4FB9-B099-FD2CCBD4E786</string>
</dict>
</plist>
Loading

0 comments on commit 9eaa9a4

Please sign in to comment.