File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 112112 "type" : " boolean" ,
113113 "default" : true ,
114114 "description" : " Automatically shows Paket output panel"
115+ },
116+ "Paket.autoInstall" : {
117+ "type" : " boolean" ,
118+ "default" : false ,
119+ "description" : " Automatically runs Paket Install on paket.dependencies and paket.references save"
115120 }
116121 }
117122 }
Original file line number Diff line number Diff line change @@ -296,6 +296,13 @@ let private createReferencesProvider () =
296296 } |> Case2
297297 }
298298
299+ let private saveHandler ( doc : TextDocument ) =
300+ let config =
301+ let cfg = vscode.workspace.getConfiguration()
302+ cfg.get ( " Paket.autoInstall" , false )
303+ if ( doc.fileName.EndsWith " paket.references" || doc.fileName.EndsWith " paket.dependencies" ) && config then
304+ Install ()
305+
299306let activate ( context : vscode.ExtensionContext ) =
300307 let registerCommand com ( f : unit -> unit ) =
301308 vscode.commands.registerCommand( com, unbox< Func< obj, obj>> f)
@@ -317,6 +324,9 @@ let activate(context: vscode.ExtensionContext) =
317324 languages.registerCompletionItemProvider( referencesSelector, createReferencesProvider())
318325 |> ignore
319326
327+ workspace.onDidSaveTextDocument.Invoke( unbox saveHandler, null , unbox context.subscriptions)
328+ |> ignore
329+
320330
321331 registerCommand " paket.Init" Init
322332 registerCommand " paket.Install" Install
You can’t perform that action at this time.
0 commit comments