Todo highlighting not working [PyCharm 2018.3.4 (Pro) #PY-183.5429.31 January 29, 2019]

Answered

Hello,

I've seen several posts on this topic, but they are all about older Versions, so here's my problem:

I haven't used PyCharm in a while.
Now i came back, updated the IDE and the highlighting of todo-items does not work properly anymore(neither builtin nor custom ones).

The following screenshots and logs are made in a new created pure python project (with venv) and a single source code file:
(You can find the System configuration at the end)

These Settings did work when i set them up about a year ago using the then up-to-date version.
No changes have been made to the patterns and they do not work on neither the old code/projects nor newly created ones.

 

As you can see, the TODO window reports several todos in different files but does not display the individual items.
The displayed count is the correct count for the file. (in this file the three 3-lined Section comments and both todos with colons 3*3+2=11)
That means that the patterns are somewhat correct and it's only the displaying part that's having issues.
(To me it looks like the todo items are correctly identified and counted but not added to the display/highlight list :D )

Saving/Not saving the file or restarting the IDE did not change anything.

I hope that this is only a configuration issue and totally my fault, so i can get it working again soon, but i don't believe so.

I also posted my idea.log file to the Jetbrains upload Services ("Sorontik - idea.log")

 

Thanks for any replies and efforts anyway,

 

Soro

 

Setup/Configuration:

PyCharm 2018.3.4 (Professional Edition)
Build #PY-183.5429.31, built on January 29
For educational use only.
JRE: 1.8.0_152-release-1343-b26 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0
Python 3.7.2

0
7 comments

Hi Soro,

We did a little research and it seems like a bug with incorrectly used patterns. See https://youtrack.jetbrains.com/issue/IDEA-207939 for details.

To use your own todos, you should use correct pattern (e.g. like default ones). The main problem it seems it that they are started with #

0
Avatar
Permanently deleted user

Thanks for your effort :D

When i remove the # , it works, except that the # is no longer part of the match and thus is not highlighted.

But i don't understand why these are incorrect patterns?
As far as i know, # as well as / (and //) are normal literals in regular expressions, so why do they cause trouble here?

0

It seems that # is considered as a part of the todo, so if you use, for example, your # DGB todo as # # DGB in your code, it will work.

PyCharm in most of the cases is incorrectly finding todos in the code when # is in place, probably because it is used to write comments in Python.

0
Avatar
Permanently deleted user

but why do i need two # if there is only one in the pattern?

0

Because PyCharm already recognising matches with your todo pattern after the comment #.

So, if you want to use some test todo, you can just create it as follows:

If you use # test instead for a Pattern, then it is a part of your todo and PyCharm will look for # # test in the code.

0
Avatar
Permanently deleted user

And i just noticed that even though the todos are correctly recognised after removing the leading # in the pattern, they are still not working completely...

The background color is always changed to a greyish yellow, regardless of the color sheme default or the individual setting.
Same applies to the error stripe mark, which is always orange, no matter what color is chosen in the settings.
And while the italics-setting works, the bold-setting is ignored.

And the icons are not displayed.

0
Avatar
Permanently deleted user

Ah, I see...

so the pattern is only applied to comments - specifically the "content"-part of the comment, but not the comment-symbol

0

Please sign in to leave a comment.