Skip to content

Commit

Permalink
Fix "find all references" when using the IDE in the Dotty build
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
smarter committed Apr 22, 2019
1 parent 1c3ba7b commit b74fa73
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit b74fa73

Please sign in to comment.