"Find in Path" not showing results in some files

已回答

I've run into a problem where "Find in Path" is not showing results in a particular set of files. I can't figure out why. 

The files are .js files. They are named like "foo.steps.js", but if I rename to simply "foo.js" the same problem happens. 

The files show up in the Projects view. They are in a sub-directory of a module source root. There are sibling sub-directories whose files do show up in "Find in Path" (mostly *.feature files). I can't see any reason why these files don't show up.

The directory and files are not part of .gitignore. They have have not been marked as Excluded. The "Find in Files" dialog has no file mask, is set to find "anywhere" in "Project". Yet a search for some text that appears in these files simply doesn't show up!

For example, highlighted is one of the files:

And this "Find in Files" for "verifyNumberOfCards" should show several results in the file, but it doesn't:

I should see this result from "portfolioPlans.steps.js":

I'm at a loss. What other reason might these files not show up in Find in Files??

7

Please try File | Invalidate Caches | Invalidate and Restart.

13

That did it, thanks!

I have to admit that's pretty alarming, though. In JS context I rely on Find in Files a lot to "safely" refactor things, which is how I ran into this...

2

Caches can be corrupted on unexpected IDE shutdown or system crash.

0

same here. Invalidate caches & restart does not help.

 

Easy steps to reproduce:

1) rename existing .js file to .ts

2) revert or shelve the change

File will not be listed in Project search and in Ctrl-Shift-N search. In Tree view the file icon will have a cross at top left:

 

0

Looks like the revert action of the renamed file leads to exclusion of this file in project. What Version Control system do you use? Please follow the https://youtrack.jetbrains.com/issue/IDEA-192815 for updates.

0

Issue still presents (IDEA 2018.2.5 CE)

Invalidating cache doesn't help.

 

0

@Cheer4engineer please share a sample project and the exact steps to reproduce.

-1

Ok. I'll try to do it later.

 

 

 

0

In my case I found an entry for the unindexed file in .idea/workspace.xml:

<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
<option name="exactExcludedFiles">
<list>
<option value="$PROJECT_DIR$/../graphql/esConnector.js" />
</list>
</option>
</component>

It's very likely that I tried converting that file to TypeScript in the past, but IDK why only that file has survived in the exclusion list - I've converted several other files as well. Removing the <option> element and restarting WebStorm made the file visible in Find in Files again.

3
Avatar
Permanently deleted user

Yea, this ish is broken.

I did the cache rebuild and I still get only a subset of the actual matches when I search on my root project directory. It misses matches which I can find if I instead search on subdirectories further down in the project.

In other words:

my_project (search here for "food" and find some stuff)

 - source

   --- js (search here for "food" and get matches the other search missed)

1

It would help a lot if you report it at https://youtrack.jetbrains.com/issues/IDEA with the reproducible test case, thank you.

0
Avatar
Permanently deleted user

This is an awful bug - I am relying on this search to make sure that I'v made changes to all the required places and now I cannot be sure about it anymore... Invalidate cache / Restart did not solved the issue on my side. Serge Baranov I would send a report with a reproducible test case but I don't know how and when it happened. In my case it is not finding properly occurrences in .java files that I pulled from Git repository - I did not make any changes on the files and did not renamed them. In some of the files it is finding the searched word and in some not without any special "rule". These are the version details:

2

Is it always reproducible?

>In some of the files it is finding the searched word and in some not without any special "rule". 

Please specify the location of such files in the project - are they located under the source roots? And what exact text is not found (a screenshot of the fin window with the results). Also provide logs zipped: Help | Compress Logs and Show in ... action.

If you use 3rd plugins, disabling them may help.

0
Avatar
Permanently deleted user

It is always reproducible yes - the .java class that is not shown in the results is in the src root structure. The phrase that I am searching for represents a DB table name and is of format {aaa}_{bbb}. The table name is placed in an @SqlUpdate annotation (JDBI) that is placed above a method. I am sorry but I cannot send screen shots or logs because of an NDA agreement. I have only one plugin installed - Bitbucket but imho it should not cause any issues.

0

Double check the search pattern is correct and there is indeed text that matches it. Check also other search cafeterias (like file types, directory etc).

In case it is not a search issue but issue with an index of project files more details would be needed to investigate further.

0

I had the issue. I could see cross icon appear those js files.

Lachlan Stuart's solution works for me !!

0
Avatar
Permanently deleted user

I have this severe problem as well (maybe the root cause is different), and invalidating caches or editing the `.idea` folder don't work.

So I created an issue on the bug tracker, with a reproducible case - https://youtrack.jetbrains.com/issue/WEB-42580.

0

I have the same problem with Find using ctrl-shif-f, but found a workaround.

At the bottom of the Find pane, if I click "Open in Find Window", it goes to the Find box in the same window as the editor, and finds all the occurences.

0

Same problem in PyCharm. I try to search for a file called Jenkinsfile.HCI_RTFI_Only, which is a Groovy script for Jenkins pipelines.

It's open in my PyCharm code window and it's listed in the Project view but PyCharm can't find it! This is horrible. I have invalidated cache and restarted too.

I'm using PyCharm 2019.3 on Mac OS X Mojave. I can find the file in terminal too.

If Intellij doesn't fix this I will go to another IDE and not pay them money for this not being fixed.

I can happily add further details. 

0

Are there any exceptions in the logs when this issue occurs? Help | Compress Logs and Show in ...

0

Yes,

Here is the top of the java_errot_in_pycharm:

 

#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000011178a50f, pid=41786, tid=16387
#
# JRE version: OpenJDK Runtime Environment (11.0.4+10) (build 11.0.4+10-b304.77)
# Java VM: OpenJDK 64-Bit Server VM (11.0.4+10-b304.77, mixed mode, tiered, compressed oops, concurrent mark sweep gc, bsd-amd64)
# Problematic frame:
# V [libjvm.dylib+0x50250f] _ZNK4Node2inEj+0xf
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#

--------------- S U M M A R Y ------------

Command Line: -Xms128m -Xmx2048m -XX:ReservedCodeCacheSize=240m -XX:+UseCompressedOops -Dfile.encoding=UTF-8 -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -XX:CICompilerCount=2 -Dsun.io.useCanonPrefixCache=false -Djava.net.preferIPv4Stack=true -Djdk.http.auth.tunneling.disabledSchemes="" -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Djdk.attach.allowAttachSelf -Dkotlinx.coroutines.debug=off -Xverify:none -XX:ErrorFile=/Users/andresmfernandez/java_error_in_pycharm_%p.log -XX:HeapDumpPath=/Users/andresmfernandez/java_error_in_pycharm.hprof -Djb.vmOptionsFile=/Users/andresmfernandez/Library/Preferences/PyCharm2019.2/pycharm.vmoptions -Didea.home.path=/Applications/PyCharm.app/Contents -Didea.executable=pycharm -Didea.platform.prefix=Python -Didea.paths.selector=PyCharm2019.2

Host: MacBookPro15,1 x86_64 2600 MHz, 12 cores, 32G, Darwin 18.7.0
Time: Wed Nov 13 15:10:35 2019 MST elapsed time: 1288 seconds (0d 0h 21m 28s)

Also... Troubleshootig.txt

 

=== About ===
Build version: PyCharm 2019.3 Build #PY-193.5233.109 November 28, 2019
Java version: 11.0.4+10-b520.11x86_64
Operating System: Mac OS X (10.14.6, x86_64)
JVM version: OpenJDK 64-Bit Server VM JetBrains s.r.o

=== System ===
Number of CPU: 12
Used memory: 244Mb
Free memory: 535Mb
Total memory: 779Mb
Maximum available memory: 1979Mb

=== Displays ===
Displays:
Display 0: 1920x1080; scale: 1.00
Display 1: 3360x2100; scale: 2.00

=== Plugins ===
Custom plugins: []
Disabled plugins:[]

=====DEPLOYMENT SETTINGS=====
Default Server : null
=====ADDITIONAL SETTINGS=====
Exclude items by name : .svn;.cvs;.idea;.DS_Store;.git;.hg;*.hprof;*.pyc
Operations logging : DETAILS
Stop operation on the first error : false
Overwrite up-to-date files : true
Preserve file timestamps : true
Delete target items when source do not exist : false
Create empty directories : false
Prompt when overwriting or deleting local items : true
Upload changed files automatically : Never
Upload external changes : false
Override default permissions on files : -1
Override default permissions on folders : -1
Warn when uploading over newer file : NONE
Notify of remote changes : false

=====PERFORMANCE SUMMARY=====
Filesystem Info:
File system is case sensitive: false
Are there symlinks: true
Number of files: 4331

Project Info:
Number of opened files: 10
File size (in lines): 173
File size in characters: 6269
Number of injections: 0

=== About ===
Build version: PyCharm 2019.3 Build #PY-193.5233.109 November 28, 2019
Java version: 11.0.4+10-b520.11x86_64
Operating System: Mac OS X (10.14.6, x86_64)
JVM version: OpenJDK 64-Bit Server VM JetBrains s.r.o

=== System ===
Number of CPU: 12
Used memory: 249Mb
Free memory: 530Mb
Total memory: 779Mb
Maximum available memory: 1979Mb

=== Displays ===
Displays:
Display 0: 1920x1080; scale: 1.00
Display 1: 3360x2100; scale: 2.00

=== Plugins ===
Custom plugins: []
Disabled plugins:[]

Quite a few threaddumps in PyCharm:

 

 

let me know if I should create a separate bug report

0

This file is not relevant to the problem, you should check idea.log instead. Please upload at https://uploads.services.jetbrains.com/ and specify the archive name.

0

What is the uploaded file name?

0

pycharm-logs-20200103-103219.zip

0

What file type is Jenkinsfile.HCI_RTFI_Only file associated with? See https://www.jetbrains.com/help/pycharm/creating-and-registering-file-types.html .

Since PyCharm has no Groovy support and this extension is not mapped to any file type by default, IDE will consider this file as a binary and will not perform text search inside it.

Does it help if you map this file/extension file type to Text?

0

This is a text file that uses Groovy inside of it for Jenkins CI/CD pipeline.

// Create variable to build my complex docker commands in
def docker_cmds;
def docker_cmdc;
def docker_host = 'sf-artifactory.solidfire.net:9000';

pipeline {
agent {
node {
label "master_slave"
}
}

....

The point here is there are other files it doesn't find, not just this file.

I will use another file example then since this one isn't automatically mapped.

I did add this file type to Text and still it couldn't find it.
0

If you have a reproducible test case for this issue, please zip and upload the sample project with the exact steps to trigger the bug.

0
Avatar
Permanently deleted user

I just (re)purchased pycharm and updated to 2019.3.1 from 2018.2.3. The Navigate > File menu is not working as expected. It is not matching any of my files. It's almost like it's searching _inside_ the files for the filename I'm typing. Any suggestions?

0

Please contact support with the logs attached (Help | Compress Logs and Show in ...) and the short video of the issue: https://intellij-support.jetbrains.com/hc/requests/new .

0

请先登录再写评论。