1
1
namespace JetBrains.ReSharper.Plugins.FSharp.Psi.Features.ContextActions
2
2
3
3
open System.IO
4
+ open JetBrains.Application .UI .PopupLayout
5
+ open JetBrains.ReSharper .Feature .Services .Navigation
4
6
open JetBrains.ReSharper .Psi .Tree
5
7
open JetBrains.DocumentManagers .Transactions .ProjectHostActions .Ordering
6
8
open JetBrains.ProjectModel .ProjectsHost
@@ -13,6 +15,7 @@ open JetBrains.ReSharper.Plugins.FSharp.Psi.Impl.Tree
13
15
open JetBrains.ReSharper .Plugins .FSharp .Psi .Tree
14
16
open JetBrains.ReSharper .Psi
15
17
open JetBrains.ReSharper .Psi .ExtensionsAPI .Tree
18
+ open JetBrains.ReSharper .Resources .Shell
16
19
17
20
// extract value -> ctrl alt v
18
21
// undo that -> ctrl alt n
@@ -92,10 +95,19 @@ type GenerateSignatureFileAction(dataProvider: FSharpContextActionDataProvider)
92
95
solution.InvokeUnderTransaction( fun transactionCookie ->
93
96
let virtualPath = FileSystemPath.TryParse( fsiFile) .ToVirtualFileSystemPath()
94
97
let relativeTo = RelativeTo( projectFile, RelativeToType.Before)
95
- transactionCookie.AddFile( projectFile.ParentFolder, virtualPath, context = OrderingContext( relativeTo))
96
- |> ignore)
98
+ let projectFile = transactionCookie.AddFile( projectFile.ParentFolder, virtualPath, context = OrderingContext( relativeTo))
99
+
100
+ if ( not Shell.Instance.IsTestShell) then
101
+ let navigationOptions = NavigationOptions.FromWindowContext( Shell.Instance.GetComponent< IMainWindowPopupWindowContext>() .Source, " " )
102
+ NavigationManager
103
+ .GetInstance( solution)
104
+ .Navigate(
105
+ ProjectFileNavigationPoint( projectFile),
106
+ navigationOptions
107
+ )
108
+ |> ignore
109
+ )
97
110
98
- // TODO: it would be nice if we opened the signature file that was just created. Maybe split?
99
111
null
100
112
101
113
// First test name would be: ``ModuleStructure 01`` , ``NamespaceStructure 01``
0 commit comments