mikaeljorhult / brackets-todo

Brackets/Edge Code extension that displays all TODO comments in current document or project.
144 stars 37 forks source link

Problem with // #139

Closed malesa closed 7 years ago

malesa commented 7 years ago

I don't know why comments // don't work. I have fresh plugin installation. Trying to put some todos in my JS file (.js extension) I've found that: / TODO: It works / // TODO: It doesn't work

danielscake commented 7 years ago

None of my TODO's work. I tried both versions above.

DavidCao22 commented 7 years ago

I updated to the v0.9.3 and also had TODO's break. I had to roll back to v0.8.2 to get //TODO to work.

malesa commented 7 years ago

I've figured out something - there is a problem with a closing expression. It works if you put any closing signs, eg: // TODO: It also works */ So I've added a dot sign to the closing regular expression in the configuration and... // TODO: Now it works too. It seems that closing comments with line endind doesn't work. Maybe only on Windows?

zishanj commented 7 years ago

with the latest version, it seems that the list does not refreshes well when switching between files. If add //TODO: and then save file, it will show in the list. If I move to another file and then goes back to older file with TODO then it shows blank list.

patorpey commented 7 years ago

I've experienced something along these lines as well at least since v0.9.2. In my projects, only about one or two files are actually displaying TODOs and occasionally editing a TODO comment in one of the working files produced the behaviour @zishanj described.

Based on @malesa and @zishanj comments, I've found that it does seem like it has to do with Windows line terminations on files. Changing the suffix RegExp to ):? *(.*?) ?(?=\*/|\r\n|\n|$) does seem to have helped.

malesa commented 7 years ago

Thanks. It works now.

mikaeljorhult commented 7 years ago

Great! Thank you for helping out @patorpey!

Would you mind submitting a pull request with the changes?

zishanj commented 7 years ago

That suggested regex may work for Windows users due to difference in LF characters. The \n linefeed character should work on Mac because I have decoded the text and it shows that its using LF ASCII 10 which is probably \n. Seems like the problem is somewhere else otherwise the default regex provided by Brackets would never work in first place, which I mentioned in previous comment.

zishanj commented 7 years ago

Just an update... I have checked the default regex provided by Brackets on http://www.regex101.com and its working fine there. Seems like there is some issue with refreshing the TODO list dialog.

mikaeljorhult commented 7 years ago

A fix for LF characters have been committed to master. This will hopefully solve the problems you guys are having. Could you test this on your setups?

zishanj commented 7 years ago

It does not work if I switch between files, otherwise it works well.

PS: I am using Mac.

alvint commented 7 years ago

The commit for this has caused issue #142. Please see there for details.

mikaeljorhult commented 7 years ago

A fix for this is in the just released version 0.9.5. Resetting the settings from the settings dialog uses the new defaults.