Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 11dcc20

Browse files
committed
Readded additional lookups for search term before searching for references in CSharpSymbolSearch.
1 parent 2d2362d commit 11dcc20

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ void FindReferencesInFile(SymbolSearchArgs args, IList<IFindReferenceSearchScope
133133
ITextSource textSource = args.ParseableFileContentFinder.Create(fileName);
134134
if (textSource == null)
135135
return;
136-
// TODO Reactivate somehow!
137-
// if (searchScope.SearchTerm != null) {
138-
// if (textSource.IndexOf(searchScope.SearchTerm, 0, textSource.TextLength, StringComparison.Ordinal) < 0)
139-
// return;
140-
// }
136+
if (searchScopeList != null) {
137+
if (!searchScopeList.Any(
138+
scope => (scope.SearchTerm == null) || (textSource.IndexOf(scope.SearchTerm, 0, textSource.TextLength, StringComparison.Ordinal) >= 0)))
139+
return;
140+
}
141141

142142
var parseInfo = SD.ParserService.Parse(fileName, textSource) as CSharpFullParseInformation;
143143
if (parseInfo == null)
@@ -218,11 +218,11 @@ void RenameReferencesInFile(SymbolRenameArgs args, IList<IFindReferenceSearchSco
218218
ITextSource textSource = args.ParseableFileContentFinder.Create(fileName);
219219
if (textSource == null)
220220
return;
221-
// TODO Reactivate somehow!
222-
// if (searchScope.SearchTerm != null) {
223-
// if (textSource.IndexOf(searchScope.SearchTerm, 0, textSource.TextLength, StringComparison.Ordinal) < 0)
224-
// return;
225-
// }
221+
if (searchScopeList != null) {
222+
if (!searchScopeList.Any(
223+
scope => (scope.SearchTerm == null) || (textSource.IndexOf(scope.SearchTerm, 0, textSource.TextLength, StringComparison.Ordinal) >= 0)))
224+
return;
225+
}
226226

227227
var parseInfo = SD.ParserService.Parse(fileName, textSource) as CSharpFullParseInformation;
228228
if (parseInfo == null)

0 commit comments

Comments
 (0)