TODO not working in Python
已回答
My TODO pattern is: \btodo\b.*
But typing the following:
#TODO Visit JB Web resources:
does not show up in the TODO window:

I am using this version if someone can help:
PyCharm Community Edition 2017.2.4
Build #PC-172.4343.24, built on October 19, 2017
JRE: 1.8.0_152-release-915-b12 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1
请先登录再写评论。
Could you please attach a screenshot with Settings| Editor| TODO?
I'm having the same exact problem. Same patterns in the Settings/Editor/TODO (but in my case it's Preferences/Editor/TODO) and no matter what I put in a comment my TODO list always shows "Found 0 TODO items in 0 files". Did you ever figure this out?
Do you face this issue for new simple project with just one file? Also please share idea.log ("Help | Show Log in...") after restarting IDE.
I'm facing the same problem, but since no one has shared their log, here's mine:
EDIT
I deleted my log, because after playing around with it more I figured out the problem on my specific instance. The TODO was not functioning on documents in the Scratch and Consoles area. Once I moved them into the project folder itself, the TODO worked properly. Don't know if that's working as intended or not, but it did fix the problem for me.
Thanks Smobley, that was my resolution also.
Relace pattern with \b(?i)todo\b.*
It ignore case:
# todo or # TODO
I have this issue on PyCharm 2018.3.3 (Pro) - PyCharm is not picking up my # TODO: remarks. The strange thing is - everything works fine on my other projects which were made before the most recent update to PyCharm 2018.3.3. On my older projects, anything marked with any variation of TODO, e.g.:
shows up in the TODO: area instantly when the remarks are created.
@Yaroslav Bedrov - mine is a simple project with just one file so far. My idea.log file doesn't show anything particular when I search for "TODO", but I couldn't attach the log here - happy to send by email if you need it.
@Anna Morozova - Settings|Editor|TODO is:
@Smobley1919 - my file is in the project folder, but I have the TODO Scope option set to "All" so it should show anyway. Note that there is a setting specifically for items in the "Scratches and Consoles" that you could check yours with also.
@Ponamarev7 - I tried to ignore case, but it didn't make a difference.
I let it sit for a few hours (and added a few files to the project during that time) and magically it started working. Makes me think that Yaroslav Bedrov was going to say, "TODO doesn't work for simple projects - it only works if you have multiple files in your project..." or something like that.
Hi jrgarrigues,
No, it should work even with a new project with just one empty file. I am not sure where the root cause is, but please contact us via pycharm-support@jetbrains.com if problem reoccurs and attach your idea.log from Help | Show Log in...
I have the same issue. I have sent the information to pycharm-support@jetbrains.com
I'm having this issue as well with
PyCharm 2018.3.5 (Professional Edition)
Build #PY-183.5912.18, built on February 26, 2019
JRE: 1.8.0_152-release-1343-b28 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Thanks.
@Mikehagquist
Please verify in File | Settings | Editor | TODO that you have the default regex, which is "\btodo\b.*"
If that doesn't help, please submit a support request (you can do this in PyCharm from Help >> Contact support).
A similar problem occurred when I created a new project, but the first .py file mistakenly created through "File" - > "New Scratch file", and not in the project through the context menu. It hit the branch "scratches and consoles".
Moved the file to the my project and everything worked.
Hi, it's working for me in normal .py files but not in jupyter .ipynb files. Is it supposed to be also supported in jupyter notebooks or only in .py files?
Bastian
This is a known issue https://youtrack.jetbrains.com/issue/PY-35136
Sorry for the inconvenience.
Thank you, it fixed my problem too. @...
I just needed to restart my IDE. But my TODO tool window was COMPLETELY blank before. No buttons on the side, no tabs on the top. I don't think it even had the "TODO:" title. Just the gear and minimize icons.
2024
It was the case insensitivity for me. Ponamarev7's solution worked:
There is a secondary problem where it does not work on files that are outside of the project structure.
I have no solution for that.