-
Notifications
You must be signed in to change notification settings - Fork 77
Project cache invalidating #72
Project cache invalidating #72
Conversation
This must be an FCS bug. Dave Tomas saw something similar in Xamarin Studio |
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. |
@dsyme thanks! I'll try to add a InvalidateConfiguration call tomorrow. |
I call |
@@ -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 |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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.
@dungpa Fixed. |
Nice updates. |
Using InvalidateAll is a bit brutal, can you invalidate the single project? |
It does not work yet. The following exception is raised after renaming a file: