@@ -240,7 +240,7 @@ export class ArduinoApp {
240
240
} else {
241
241
configSection . includePath = [ ] ;
242
242
}
243
- configSection . includePath . push ( childLibPath ) ;
243
+ configSection . includePath . unshift ( childLibPath ) ;
244
244
} ) ;
245
245
246
246
libPaths . forEach ( ( childLibPath ) => {
@@ -254,7 +254,7 @@ export class ArduinoApp {
254
254
} else {
255
255
configSection . browse . path = [ ] ;
256
256
}
257
- configSection . browse . path . push ( childLibPath ) ;
257
+ configSection . browse . path . unshift ( childLibPath ) ;
258
258
} ) ;
259
259
260
260
fs . writeFileSync ( configFilePath , JSON . stringify ( deviceContext , null , 4 ) ) ;
@@ -437,14 +437,33 @@ export class ArduinoApp {
437
437
438
438
// Generate cpptools intellisense config
439
439
const cppConfigFilePath = path . join ( destExample , constants . CPP_CONFIG_FILE ) ;
440
+
441
+ // Current workspace
442
+ const includePath = [ "${workspaceRoot}" ] ;
443
+ // Defaut package for this board
444
+ includePath . concat ( this . getDefaultPackageLibPaths ( ) ) ;
445
+ // Arduino built-in package tools
446
+ includePath . push ( path . join ( this . _settings . arduinoPath , "hardware" , "tools" ) ) ;
447
+ // Arduino built-in libraries
448
+ includePath . push ( path . join ( this . _settings . arduinoPath , "libraries" ) ) ;
449
+ // Arduino custom package tools
450
+ includePath . push ( path . join ( os . homedir ( ) , "Documents" , "Arduino" , "hardware" , "tools" ) ) ;
451
+ // Arduino custom libraries
452
+ includePath . push ( path . join ( os . homedir ( ) , "Documents" , "Arduino" , "libraries" ) ) ;
453
+
440
454
const cppConfig = {
441
455
configurations : [ {
442
456
name : util . getCppConfigPlatform ( ) ,
443
- includePath : this . getDefaultPackageLibPaths ( ) ,
457
+ includePath,
444
458
browse : {
459
+ path : includePath ,
445
460
limitSymbolsToIncludedHeaders : false ,
446
461
} ,
462
+ intelliSenseMode : "clang-x64" ,
463
+ cStandard : "c11" ,
464
+ cppStandard : "c++17" ,
447
465
} ] ,
466
+ version : 3 ,
448
467
} ;
449
468
util . mkdirRecursivelySync ( path . dirname ( cppConfigFilePath ) ) ;
450
469
fs . writeFileSync ( cppConfigFilePath , JSON . stringify ( cppConfig , null , 4 ) ) ;
0 commit comments