@@ -29,7 +29,7 @@ export default class GenerateXmlCatalogCommand extends Command {
2929 const catalogLocation = Uri . joinPath ( workspaceFolder . uri , '.vscode/magento-catalog.xml' ) ;
3030
3131 if ( ! ( await FileSystem . fileExists ( catalogLocation ) ) ) {
32- const success = await this . generateCatalog ( workspaceFolder ) ;
32+ const success = await this . generateCatalog ( ) ;
3333
3434 if ( ! success ) {
3535 return ;
@@ -39,7 +39,9 @@ export default class GenerateXmlCatalogCommand extends Command {
3939 await this . formatAndWriteCatalog ( catalogLocation , workspaceFolder . uri ) ;
4040 await this . updateXmlConfig ( workspaceFolder , catalogLocation ) ;
4141
42- window . showInformationMessage ( 'XML URN catalog generated and configured successfully' ) ;
42+ window . showInformationMessage (
43+ 'XML URN catalog generated and configured successfully. You might need to reload the editor for changes to take effect.'
44+ ) ;
4345 }
4446
4547 private async formatAndWriteCatalog ( catalogLocation : Uri , workspaceUri : Uri ) {
@@ -83,24 +85,24 @@ export default class GenerateXmlCatalogCommand extends Command {
8385 await FileSystem . writeFile ( catalogLocation , formattedCatalog ) ;
8486 }
8587
86- private async generateCatalog ( workspaceFolder : WorkspaceFolder ) : Promise < boolean > {
87- const catalogLocation = Uri . joinPath ( workspaceFolder . uri , '.vscode/magento-catalog.xml' ) ;
88-
88+ private async generateCatalog ( ) : Promise < boolean > {
8989 const magentoCli = new MagentoCli ( ) ;
9090
9191 try {
92- await magentoCli . run ( 'dev:urn-catalog:generate' , [ catalogLocation . fsPath ] ) ;
92+ await magentoCli . run ( 'dev:urn-catalog:generate' , [ '.vscode/magento-catalog.xml' ] ) ;
9393 } catch ( error ) {
9494 console . error ( error ) ;
9595
9696 window . showErrorMessage (
9797 'Failed to generate URN catalog. Try running this command manually: \n\n' +
98- `bin/magento dev:urn-catalog:generate ${ catalogLocation . fsPath } `
98+ `bin/magento dev:urn-catalog:generate .vscode/magento-catalog.xml `
9999 ) ;
100100
101101 return false ;
102102 }
103103
104+ magentoCli . dispose ( ) ;
105+
104106 return true ;
105107 }
106108
0 commit comments