File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 11import * as vscode from 'vscode' ;
2+ import { EFOutputParser } from '../cli/EFOutputParser' ;
23import { CommandProvider } from '../commands/CommandProvider' ;
4+ import { OpenMigrationFileCommand } from '../commands/OpenMigrationFileCommand' ;
35import { RefreshTreeCommand } from '../commands/RefreshTreeCommand' ;
46import { getCommandsConfig } from '../config/config' ;
57import { TREE_VIEW_ID } from '../constants/constants' ;
@@ -52,10 +54,13 @@ export class AddMigrationAction extends TerminalAction {
5254 this . cancel ( ) ;
5355 } ) ;
5456
55- await this . start ( {
56- ...this . params ,
57- migrationName,
58- } ) ;
57+ await this . start (
58+ {
59+ ...this . params ,
60+ migrationName,
61+ } ,
62+ { asJson : true , removeDataFromOutput : true } ,
63+ ) ;
5964
6065 const output = await this . getOutput ( ) ;
6166 const cacheId = DbContextTreeItem . getCacheId (
@@ -64,6 +69,12 @@ export class AddMigrationAction extends TerminalAction {
6469 this . dbContext ,
6570 ) ;
6671 dbContextsCache . clear ( cacheId ) ;
72+ const { data } = EFOutputParser . parse ( output ) ;
73+ const parsedData = JSON . parse ( data ) ;
74+ await vscode . commands . executeCommand (
75+ 'vscode.open' ,
76+ vscode . Uri . file ( parsedData . migrationFile ) ,
77+ ) ;
6778 await vscode . commands . executeCommand (
6879 CommandProvider . getCommandName ( RefreshTreeCommand . commandName ) ,
6980 false ,
You can’t perform that action at this time.
0 commit comments