adds schema view and schema generating command
This commit is contained in:
@@ -93,6 +93,28 @@ extension WorkspaceModel {
|
||||
if panel == .editor { editor?.requestTextFocus() }
|
||||
}
|
||||
|
||||
// MARK: Schema view
|
||||
|
||||
/// Opens the Schema view in a Laravel app and reads the command and dump; anywhere else it does nothing.
|
||||
func openSchemaView() {
|
||||
guard let schema, schema.isLaravelApp, !layout.isSchemaViewOpen else { return }
|
||||
layout.openSchemaView()
|
||||
focusRequest = nil
|
||||
track { await schema.opened() }
|
||||
}
|
||||
|
||||
/// Hands the keyboard back to the column that had it before the view opened.
|
||||
func closeSchemaView() {
|
||||
guard layout.isSchemaViewOpen else { return }
|
||||
layout.closeSchemaView()
|
||||
guard let panel = layout.activePanel else {
|
||||
focusRequest = nil
|
||||
return
|
||||
}
|
||||
focusRequest = FocusRequest(.panel(panel))
|
||||
if panel == .editor { editor?.requestTextFocus() }
|
||||
}
|
||||
|
||||
// MARK: Focus and the row cursor
|
||||
|
||||
func focus(_ panel: Panel) {
|
||||
|
||||
Reference in New Issue
Block a user