From b74fa7337dfd4758e04278db45dde1b3fc3dc6d2 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 22 Apr 2019 19:37:17 +0200 Subject: [PATCH] Fix "find all references" when using the IDE in the Dotty build Running "find all references" in Dotty itself used to fail because constructing the map of project to their dependency failed, because this map is based on the `projectDependencies` key written in `.dotty-ide.json` which might contain projects which are not loaded in the IDE because they were excluded with `excludeFromIDE`. This commit fixes this by just ignoring dependencies which do not correspond to projects loaded in the IDE, this is the most resilient way to fix this. --- .../src/dotty/tools/languageserver/DottyLanguageServer.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/language-server/src/dotty/tools/languageserver/DottyLanguageServer.scala b/language-server/src/dotty/tools/languageserver/DottyLanguageServer.scala index de2bc83042d8..b801d3137313 100644 --- a/language-server/src/dotty/tools/languageserver/DottyLanguageServer.scala +++ b/language-server/src/dotty/tools/languageserver/DottyLanguageServer.scala @@ -156,7 +156,7 @@ class DottyLanguageServer extends LanguageServer val allProjects = drivers.keySet def transitiveDependencies(config: ProjectConfig): Set[ProjectConfig] = { - val dependencies = config.projectDependencies.map(idToConfig).toSet + val dependencies = config.projectDependencies.flatMap(idToConfig.get).toSet dependencies ++ dependencies.flatMap(transitiveDependencies) }