|
1 | | -под# Modernizing the F# Interactive Window: Plan |
| 1 | +# Modernizing the F# Interactive Window: Plan |
2 | 2 |
|
3 | 3 | Replace the legacy `FSharp.VS.FSI` tool window with the same REPL engine that powers **C# Interactive** and **Python Interactive** in Visual Studio: the `Microsoft.VisualStudio.InteractiveWindow` / `Microsoft.VisualStudio.VsInteractiveWindow` packages (source: [microsoft/vs-interactive-window](https://github.com/microsoft/vs-interactive-window)), with a structured JSON-RPC connection to the F# Interactive process instead of the current raw stdin/stdout text protocol. |
4 | 4 |
|
@@ -33,17 +33,23 @@ and contains: |
33 | 33 | needed. The session starts in the open solution's folder, so `dotnet fsi` runs the SDK that |
34 | 34 | folder's `global.json` resolves to. |
35 | 35 |
|
36 | | -Still to do before the window can be opened in Visual Studio: |
37 | | - |
38 | | -- registering the tool window with the shell. The existing F# Interactive window is registered by |
39 | | - `FSharpPackage` in `FSharp.Editor` rather than by a package of its own, and the same route is the |
40 | | - cheaper one here: a `ProvideInteractiveWindow` attribute and an `IVsToolWindowFactory` hook that |
41 | | - calls the provider, rather than a new package with its own GUID and pkgdef; |
42 | | -- the `Microsoft.VisualStudio.InteractiveWindow` prerequisite entry in the VSIX manifest, and the |
43 | | - project's place in the VSIX itself. It is already in `VisualFSharp.slnx`, so it builds; |
44 | | -- commands: open the window, and retargeting Alt+Enter at the new window; |
45 | | -- the debugger attach/detach commands ported from the existing window. The session reports its own |
46 | | - process id in the handshake, so the attach no longer has to guess which process to target. |
| 36 | +- `FSharpVsInteractiveWindowPackage.fs` — the package that registers the tool window with the shell |
| 37 | + (`ProvideInteractiveWindow`, docked with the Output window) and recreates it through |
| 38 | + `IVsToolWindowFactory` when Visual Studio restores a saved layout; |
| 39 | +- `FSharpInteractiveCommandFilter.fs` — "Send to Interactive" (Alt+Enter) and "Send line" from an |
| 40 | + F# editor, which submit to this window with the source file and line, so diagnostics land on the |
| 41 | + user's own file. The "F# Interactive" command in `FSharpPackage` opens this window too, and the |
| 42 | + legacy window is no longer reachable from any command. |
| 43 | + |
| 44 | +The project is in the VSIX, with the `Microsoft.VisualStudio.InteractiveWindow` prerequisite in its |
| 45 | +manifest, and the VSIX installs the .NET build of fsi, which the window falls back to when the SDK |
| 46 | +`global.json` selects predates the JSON-RPC server. |
| 47 | + |
| 48 | +Still to do: |
| 49 | + |
| 50 | +- the debugger attach/detach commands and "Debug in Interactive", ported from the existing window. |
| 51 | + The session reports its own process id in the handshake, so the attach no longer has to guess |
| 52 | + which process to target. Until then "Debug in Interactive" stays on the legacy command filter. |
47 | 53 |
|
48 | 54 | Everything from Phase 3 onwards (IntelliSense in the input buffer) is untouched, with one |
49 | 55 | exception: the input and output buffers have lexical colour from a tokenizer-based classifier |
|
0 commit comments