mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-121609 Cannot find '+' + using Find in Path
This commit is contained in:
@@ -600,4 +600,19 @@ public class FindManagerTest extends DaemonAnalyzerTestCase {
|
||||
findModel.setInCommentsOnly(true);
|
||||
FindManagerTestUtils.runFindForwardAndBackward(myFindManager, findModel, text, "java");
|
||||
}
|
||||
|
||||
public void testPlusWholeWordsOnly() throws Exception {
|
||||
createFile(myModule, "A.java", "3 + '+' + 2");
|
||||
|
||||
FindModel findModel = FindManagerTestUtils.configureFindModel("'+' +");
|
||||
findModel.setMultipleFiles(true);
|
||||
|
||||
assertSize(1, findUsages(findModel));
|
||||
|
||||
findModel.setCaseSensitive(true);
|
||||
assertSize(1, findUsages(findModel));
|
||||
|
||||
findModel.setWholeWordsOnly(true);
|
||||
assertSize(1, findUsages(findModel));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ class FindInProjectTask {
|
||||
// $ is used to separate words when indexing plain-text files but not when indexing
|
||||
// Java identifiers, so we can't consistently break a string containing $ characters into words
|
||||
|
||||
return myFindModel.isWholeWordsOnly() && text.indexOf('$') < 0;
|
||||
return myFindModel.isWholeWordsOnly() && text.indexOf('$') < 0 && !StringUtil.getWordsInStringLongestFirst(text).isEmpty();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user