ionide / ionide/FsAutoComplete
Make a more correct way to get key data points from ProjectRefrences of the current project
- Dominant language
- F#
- Stars
- 486
- Forks
- 169
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 5
Description
The below is specifically about the path to the xmldoc file for a ProjectReference, but it is structurally-similar for many kinds of data that can be 'queried' from a ProjectReference. We should have a mechanism to query for this data easily/correctly and plumb it through the relevant domains:
Ok, the 'maximally-correct' thing to do would be to call the `DocumentationProjectOutputGroup` Target for each ProjectReference in in this project. This would look something like:
* for our project that we care about
* call the `PrepareProjectReferences` Target and get the `ProjectReferenceWithConfiguration` Items after that Target executes. we need to do this so that the ProjectReference Items have all of the right property metadata on them
* then call the `DocumentationProjectOutputGroup` Target on each of `DocumentationProjectOutputGroupOutput` Items, and we would do `DocumentationProjectOutputGroupOutputItems |> Seq.first (fun i -> i.GetMetadataValue("IsKeyOutput") = "true") |> _.GetMetadataValue("FinalDocFile")` to get the _correct_ xmldoc location for this project for all time, regardless of any customizations that the user may have made to the project.
Sources:
* MSbuild doc file targets: https://github.com/dotnet/msbuild/blob/3af5ec0a967826337c4fb520109d99686fe04fb6/src/Tasks/Microsoft.Common.CurrentVersion.targets#L6532-L6556
* Prepareprojectreferences: https://github.com/dotnet/msbuild/blob/3af5ec0a967826337c4fb520109d99686fe04fb6/src/Tasks/Microsoft.Common.CurrentVersion.targets#L2066-L2091
The knowledge about PrepareProjectReferences is just dark magic that you have to know to make sure that the project references are set up right so that subsequent Target calls don't cause re-builds. Hooray.
_Originally posted by @baronfel in https://github.com/ionide/FsAutoComplete/pull/1468#discussion_r2850328968_
Contributor guide
Research direction
Start by reading the referenced PrepareProjectReferences and DocumentationProjectOutputGroup targets in Microsoft.Common.CurrentVersion.targets, then inspect the existing ProjectReference handling in the repository. Determine the relevant domains that need the queried data and define completion as a correct mechanism that obtains each referenced project's FinalDocFile without triggering unnecessary rebuilds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100