Search Everywhere for comments in PyCharm
Asked Answered
W

3

5

PyCharm's Search Everywhere functionality easily allows the user to search everywhere for source code in every file of the project. However it is not able to search for comments, is there a way around that problem?

animation of search everywhere in IDE

I usually leave important comments of lessons learned or links to Stack Overflow containing helpful code, and would love a way to easily search for these comments, when I forget where I wrote them.

Westering answered 16/3, 2016 at 13:7 Comment(0)
Y
11

Ctrl + Shift + F

Is a project wide text search. I think there's an option button to search comments.

Yanina answered 16/3, 2016 at 13:11 Comment(4)
Thanks, nice alternative, an addition of comments to "Search Everywhere" would be the ideal, but "Find in Path" has some useful settings as well.Westering
You can file a feature request to pycharm if you really want it, but source files are more useful to find in my opinionYanina
Indeed, the feature should be optionalWestering
Feature Requested: intellij-support.jetbrains.com/hc/en-us/requests/…Westering
F
5

After Ctrl + Shift + F you need this button:

screenshot of Find in Path dialogue

And select in comments.

Flatten answered 20/11, 2017 at 13:52 Comment(0)
T
3

I once had a problem with Search Everywhere or Find in Path(Ctrl + Shift + F for windows) i.e. project wide search for a django project in Pycharm Professional 2020.1.
Although filter was selected as Anywhere, still some were not being found in the project files which were actually there.

But after invalidating caches & restarting like the picture, everything was fine.

First select Invalidate Caches / Restart... in File menu.
enter image description here

Then click Invalidate and Restart in the Invalidate Caches popup window.
enter image description here

Trichloroethylene answered 31/5, 2020 at 8:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.