mapWithAdditionalDependencies
from FSAC.
#109
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@krauthaufen and I have been going back and forth on things that have helped the implementation of using FSharp.Data.Adaptive in FsAutocomplete.
One of the weird use cases is loading and noticing changes to
fsproj
files with msbuild. We need to re-execute retrieving msbuild project data on every change to anfsproj
file. However there are additional files that may change during editing code that isn't immediately knowable until you've already executed msbuild (such asproject.assets.json
). When those dependent files change, (due to a something such asdotnet restore
), we also need to re-execute getting information from msbuild for that project. @krauthaufen helped craft theAVal.mapWithAdditionalDependencies
.The only problem with the implementation was on any change we would want to reload the whole solution which can take longer the more projects that are involved. We can be a bit smarter and reload only the projects that need it. We could do this one at a time with the current offering in
AMap
but this would also be extra overhead. It would be nicer to operate in batches, so if multiple projects need reloaded, we only call out to msbuild once.BatchRecalculateDirty
will rerun the mapping function for any new inputs from areader
and any dirty onesInputChangedObject
.I do have a working implementation over in ionide/FsAutoComplete#1082.
@krauthaufen also mentioned creating implementations for
ASet
andAList
, but I wanted to get the ball rolling on some feedback. I'm not tied to these names, if there's better ways to convey the semantics on this or better implementations of what I'm doing, I'm all ears.