Skip to content

Commit

Permalink
Enhance scaladoc comment recognition.
Browse files Browse the repository at this point in the history
Fix bug where the doc comments were not recognized if they started in column 1.
Give param name @param and @tparam appropriate scopes.
Replace javadoc style link{...} with scaladoc style [[...]]
  • Loading branch information
sellmerfud committed May 19, 2012
1 parent a3454fd commit fa36d09
Showing 1 changed file with 91 additions and 30 deletions.
121 changes: 91 additions & 30 deletions Syntaxes/Scala.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -179,50 +179,109 @@
<dict>
<key>captures</key>
<dict>
<key>1</key>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.scala</string>
</dict>
</dict>
<key>match</key>
<string>(//).*$\n?</string>
<string>/\*\*/</string>
<key>name</key>
<string>comment.line.double-slash.scala</string>
<string>comment.block.empty.scala</string>
</dict>
<dict>
<key>captures</key>
<key>begin</key>
<string>^\s*(/\*\*)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.scala</string>
</dict>
</dict>
<key>match</key>
<string>/\*\*/</string>
<key>name</key>
<string>comment.block.empty.scala</string>
</dict>
<dict>
<key>begin</key>
<string>/\*</string>
<key>captures</key>
<key>end</key>
<string>\*/</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.scala</string>
</dict>
</dict>
<key>end</key>
<string>\*/</string>
<key>name</key>
<string>comment.line.double-slash.scala</string>
<string>comment.block.documentation.scala</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.documentation.scaladoc.scala</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.parameter.scala</string>
</dict>
</dict>
<key>match</key>
<string>(@param)\s+(\S+)</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.documentation.scaladoc.scala</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.class</string>
</dict>
</dict>
<key>match</key>
<string>(@(?:tparam|throws))\s+(\S+)</string>
</dict>
<dict>
<key>match</key>
<string>@(return|see|note|example|usecase|author|version|since|todo|deprecated|migration|define|inheritdoc)\b</string>
<key>name</key>
<string>keyword.other.documentation.scaladoc.scala</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.documentation.link.scala</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.other.documentation.link.scala</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>keyword.operator.documentation.link.scala</string>
</dict>
</dict>
<key>match</key>
<string>(\[\[)(.*)(\]\])</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(^\s*)?/\*\*</string>
<string>/\*</string>
<key>captures</key>
<dict>
<key>0</key>
Expand All @@ -232,24 +291,26 @@
</dict>
</dict>
<key>end</key>
<string>\*/(\s*\n)?</string>
<string>\*/</string>
<key>name</key>
<string>comment.block.documentation.scala</string>
<key>patterns</key>
<array>
<string>comment.block.scala</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>match</key>
<string>(@\w+\s)</string>
<key>name</key>
<string>keyword.other.documentation.scaladoc.scala</string>
<string>comment.line.double-slash.scala</string>
</dict>
<key>2</key>
<dict>
<key>match</key>
<string>\{@link\s+[^\}]*\}</string>
<key>name</key>
<string>keyword.other.documentation.scaladoc.link.scala</string>
<string>punctuation.definition.comment.scala</string>
</dict>
</array>
</dict>
<key>match</key>
<string>\s*((//).*$)</string>
</dict>
</array>
</dict>
Expand Down Expand Up @@ -663,7 +724,7 @@
<key>1</key>
<dict>
<key>name</key>
<string>variable.parameter</string>
<string>variable.parameter.scala</string>
</dict>
<key>2</key>
<dict>
Expand Down

0 comments on commit fa36d09

Please sign in to comment.