brackets-todo
brackets-todo copied to clipboard
Get comment syntax from LanguageManager by default
Currently the default comment syntax is defined by the .todo
file as C-style comments:
Todo will by default recognize C-style comments using the tags TODO, NOTE, FIXME, CHANGES or FUTURE as shown in examples below.
To solve issues like #110 , #111, we could use the LanguageManager
s .getLineCommentPrefixes()-method to determine which kind of comments to use per file type
var file = brackets.getModule("document/DocumentManager").getCurrentDocument(),
fileLanguage = file.getLanguage(),
lineCommentPrefixes = fileLanguage.getLineCommentPrefixes();
console.log(lineCommentPrefixes); //For JavaScript, for example, logs an Array of ["//"]
Also acts as an solution for #96
That sounds like a really interesting idea. The only drawback I can think of is that relying solely on LanguageManagers methods won't allow us to recognizing DocBlock comments so there will probably need to be some fallback to defining your own regular expressions.
That said it will solve a lot of the support request so I'm all for it! =)