Commit ecfbbf8
[Repo Assist] fix: handle None workspace.rootPath in FSI and Diagnostics commands (#2162)
* fix: handle None workspace.rootPath in FSI and Diagnostics commands
In multi-root workspaces, workspace.rootPath is None (undefined in
JavaScript), so using workspace.rootPath.Value throws at runtime.
This affects two code paths:
1. Fsi.fs sendCd fallback: when there is no active text editor and FSI
needs a working directory, it would crash instead of falling back to
a sensible directory.
2. Fsi.fs generateProjectReferencesForProject: calling
'FSI: Generate project references' in a multi-root workspace would
crash instead of creating the references.fsx document.
3. Diagnostics.fs writeToFile: running 'F#: Get diagnostic info' in a
multi-root workspace would crash instead of opening the info file.
Fix: use workspace.rootPath first; fall back to the first workspace
folder if available; fall back to the OS temp directory as a last resort.
Co-authored-by: Copilot <[email protected]>
* ci: trigger checks
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>1 parent 40683b2 commit ecfbbf8
2 files changed
Lines changed: 26 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
114 | 122 | | |
115 | 123 | | |
116 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
335 | 342 | | |
336 | 343 | | |
337 | 344 | | |
| |||
666 | 673 | | |
667 | 674 | | |
668 | 675 | | |
669 | | - | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
670 | 685 | | |
671 | 686 | | |
672 | 687 | | |
| |||
0 commit comments