Open sandboxFocus

Method TryFindProject

TryFindProject(Compilation, out Workspace?, out Project?, out bool)

Finds the Workspace and Project that defines a given Roslyn Compilation in the current WorkspaceCollection.

Declaration
public bool TryFindProject(Compilation compilation, out Workspace? workspace, out Project? project, out bool isMetalamaOutput)
Parameters
Type Name Description
Compilation compilation

The Roslyn compilation to search for.

Workspace workspace

When this method returns true, contains the workspace that contains the compilation.

Project project

When this method returns true, contains the project that contains the compilation.

bool isMetalamaOutput

When this method returns true, indicates whether the compilation is Metalama's transformed output.

Returns
Type Description
bool

true if a matching project was found; otherwise, false.