Skip to content

Conversation

@TIHan
Copy link
Contributor

@TIHan TIHan commented Jun 7, 2021

We have a few issues with F# scripts getting re-analyzed when their dependencies have been updated.

The idea here is to create a VS project that tracks the dependencies of the script so Roslyn can accurately re-analyze it.

lock gate (fun () ->
match files.TryRemove(document.FilePath) with
| true, (projectContext, _) ->
projectContext.Dispose()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not dispose of a projectContext if it's being used as a dependency for another project.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this TODO

@TIHan
Copy link
Contributor Author

TIHan commented Jun 9, 2021

It would be preferred we finish #11588 first as it will tie into how scripts will be updated.

@dsyme
Copy link
Contributor

dsyme commented Jun 18, 2021

So how do we get this under test? :)

@dsyme
Copy link
Contributor

dsyme commented Jun 24, 2021

@TIHan Can we get this in now the refactoring PR is done?

@TIHan
Copy link
Contributor Author

TIHan commented Jun 24, 2021

I'll see if we can now. I need to think about this as it might change because of the in-memory-documents PR.

@TIHan TIHan changed the title [VS][WIP] Scripting fixes [VS] Scripting fixes Jun 25, 2021

let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory)

let filePath1 =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be done later - but best to create an IDisposable thingy for these

@dsyme
Copy link
Contributor

dsyme commented Jun 25, 2021

It would be good to get further tests added where we check that re-analysis happens when

  1. a #r referenecd DLL is added and removed+added

  2. a #r "nuget: .." package is deleted and re-restored (do we expect to handle this?)

  3. a type provider invalidation occurs

I'm particularly concerned about the last one as I don't currently understand how Roslyn could know that it needs to do a re-analysis in this case.

@dsyme dsyme closed this Jun 25, 2021
@dsyme dsyme reopened this Jun 25, 2021
@dsyme
Copy link
Contributor

dsyme commented Jun 25, 2021

I will merge this, as the fixes are important and the core testing added, and start using it myself.

@TIHan Can you look at the above testing cases?

@dsyme dsyme merged commit a891d06 into dotnet:main Jun 25, 2021
@TIHan
Copy link
Contributor Author

TIHan commented Jun 25, 2021

Yes I will look at the test cases and get them in today.

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