@@ -301,16 +301,13 @@ export class ArduinoApp {
301
301
deviceContext . configurations . forEach ( ( section ) => {
302
302
if ( section . name === util . getCppConfigPlatform ( ) ) {
303
303
configSection = section ;
304
- configSection . browse = configSection . browse || { } ;
305
- configSection . browse . limitSymbolsToIncludedHeaders = false ;
306
304
}
307
305
} ) ;
308
306
309
307
if ( ! configSection ) {
310
308
configSection = {
311
309
name : util . getCppConfigPlatform ( ) ,
312
310
includePath : [ ] ,
313
- browse : { limitSymbolsToIncludedHeaders : false } ,
314
311
} ;
315
312
deviceContext . configurations . push ( configSection ) ;
316
313
}
@@ -329,20 +326,6 @@ export class ArduinoApp {
329
326
configSection . includePath . unshift ( childLibPath ) ;
330
327
} ) ;
331
328
332
- libPaths . forEach ( ( childLibPath ) => {
333
- childLibPath = path . resolve ( path . normalize ( childLibPath ) ) ;
334
- if ( configSection . browse . path && configSection . browse . path . length ) {
335
- for ( const existingPath of configSection . browse . path ) {
336
- if ( childLibPath === path . resolve ( path . normalize ( existingPath ) ) ) {
337
- return ;
338
- }
339
- }
340
- } else {
341
- configSection . browse . path = [ ] ;
342
- }
343
- configSection . browse . path . unshift ( childLibPath ) ;
344
- } ) ;
345
-
346
329
fs . writeFileSync ( configFilePath , JSON . stringify ( deviceContext , null , 4 ) ) ;
347
330
}
348
331
@@ -475,13 +458,21 @@ Please make sure the folder is not occupied by other procedures .`);
475
458
return result ;
476
459
}
477
460
const toolsPath = boardDescriptor . platform . rootBoardPath ;
478
- if ( util . directoryExistsSync ( path . join ( toolsPath , "cores" ) ) ) {
479
- const coreLibs = fs . readdirSync ( path . join ( toolsPath , "cores" ) ) ;
480
- if ( coreLibs && coreLibs . length > 0 ) {
481
- coreLibs . forEach ( ( coreLib ) => {
482
- result . push ( path . normalize ( path . join ( toolsPath , "cores" , coreLib ) ) ) ;
483
- } ) ;
484
- }
461
+ result . push ( path . normalize ( path . join ( toolsPath , "**" ) ) ) ;
462
+ // if (util.directoryExistsSync(path.join(toolsPath, "cores"))) {
463
+ // const coreLibs = fs.readdirSync(path.join(toolsPath, "cores"));
464
+ // if (coreLibs && coreLibs.length > 0) {
465
+ // coreLibs.forEach((coreLib) => {
466
+ // result.push(path.normalize(path.join(toolsPath, "cores", coreLib)));
467
+ // });
468
+ // }
469
+ // }
470
+ // return result;
471
+
472
+ // <package>/hardware/<platform>/<version> -> <package>/tools
473
+ const toolPath = path . join ( toolsPath , ".." , ".." , ".." , "tools" ) ;
474
+ if ( fs . existsSync ( toolPath ) ) {
475
+ result . push ( path . normalize ( path . join ( toolPath , "**" ) ) ) ;
485
476
}
486
477
return result ;
487
478
}
@@ -537,26 +528,23 @@ Please make sure the folder is not occupied by other procedures .`);
537
528
const cppConfigFilePath = path . join ( destExample , constants . CPP_CONFIG_FILE ) ;
538
529
539
530
// Current workspace
540
- const includePath = [ "${workspaceRoot}" ] ;
531
+ let includePath = [ "${workspaceRoot}" ] ;
541
532
// Defaut package for this board
542
- includePath . concat ( this . getDefaultPackageLibPaths ( ) ) ;
533
+ const defaultPackageLibPaths = this . getDefaultPackageLibPaths ( ) ;
534
+ includePath = includePath . concat ( defaultPackageLibPaths ) ;
543
535
// Arduino built-in package tools
544
- includePath . push ( path . join ( this . _settings . arduinoPath , "hardware" , "tools" ) ) ;
536
+ includePath . push ( path . join ( this . _settings . arduinoPath , "hardware" , "tools" , "**" ) ) ;
545
537
// Arduino built-in libraries
546
- includePath . push ( path . join ( this . _settings . arduinoPath , "libraries" ) ) ;
538
+ includePath . push ( path . join ( this . _settings . arduinoPath , "libraries" , "**" ) ) ;
547
539
// Arduino custom package tools
548
- includePath . push ( path . join ( os . homedir ( ) , "Documents" , "Arduino" , "hardware" , "tools" ) ) ;
540
+ includePath . push ( path . join ( os . homedir ( ) , "Documents" , "Arduino" , "hardware" , "tools" , "**" ) ) ;
549
541
// Arduino custom libraries
550
- includePath . push ( path . join ( os . homedir ( ) , "Documents" , "Arduino" , "libraries" ) ) ;
542
+ includePath . push ( path . join ( os . homedir ( ) , "Documents" , "Arduino" , "libraries" , "**" ) ) ;
551
543
552
544
const cppConfig = {
553
545
configurations : [ {
554
546
name : util . getCppConfigPlatform ( ) ,
555
547
includePath,
556
- browse : {
557
- path : includePath ,
558
- limitSymbolsToIncludedHeaders : false ,
559
- } ,
560
548
intelliSenseMode : "clang-x64" ,
561
549
cStandard : "c11" ,
562
550
cppStandard : "c++17" ,
0 commit comments