File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 77
88import { Range , window } from 'vscode' ;
99import { constants , GCommands } from '../constants' ;
10+ import { Messages } from '../messages' ;
1011import { GCommand } from './base' ;
1112
1213export class AddComment extends GCommand {
1314 constructor ( ) {
1415 super ( GCommands . AddComment ) ;
1516 }
1617
17- execute ( ) {
18+ async execute ( ) {
1819 const editor = window . activeTextEditor ;
1920 let replace = '' ;
2021
@@ -34,9 +35,11 @@ export class AddComment extends GCommand {
3435 replace += `(${ lines [ i ] } )${ i + 1 === lines . length ? '' : '\n' } ` ;
3536 }
3637
37- void editor . edit ( editBuilder => {
38+ await editor . edit ( editBuilder => {
3839 editBuilder . replace ( select , replace ) ;
3940 } ) ;
41+ } else {
42+ await Messages . showErrorMessage ( 'Editor does not contain G-Code' ) ;
4043 }
4144 }
4245}
You can’t perform that action at this time.
0 commit comments