File tree 1 file changed +15
-4
lines changed 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
1
import * as vscode from 'vscode' ;
2
+ import { EFOutputParser } from '../cli/EFOutputParser' ;
2
3
import { CommandProvider } from '../commands/CommandProvider' ;
4
+ import { OpenMigrationFileCommand } from '../commands/OpenMigrationFileCommand' ;
3
5
import { RefreshTreeCommand } from '../commands/RefreshTreeCommand' ;
4
6
import { getCommandsConfig } from '../config/config' ;
5
7
import { TREE_VIEW_ID } from '../constants/constants' ;
@@ -52,10 +54,13 @@ export class AddMigrationAction extends TerminalAction {
52
54
this . cancel ( ) ;
53
55
} ) ;
54
56
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
+ ) ;
59
64
60
65
const output = await this . getOutput ( ) ;
61
66
const cacheId = DbContextTreeItem . getCacheId (
@@ -64,6 +69,12 @@ export class AddMigrationAction extends TerminalAction {
64
69
this . dbContext ,
65
70
) ;
66
71
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
+ ) ;
67
78
await vscode . commands . executeCommand (
68
79
CommandProvider . getCommandName ( RefreshTreeCommand . commandName ) ,
69
80
false ,
You can’t perform that action at this time.
0 commit comments