This repository was archived by the owner on Oct 1, 2024. It is now read-only.
File tree 1 file changed +8
-15
lines changed 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -180,23 +180,16 @@ export async function activate(context: vscode.ExtensionContext) {
180
180
181
181
registerArduinoCommand ( "arduino.setSketchFile" , async ( ) => {
182
182
const sketchFileName = deviceContext . sketch ;
183
- const newSketchFileName = await vscode . window . showInputBox ( {
184
- placeHolder : sketchFileName ,
185
- validateInput : ( value ) => {
186
- if ( value && / \. ( ( i n o ) | ( c p p ) | c ) $ / . test ( value . trim ( ) ) ) {
187
- return null ;
188
- } else {
189
- return "Invalid sketch file name. Should be *.ino/*.cpp/*.c" ;
190
- }
191
- } ,
192
- } ) ;
183
+ let newSketchFileName = await vscode . window . showQuickPick (
184
+ getChildArduinoSources ( undefined ) ,
185
+ {
186
+ canPickMany : false , placeHolder : sketchFileName
187
+ } ) ;
193
188
194
- if ( ! newSketchFileName ) {
195
- return ;
189
+ if ( newSketchFileName || newSketchFileName !== sketchFileName ) {
190
+ deviceContext . sketch = newSketchFileName ;
191
+ deviceContext . showStatusBar ( ) ;
196
192
}
197
-
198
- deviceContext . sketch = newSketchFileName ;
199
- deviceContext . showStatusBar ( ) ;
200
193
} ) ;
201
194
202
195
registerArduinoCommand ( "arduino.uploadUsingProgrammer" , async ( ) => {
You can’t perform that action at this time.
0 commit comments