Joshua Gruber
Joshua Gruber

Reputation: 139

How can I ignore specific TODOs in IntelliJ

IntelliJ is marking certain Spanish translation files and blocks of text as being TODOs (Not all of them, but definitely "all of them". heh.) How can I:

1) ignore specific incorrectly highlighted "todo" items

2) if that's not possible, exclude certain types of files (my translation files) from the TODO panel

Upvotes: 3

Views: 587

Answers (1)

glytching
glytching

Reputation: 47865

You can use the Scope Based feature of the TODO view to exclude classes or packages from the reported TODOs. To engage this feature click on the Scope Based tab in the TODO view and then click on the ... button next to the Scope dropdown. In the resulting dialog you can define inclusion and exclusion patterns to isolate the classes (though not code blocks within a class) which you wish to ignore.

Example

Given this class:

package org.glytching.sandbox.translation;

public class Foo {

    // TODO i would like to ignore this TODO
    private static String something;
}

And this class:

package org.glytching.sandbox;

public class Bar {

    // TODO i would not like to ignore this TODO
    private static String something;
}

Here's a screenshot showing the scope based definition required to ignore the package which contains the class: Foo:

enter image description here

And here's a screenshot showing the resulting TODO view:

enter image description here

Upvotes: 4

Related Questions