-
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix broken commenting when the Go package is disabled
close #797
- Loading branch information
DisposaBoy
committed
Dec 8, 2017
1 parent
1fd23d5
commit 749ac22
Showing
3 changed files
with
128 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>name</key> | ||
<string>Comments</string> | ||
<key>scope</key> | ||
<string>source.go</string> | ||
<key>settings</key> | ||
<dict> | ||
<key>shellVariables</key> | ||
<array> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_START</string> | ||
<key>value</key> | ||
<string>// </string> | ||
</dict> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_START_2</string> | ||
<key>value</key> | ||
<string>/*</string> | ||
</dict> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_END_2</string> | ||
<key>value</key> | ||
<string>*/</string> | ||
</dict> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_DISABLE_INDENT_2</string> | ||
<key>value</key> | ||
<string>yes</string> | ||
</dict> | ||
</array> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>name</key> | ||
<string>Indentation Rules</string> | ||
<key>scope</key> | ||
<string>source.go</string> | ||
<key>settings</key> | ||
<dict> | ||
<key>decreaseIndentPattern</key> | ||
<string><![CDATA[(?x) | ||
^ # start of line | ||
(.*\*/)? # skip comments if present | ||
( # three possibilities | ||
\s* \} # whitespace and a closing curly brace | ||
( # capture: | ||
[^}{"']* \{ # anything other than curly braces or quotes, then open curly | ||
)? # (optional) | ||
[;\s]*? # any whitespace or semicolons | ||
| | ||
(?:\s* (case|default).*:) # case statements pop back one indent | ||
| | ||
(?: \) (?<! \( ) ) # closing braces not preceded by opening braces | ||
) | ||
(//.*|/\*.*\*/\s*)? # skip any comments (optional) | ||
$ # end of line | ||
]]></string> | ||
<key>increaseIndentPattern</key> | ||
<string>(?x) | ||
^ | ||
(?: .* \*/ )? # skip any comments | ||
(?: | ||
(.* \{ [^}"'\n]*) # lines containing an open curly but no quotes or close curly | ||
| # OR | ||
(?:\s* (case|default).*:) # case statements | ||
| # OR | ||
(.* \( [^)"'\n]*) # lines containing an open brace but no quotes or close brace | ||
) | ||
(//.*|/\*.*\*/\s*)? # skip any comments (optional) | ||
$ | ||
</string> | ||
<!-- | ||
<key>indentNextLinePattern</key> | ||
<string>(?x)^ | ||
(?! .* [;:{}] # do not indent when line ends with ;, :, {, or } | ||
\s* (//|/[*] .* [*]/ \s* $) # …account for potential trailing comment | ||
) | ||
</string> | ||
--> | ||
<key>unIndentedLinePattern</key> | ||
<string>^\s*((/\*|\*/|//|import\b.*|package\b.*).*)?$</string> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters