Todo-tree: Offer lua support by default

Created on 9 Dec 2018  路  5Comments  路  Source: Gruntfuggly/todo-tree

Lua has two kinds of comments:

-- Single line comment
--[[
multiline
comment
]]--

It is possibly easy to add support for it, but I didn't go first and open a PR for one reason, and that is the -- operator exists in some languages, thus in a scenario like below. we have a false positive:

int x = i-- TODOList.Count;

Not a blocker, as it is possible to add workspace regex, just a mention. Maybe an extension <-> regex mapping for languages with uncommon syntax?

add to documentation more information required

Most helpful comment

You could change the default regex to something like $\s*--($TAGS) to match "--" at the start of a line.

Multiline matches are not currently properly supported though...

All 5 comments

You could change the default regex to something like $\s*--($TAGS) to match "--" at the start of a line.

Multiline matches are not currently properly supported though...

okay same issue for elm files. Changed regex to ((--|//|#|<!--|;|/\*|^)\s*($TAGS)|^\s*- \[ \]) but it needs the TODO to be next to the comment characaters without whitespace.

Which is strange since the regex accounts for whitespace according regulex

\s* should match any or no whitespace? Can you add an example of what you would expect to match so I can try it out?

Hi - is this still an issue for you?

In case anyone else comes across this and has a similar use case to mine... I have a mixed codebase of lua and supercollider (which uses //) and I just write my lua todos like -- # TODO: - ugly, but it works and i don't have to write a regex that matches lua and SC at the same time :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

josbalcaen picture josbalcaen  路  5Comments

WORMSS picture WORMSS  路  6Comments

joserubicon picture joserubicon  路  9Comments

beebase picture beebase  路  6Comments

luqiudi picture luqiudi  路  9Comments