File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
compiler/src/dotty/tools/dotc/interactive
language-server/src/dotty/tools/languageserver Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -338,6 +338,7 @@ object Interactive {
338338 val tree = utree.asInstanceOf [tpd.NameTree ]
339339 if (tree.symbol.exists
340340 && ! tree.symbol.is(Synthetic )
341+ && ! tree.symbol.isPrimaryConstructor
341342 && tree.pos.exists
342343 && ! tree.pos.isZeroExtent
343344 && (include.isReferences || isDefinition(tree))
@@ -373,8 +374,7 @@ object Interactive {
373374 )(implicit ctx : Context ): List [SourceTree ] = {
374375 val linkedSym = symbol.linkedClass
375376 val fullPredicate : NameTree => Boolean = tree =>
376- ( ! tree.symbol.isPrimaryConstructor
377- && (includes.isDefinitions || ! Interactive .isDefinition(tree))
377+ ( (includes.isDefinitions || ! Interactive .isDefinition(tree))
378378 && ( Interactive .matchSymbol(tree, symbol, includes)
379379 || ( includes.isLinkedClass
380380 && linkedSym.exists
Original file line number Diff line number Diff line change @@ -457,10 +457,7 @@ class DottyLanguageServer extends LanguageServer
457457 implicit val ctx = driver.currentCtx
458458
459459 val uriTrees = driver.openedTrees(uri)
460- val predicate = (tree : NameTree ) => {
461- val sym = tree.symbol
462- ! sym.isLocal && ! sym.isPrimaryConstructor
463- }
460+ val predicate = (tree : NameTree ) => ! tree.symbol.isLocal
464461
465462 val defs = Interactive .namedTrees(uriTrees, Include .empty, predicate)
466463 (for {
@@ -473,7 +470,7 @@ class DottyLanguageServer extends LanguageServer
473470 val query = params.getQuery
474471 def predicate (implicit ctx : Context ): NameTree => Boolean = { tree =>
475472 val sym = tree.symbol
476- ! sym.isLocal && ! sym.isPrimaryConstructor && tree.name.toString.contains(query)
473+ ! sym.isLocal && tree.name.toString.contains(query)
477474 }
478475
479476 drivers.values.toList.flatMap { driver =>
You can’t perform that action at this time.
0 commit comments