Permalink
Browse files

Cleaned up the syntax and added better catching rules for classes and…

… functions. Code folding works for classes and functions now.
  • Loading branch information...
mthjones committed Apr 28, 2009
1 parent 27ad115 commit e36952839c0c1d982b8c72a0d8225e4ab4f13210
Showing with 311 additions and 122 deletions.
  1. +1 −1 CodeSenseLibraries/Python.xml
  2. +1 −1 CodeSenseProviders/Python.xml
  3. +4 −4 Itemizers/Python.xml
  4. +284 −111 Syntaxes/PythonSyntax.xml
  5. +15 −1 Test/test.py
  6. +6 −4 TextActions/Snippets.xml
@@ -175,7 +175,7 @@ THE SOFTWARE.
<behavior>
<append-dynamic>
<matched-suffix>(\s*:)|[^:]</matched-suffix>
- <transform-into>(${1:source}, ${2:filename}$, ${3:mode}${4:, ${5:flags}${6:, ${7:dont_inherit}}})</transform-into>
+ <transform-into>(${1:source}, ${2:filename}, ${3:mode}${4:, ${5:flags}${6:, ${7:dont_inherit}}})</transform-into>
</append-dynamic>
</behavior>
</completion>
@@ -27,7 +27,7 @@ THE SOFTWARE.
<codesense>
<!-- still broken -->
<provider>
- <selector>python container.function</selector>
+ <selector>python keyword.definition.function ~ *</selector>
<completions>com.mthjones.python.builtins.special-method-names</completions>
<complete-match>[a-zA-Z_]\w*</complete-match>
</provider>
View
@@ -26,17 +26,17 @@ THE SOFTWARE.
-->
<itemizer>
<recipe name="container.function">
- <start-selector>container.function:has-child(name:capture(name)):has-child(whitespace:capture(whitespace))</start-selector>
- <end-selector>sourcecode.python[text == $whitespace.text]</end-selector>
+ <start-selector>container.function:has-child(name:capture(name))</start-selector>
+ <end-selector>delimiter.container.end.function</end-selector>
<subrecipes>
<include-root-recipes />
</subrecipes>
</recipe>
<!-- Matches a class definition -->
<recipe name="container.class">
- <start-selector>container.class:has-child(name:capture(name)):has-child(whitespace:capture(whitespace))</start-selector>
- <end-selector>sourcecode.python[text == $whitespace.text]</end-selector>
+ <start-selector>container.class:has-child(name:capture(name))</start-selector>
+ <end-selector>delimiter.container.end.class</end-selector>
<subrecipes>
<include-root-recipes />
</subrecipes>
Oops, something went wrong.

0 comments on commit e369528

Please sign in to comment.