Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

Project cache invalidating #72

Merged

Conversation

vasily-kirichenko
Copy link
Contributor

It does not work yet. The following exception is raised after renaming a file:

There are 1 error(s).
[Language Service] System.Exception: Could not find requested input '(startup (1,0--1,80) IsSynthetic=false, "L:\git\Library3\Library1.fs", false)' named 'FileNames' in set [(0, Available('(startup (1,0--1,80) IsSynthetic=false, L:\git\Library3\Library11.fs, False)' as of 26.02.2014 22:45:36)); (1, Available('(startup (1,0--1,80) IsSynthetic=false, L:\git\Library3\File51.fs, True)' as of 26.02.2014 22:45:36))]
   at Microsoft.FSharp.Compiler.IncrementalBuild.GetSlotByInput[T](String name, T input, PartialBuild build, FSharpFunc`2 equals)
   at Microsoft.FSharp.Compiler.IncrementalFSharpBuild.IncrementalBuilder.GetSlotOfFileName(String filename)
   at Microsoft.FSharp.Compiler.IncrementalFSharpBuild.IncrementalBuilder.GetParseResultsForFile(String filename)
   at <StartupCode$FSharp-Compiler-Service>.$Service.GetBackgroundCheckResultsForFileInProject@1943.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.SourceCodeServices.Reactor.RunAsyncOp@248.Invoke(Unit unitVar0) exception occurs while updating.

@ghost
Copy link

ghost commented Feb 26, 2014

This must be an FCS bug. Dave Tomas saw something similar in Xamarin Studio

@ghost
Copy link

ghost commented Feb 26, 2014

No, it's not an FCS bug (though it's a bad error message) - it's because somehow you're asking for information about a file L:\git\Library3\Library1.fs that isn't known to the project results being interrogated. Presumably that's the added or renamed file?

Do you call InteractiveChecker's InvalidateConfiguration for the project that has had the change? I believe you need to do that.

@vasily-kirichenko
Copy link
Contributor Author

@dsyme thanks! I'll try to add a InvalidateConfiguration call tomorrow.

@vasily-kirichenko
Copy link
Contributor Author

I call InvalidateAll instead and the exception has gone.

@@ -94,26 +95,30 @@ module ProjectProvider =
match msg with
| Get (doc, r) ->
let project =
try Option.ofNull (doc.ProjectItem.ContainingProject.Object :?> VSProject)
with _ -> None
doc.ProjectItem.VSProject
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure doc.ProjectItem could be null in some case.

| _ -> fail "[SolutionEvents] Cannot subscribe for ProjectItemsEvents"

static let instance = lazy (SolutionEvents())
static member Initialize() = () // instance.Force()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initialize is called from here https://github.com/vasily-kirichenko/FSharpVSPowerTools/blob/project-cache-invalidating/src/FSharpVSPowerTools/PowerToolsCommandsPackage.cs#L47

If I uncomment instance.Force() then we won't receive any events. So, it effectively works as before.

@vasily-kirichenko
Copy link
Contributor Author

@dungpa Fixed.

@dungpa
Copy link
Contributor

dungpa commented Feb 28, 2014

Nice updates.

dungpa added a commit that referenced this pull request Feb 28, 2014
@dungpa dungpa merged commit b9cc880 into fsprojects-archive:master Feb 28, 2014
@vasily-kirichenko vasily-kirichenko deleted the project-cache-invalidating branch February 28, 2014 10:45
@ghost
Copy link

ghost commented Feb 28, 2014

Using InvalidateAll is a bit brutal, can you invalidate the single project?

@vasily-kirichenko
Copy link
Contributor Author

@dsyme Fixed. #83

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants