-
Notifications
You must be signed in to change notification settings - Fork 844
Add Dump command to VS #4580
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
Add Dump command to VS #4580
Conversation
cartermp
left a comment
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.
Giving this "experience approval", in that I think this is a valuable tool and that it's worth having.
@Pilchie any thoughts on introducing another menu item here?
|
@AviAvni adding to VisualFSharpFull.csproj should probably work, but I have no idea if this is the recommended way to do it. |
| </Strings> | ||
| </Button> | ||
|
|
||
| <Button guid="FSharpProjectCmdSet" id="cmdidFsDump" priority="0x8000" type="Button"> |
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.
This addition should have (but obviously didn't) update all of the MenusAndCommands.vsct.*.xlf files. Can you try running this to force regeneration?
msbuild vsintegration\src\FSharp.ProjectSystem.FSharp\ProjectSystem.fsproj /t:UpxateXlf|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" /> | ||
| <PackageReference Include="Microsoft.Diagnostics.Runtime" Version="0.9.180305.1" /> |
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.
This version number should be added to build\targets\PackageVersions.props under the other packages heading and placed in alphabetical order:
<MicrosoftDiagnosticsRuntimePackageVersion>0.9.180305.1</MicrosoftDiagnosticsRuntimePackageVersion>And replaced in this file with $(MicrosoftDiagnosticsRuntimePackageVersion).
| let projectSystemPackage = | ||
| lazy( | ||
| let shell = serviceProvider.GetService(typeof<SVsShell>) :?> IVsShell | ||
| let packageToBeLoadedGuid = ref (Guid "{91a04a73-4f2c-4e7c-ad38-c1a68e7da05c}") // FSharp ProjectSystem guid |
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.
Use the constant defined ProjectPrelude.fs as GuidList.guidFSharpProjectPkgString.
| checkerProvider.Checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() | ||
| use target = DataTarget.CreateSnapshotAndAttach(Process.GetCurrentProcess().Id) | ||
| let runtime = target.ClrVersions.[0].CreateRuntime(); | ||
| let outputPane = projectSystemPackage.Value.GetOutputPane(VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid, "FSharp Dump") |
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 familiar with this API. Does "FSharp Dump" need to be localized/translated? If so it'll have to be added to a .resx file and consumed that way.
| <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" /> | ||
| <PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutablePackageVersion)" /> | ||
| <PackageReference Include="VSSDK.VSLangProj" Version="$(VSSDKVSLangProjPackageVersion)" /> | ||
| <PackageReference Include="Microsoft.Diagnostics.Runtime" Version="0.9.180305.1" /> |
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.
Same build\targets\PackageVersions.props comment as above.
|
Sorry for the late reply - was on vacation. I would tend to prefer that this be added as an extension, perhaps into the "Project System Tools" extension? Tagging @panopticoncentral |
|
This seems like it could be a good addition to the project system tools (https://github.com/dotnet/project-system-tools) and it fits with the general mission there. We've already added logging for the Roslyn language service. Take a look and let me know what you think, @AviAvni. |
|
@panopticoncentral ok so how this is going to work? |
|
Is the API to know when the lang service is done available publicly? If so, I'd just call it from the extension and then do the dump. |
|
Hello my friend, is this still an active work item for you? Thanks |
|
I can work on it if you want but as said in comments it belong to other project that I don't know how to implement it there |
|
Since @panopticoncentral is/will be on leave (I've been out myself and forgot the status!), @jmarolf would you be able to help @AviAvni with adding a Dump command to https://github.com/dotnet/project-system-tools ? |
|
Thanks for this PR, however it looks to be quite out of date, please reopen, if you want to continue with it. Kevin |
Talking with @dsyme I implemented Dump command to vs to help anlyze memory issues of F# language service in VS
The dump taken after all operations in Reactor finished
And I used ClrMD microsoft/clrmd#91 to take the dump so it not waste disk or ram
The dump written to the output window
@cartermp what do you think?
I'm also want to implement this on tests so we can compare memory after every build
One thing missing is thaat even that I added the Microsoft.Diagnostics.Runtime package to FSharp.Editor
and VisualFSharpFull projects the dll is not included in the vsix how I can fix this?