TODO comments not working

TODO patterns are already defined in Settings, but TODO comments doesn't work in editor.

4
Avatar
Permanently deleted user

TODO-Comments not working for me either. Has been a problem for several weeks. Restart doesn't help. I presume you'll want the logs? Here they are anyway https://drive.google.com/file/d/1gSP4Wibkh1jpn0Il5Q89wyJbBOfje6wa/view?usp=sharing 

1
Avatar
Permanently deleted user

Apologies for the delayed response.

TODO-comments don't work for small files (sub 30 lines of code) or other projects either. The patterns I have stored are all valid regex, I'm pretty sure. Here's a screenshot just in case: https://drive.google.com/file/d/1sp7uXTFo61soPyo9lgcAzZ9UOBKklTjf/view?usp=sharing 

1
Avatar
Permanently deleted user

Found the problem: the expressions listed above are all in lowercase. Though I thought it would ignore case-sensitivity, as it did before, it doesn't anymore. It does properly detect all lowercase-todo patterns. Is this intended behaviour?

1

It's in the slashes.

With the text

var maintenanceOriginId = "S3-XXX"; //abc MUDO add origin to prod

in a *.js file, the pattern 

abc\s+MUDO\b.*

works

and the pattern

//abc\s+MUDO\b.*

does not.

Patterns with slashes worked "before".

IntelliJ IDEA 2018.3.4 (Ultimate Edition)

Build #IU-183.5429.30, built on January 29, 2019

Treat indented text … selected (but it doesn't make a difference).

1
Avatar
Permanently deleted user

Thanks, it did turn out to be the case sensitivity check mark though. For whatever reason it reset to disable case insensitivity over an update (or maybe I changed it and forgot about it, I doubt it though) and enabling it fixed it

1

Hi Jan, Jan here :-) thx for the response.

Well, then there are multiple problems, because for me, it does not work when my pattern starts with a '/' (see above), whether or not case sensitivity is selected, and it does with the pattern without the slashes.

1

Hi Jan,

RegEx familiarity is up-to-speed, that is not the issue. Thank you for your concern.

No, RegEx does match patterns with slashes like that, in general (although one might need to escape the slashes, depending on the implementation). And these patterns did work "earlier" as TODO pattern. They do not work now.

But the issue probably is with an undocumented change you refer to: "that the todo search thing looks through comments".

The intention of having a pattern like

(//|/\*|#)\s+TODO\b.*

was

  1. to limit matches to TODO in comments, and not anywhere else
  2. to also select the opening comment symbols, when applying to color scheme's

The latter is just cosmetic. In the string

// TODO this is my todo

with the current implementation, background and foreground color is applied to " TODO this is my todo" with the pattern

\s+TODO\b.*

and not to the leading "//".

(1.) was necessary in earlier versions of IDEA. In the current version, it seems the TODO patterns only match in comments, regardless.

That is ok for me, but this change was not clear to me.

What I would like is for the color scheme to be applied to the whole comment block, not only to the text, purely for cosmetic reasons.

1

Cvaldez955 , please share a screenshot of your TODO settings in “Settings | Editor | TODO”

1

Did you try an IDE restart? Did you check it in other file extensions (.js,.html ...)?

0

You got it right, thanks for the log - they'll totally fine.

Seems like the problem is code-related. Please check if todo comments work in small files & in another project. Do you have the TODO patterns as pictured at the top at File | Settings | Editor | TODO?

0

What version are you on? Can't reproduce that in 2018.2.4.

There's basically a whole checkbox for case sensitivity, does it do anything at all? Also, please check if the issue persists after caches invalidation.

0
Avatar
Permanently deleted user

Hi Jan,

I can see why that would be a problem, as RegEx won’t match a pattern with slashes like that. Note that the todo search thing looks through comments already, so you don’t have to specify the slashes themselves.

If you’re unfamiliar with RegEx, there are excellent validators online.

Jan

0
Avatar
Permanently deleted user

just replace first \b in the patterns (for example, \btodo\b ) for (/|\*|\b) construction to support previous behavior.

0

Any idea why I'm getting nothing in the todo list, the editor seems to recognise the TODO with a different colour

0

What file is this in? 

0

it's a typescript file in my codebase.

0

Works here. Are you on PhpStorm 2020.2?

Would it work in another empty ts file? Would it work in another project?

0

Do you have a TODO filter applied by any chance? See:

0

Hi I'm on ...

 

PhpStorm 2020.2.3
Build #PS-202.7660.42, built on October 16, 2020
Runtime version: 11.0.8+10-b944.34 x86_64

I have no filters setup.

 

It does work on another project and if I create a brand new ts file it works!  It's just existing files for some reason.

0

Try to backup & remove the .idea folder in this project - check if that helps. 

 

0

Hi Dmitry

 

I have just realised what is going on.  I am using emotion's 'css' tagged string template function ie 

import { css } from '@emotion/core';

Although the IDE is able to detect the string as CSS and colour code it correctly, including TODO comments, the TODO tool bar doesn't parse them.

0

Thanks for sharing this! That's most likely caused by JS parser: it would be great if you could report this to WebStorm team. I can see a similar issue on their tracker: https://youtrack.jetbrains.com/issue/WEB-47861. You can comment there describing the problem & ideally attaching the project/files/steps to reproduce it.

0

thanks have added.  The problem there looks like it's a vanilla ts file not an emotion css string.

0

arrived here because my TODO comments weren't being highlighted but it was because I had enabled Power Save Mode, problem solved after I disabled it

this is how it should NOT be, if you want to highlight your TODO comments

 

0

Hello,

I am also having issues with my TODO comments I am using Python 3.12 
 

0

@Cvaldez955 Please go to your IDE "About" screen, click the "Copy & close" button, and send the result to me. 

0

请先登录再写评论。