Skip to content

Feature request: Allow other .NET languages to participate in Edit and Continue/Hot Reload #99

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

Closed
RobertvanderHulst opened this issue Aug 3, 2023 · 4 comments

Comments

@RobertvanderHulst
Copy link

We have created our .Net language compiler (X#) which is based on the Roslyn code (https://github.com/X-Sharp/XSharpDev)
We want to implement "Edit and Continue" for the debugger, but we cannot find how the Debugger notifies / calls the Roslyn to trigger recompile the code.
Does anybody know how this works?

@gregg-miskelly gregg-miskelly changed the title Edit and Continie Feature request: Allow other .NET languages to participate in Edit and Continue/Hot Reload Aug 4, 2023
@gregg-miskelly
Copy link
Member

Presently Visual Studio doesn't have a stable interface between the language service/compiler and the debugger for edit-and-continue / Hot Reload. So, we don't have a way for any language besides C#/VB and participate. Once we have cleared our backlog of breaking changes, we would like to open it up for extenders to also participate.

I will leave this issue open to track this.

@NatElkins
Copy link

@gregg-miskelly Is there any update on this? I'm trying to figure out if it's even possible to do this with F#, or what would be required to make that work.

@NatElkins
Copy link

Some additional context/discussion: dotnet/fsharp#11636

@gregg-miskelly
Copy link
Member

Hi @NatElkins, we believe all of the interfaces to implement this are now public for full Visual Studio. So, sounds like we should be able to resolve this issue. The interface that F# would need to implement is Microsoft.VisualStudio.Debugger.Contracts.HotReload.IManagedHotReloadLanguageService. We don't have a sample, so Rosyln would be the best example of how to do this. See this comment for some advice on this.

Two caveats:

  • The Hot Reload interfaces are in Microsoft.VisualStudio.Debugger.Contracts, which hasn't been pushed to nuget.org in a while. So you would need to use the vs-impl feed. See here to browse available versions. See below for instructions on this.
  • Visual Studio Code + C# Dev Kit hard codes the creation of the C# language service, and unlike full Visual Studio, there is no way to add extra language services. So, if you are more interested in that scenario, please open another issue.

Instructions for referencing Microsoft.VisualStudio.Debugger.Contracts

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="vs-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json" />
  </packageSources>
</configuration>

.csproj file:

  <ItemGroup>
    <PackageReference Include="Microsoft.VisualStudio.Debugger.Contracts" Version="17.13.0-beta.25105.1" />
  </ItemGroup>

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

No branches or pull requests

3 participants