Skip to content
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

mapWithAdditionalDependencies from FSAC. #109

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

TheAngryByrd
Copy link

@TheAngryByrd TheAngryByrd commented Mar 19, 2023

@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 an fsproj file. However there are additional files that may change during editing code that isn't immediately knowable until you've already executed msbuild (such as project.assets.json). When those dependent files change, (due to a something such as dotnet restore), we also need to re-execute getting information from msbuild for that project. @krauthaufen helped craft the AVal.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 a reader and any dirty ones InputChangedObject.

I do have a working implementation over in ionide/FsAutoComplete#1082.


@krauthaufen also mentioned creating implementations for ASet and AList, 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.

@krauthaufen
Copy link
Collaborator

krauthaufen commented Mar 19, 2023

Maybe just call it batchMap?

Great comtribution, btw.

@TheAngryByrd TheAngryByrd force-pushed the amap-deltaA branch 2 times, most recently from 2d50ac9 to 156e303 Compare March 19, 2023 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants