New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multi-project `find all references` #5209

Merged
merged 11 commits into from Nov 13, 2018

Conversation

Projects
None yet
2 participants
@Duhemm
Copy link
Contributor

Duhemm commented Oct 5, 2018

This commit adapts the find all references feature so that it is able
to find references to given symbols across projects. For symbols that
come from the classpath, all the projects in the build will be
inspected. If we're able to find a source for the symbol, only the
projects that depend on the projects where we found the definition need
to be inspected.

@Duhemm Duhemm added the stat:wip label Oct 5, 2018

@Duhemm Duhemm force-pushed the dotty-staging:topic/ide-multi-project-references branch 3 times, most recently from 73cf3e0 to d48548e Nov 1, 2018

@Duhemm Duhemm requested a review from smarter Nov 7, 2018

@Duhemm Duhemm assigned smarter and unassigned Duhemm Nov 7, 2018

@Duhemm Duhemm force-pushed the dotty-staging:topic/ide-multi-project-references branch from d48548e to 0f8853a Nov 8, 2018

Show resolved Hide resolved language-server/src/dotty/tools/languageserver/config/ProjectConfig.java Outdated
Show resolved Hide resolved sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala Outdated
Show resolved Hide resolved compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala Outdated
symbol.ownersIterator.toList.reverse.map(_.name)
}
in(targetDriver) { implicit ctx =>
val base: Symbol = ctx.definitions.RootClass

This comment has been minimized.

@smarter

smarter Nov 9, 2018

Member

Does this work for symbols in the empty package ? Definition#staticRef has a special case to handle that.

Show resolved Hide resolved compiler/src/dotty/tools/dotc/interactive/Interactive.scala Outdated
Show resolved Hide resolved compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala Outdated
Show resolved Hide resolved compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala Outdated
Show resolved Hide resolved language-server/src/dotty/tools/languageserver/DottyLanguageServer.scala Outdated

Duhemm added some commits Oct 3, 2018

Add `dependencies` field to `ProjectConfig`
This field will be used to restrict which projects to inspect when doing
workspace-wide rename or finding all references.

The code that extracts dependency information from sbt has been ported
from scalacenter/bloop:

https://github.com/scalacenter/bloop/blob/v1.0.0/integrations/sbt-bloop/src/main/scala/bloop/integrations/sbt/SbtBloop.scala
Support for multi-project `find all references`
This commit adapts the `find all references` feature so that it is able
to find references to given symbols across projects. For symbols that
come from the classpath, all the projects in the build will be
inspected. If we're able to find a source for the symbol, only the
projects that depend on the projects where we found the definition need
to be inspected.
Move code around in InteractiveDriver
(This commit contains no functional change)
Compile an empty source in InteractiveDriver ctor
This is necessary because we may be using this InteractiveDriver before
asking it to compile anything (which would have initialized it). This
happens, for instance, if we use this Driver to resolve a symbol coming
from a different Driver.

Drivers are not meant to be used before being initialized and can crash.
Don't find references in parallel
It appears that the `TreeUnpickler` is not able to be run in parallel.

@Duhemm Duhemm force-pushed the dotty-staging:topic/ide-multi-project-references branch from 0f8853a to d5280a6 Nov 12, 2018

@Duhemm

This comment has been minimized.

Copy link
Contributor

Duhemm commented Nov 12, 2018

@smarter I've addressed your comments

@Duhemm Duhemm merged commit 6a315ff into lampepfl:master Nov 13, 2018

2 checks passed

CLA User signed CLA
Details
continuous-integration/drone/pr the build was successful
Details

@Duhemm Duhemm deleted the dotty-staging:topic/ide-multi-project-references branch Nov 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment