File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
workspaces/mi/mi-extension/src/rpc-managers/mi-data-mapper Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,13 @@ export class MiDataMapperRpcManager implements MIDataMapperAPI {
170170
171171 async formatDMC ( documentUri : string ) : Promise < void > {
172172 const uri = Uri . file ( documentUri ) ;
173- const edits : TextEdit [ ] = await commands . executeCommand ( "vscode.executeFormatDocumentProvider" , uri ) ;
173+ let edits : TextEdit [ ] ;
174+ try {
175+ edits = await commands . executeCommand ( "vscode.executeFormatDocumentProvider" , uri ) ;
176+ } catch ( error ) {
177+ console . error ( "Error occurred while formatting DMC file: " , error ) ;
178+ return ;
179+ }
174180 const workspaceEdit = new WorkspaceEdit ( ) ;
175181 workspaceEdit . set ( uri , edits ) ;
176182 await workspace . applyEdit ( workspaceEdit ) ;
You can’t perform that action at this time.
0 commit comments