dotnet / dotnet/roslyn

Evaluate `#:project` directives in the editor

Open
#81,533 3 comments 0 reactions 1 assignee Claimed by @RikkiGibson View on GitHub
Feature - Run File
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

In https://github.com/dotnet/sdk/pull/51108/files#r2519926453 I had an assumption that the EvaluateDirectives helper would be callable from the editor to allow us to keep reporting errors on bad project directives.

However, we believe that editor is unable to directly create a ProjectInstance. We also don't want the source package to have a dependency on msbuild. (IIRC, this is part of how the MSBuildHost architecture works, we use a RemoteProjectFile or some such, which makes an RPC call that actually interacts with a ProjectInstance out of proc.)

So, dotnet/sdk#51995 is removing EvaluateDirectives from the source package for the time being.

In order to report errors on `#:project` directives with bad paths, we will need to revisit here and figure out whether/how to perform the evaluation step.

Frankly I think that variables in project directives is likely to be a rare case so the editor could consider doing a simple path resolution and Exists check in the case there are no variables, and essentially do nothing to help in the case there are variables. This could also be confusing though, and is a compromise over the experience we really want, so we should think through how we would want to properly do this in the editor first.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.