guillermooo/dart-sublime-bundle

Comment name for `///` doesn't match ST3 convention

Opened this issue · 4 comments

I came across this issue while troubleshooting an issue in the Wrap Plus bundle for ST3. The "dartdoc" style comment /// is named TM_COMMENT_BLOCK_START, which doesn't fit the ST3 convention. The convention says it should be called TM_COMMENT_START_2.

Indeed, other plugins (such as Wrap Plus) cannot detect the existence of this comment style because of the misnomer.

diff --git a/Support/Comments.tmPreferences b/Support/Comments.tmPreferences
index 72ab5c9..fd20fde 100644
--- a/Support/Comments.tmPreferences
+++ b/Support/Comments.tmPreferences
@@ -24,7 +24,7 @@
                        </dict>
                        <dict>
                                <key>name</key>
-                               <string>TM_COMMENT_BLOCK_START</string>
+                               <string>TM_COMMENT_START_2</string>
                                <key>value</key>
                                <string>/// </string>
                        </dict>

A quick grep through the project suggests that TM_COMMENT_BLOCK_START isn't referenced anywhere else, so it seems like it would be a safe change. Thoughts?

Thanks for reporting!

I think the problem is that Dart currently has multiple types of comments. In fact, /// signal doc comments, not comments, so I don't really think they belong with other comments.

For example, Visual Studio has a shortcut for // comments in C#, but not for /// (as far as I know).

In any case, if it's still named ..._BLOCK, that's an issue.

BTW, I wrote those ST docs. :)

It is a problem for packages that want to process comment text, such as @ehuss's Wrap Plus package. For example, see ehuss/Sublime-Wrap-Plus#22.

@guillermooo

In any case, if it's still named ..._BLOCK, that's an issue.

On master:

        <dict>
            <key>name</key>
            <string>TM_COMMENT_BLOCK_START</string>
            <key>value</key>
            <string>/// </string>
        </dict>

The ST3 docs say:

TM_COMMENT_START
Defines a default comment marker.

To define additional comment markers, name them TM_COMMENT_START_2, TM_COMMENT_START_3, etc.

The TM_COMMENT_BLOCK_START key doesn't appear anywhere in the Sublime Text documentation. I can't find anything on Google that indicates that TM_COMMENT_BLOCK_START was ever a valid configuration key for Sublime Text.

May I submit a PR to correct this?

@guillermooo Any update on this? I'm happy to submit a PR. Or discuss further if you're not yet convinced. Thanks!