Skip to content

Commit b74fa73

Browse files
committed
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.
1 parent 1c3ba7b commit b74fa73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

language-server/src/dotty/tools/languageserver/DottyLanguageServer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class DottyLanguageServer extends LanguageServer
156156
val allProjects = drivers.keySet
157157

158158
def transitiveDependencies(config: ProjectConfig): Set[ProjectConfig] = {
159-
val dependencies = config.projectDependencies.map(idToConfig).toSet
159+
val dependencies = config.projectDependencies.flatMap(idToConfig.get).toSet
160160
dependencies ++ dependencies.flatMap(transitiveDependencies)
161161
}
162162

0 commit comments

Comments
 (0)