@@ -265,12 +265,12 @@ object Interactive {
265265 namedTrees(trees, (include & Include .references) != 0 , matchSymbol(_, sym, include))
266266
267267 /** Find named trees with a non-empty position whose name contains `nameSubstring` in `trees`.
268- *
269- * @param includeReferences If true, include references and not just definitions
270268 */
271- def namedTrees (trees : List [SourceTree ], includeReferences : Boolean , nameSubstring : String )
272- (implicit ctx : Context ): List [SourceTree ] =
273- namedTrees(trees, includeReferences, _.show.toString.contains(nameSubstring))
269+ def namedTrees (trees : List [SourceTree ], nameSubstring : String )
270+ (implicit ctx : Context ): List [SourceTree ] = {
271+ val predicate : NameTree => Boolean = _.name.toString.contains(nameSubstring)
272+ namedTrees(trees, includeReferences = false , predicate)
273+ }
274274
275275 /** Find named trees with a non-empty position satisfying `treePredicate` in `trees`.
276276 *
@@ -322,7 +322,7 @@ object Interactive {
322322 val includeLinkedClass = (includes & Include .linkedClass) != 0
323323 val predicate : NameTree => Boolean = tree =>
324324 ( tree.pos.isSourceDerived
325- && ! tree.symbol.isConstructor
325+ && ! tree.symbol.isPrimaryConstructor
326326 && (includeDeclaration || ! Interactive .isDefinition(tree))
327327 && ( Interactive .matchSymbol(tree, symbol, includes)
328328 || ( includeDeclaration
0 commit comments