@@ -48,6 +48,9 @@ export function isCompilerParserEnabled(dc?: DeviceContext) {
48
48
* Arduino currently sets the C++ standard during compilation with the
49
49
* flag -std=gnu++11
50
50
*
51
+ * * Order of includes: Perhaps insert the internal includes at the front
52
+ * as at least for the forcedIncludes IntelliSense seems to take the
53
+ * order into account.
51
54
*/
52
55
export function makeCompilerParserContext ( dc : DeviceContext ) : ICoCoPaContext {
53
56
@@ -60,7 +63,10 @@ export function makeCompilerParserContext(dc: DeviceContext): ICoCoPaContext {
60
63
arduinoChannel . warning ( "Failed to generate IntelliSense configuration." ) ;
61
64
return ;
62
65
}
63
- const pPath = path . join ( ArduinoWorkspace . rootPath , constants . CPP_CONFIG_FILE ) ;
66
+
67
+ // Normalize compiler and include paths (resolve ".." and ".")
68
+ runner . result . normalize ( ) ;
69
+
64
70
// TODO: check what kind of result we've got: gcc or other architecture:
65
71
// and instantiate content accordingly (to be implemented within cocopa)
66
72
const content = new ccp . CCppPropertiesContentResult ( runner . result ,
@@ -70,6 +76,7 @@ export function makeCompilerParserContext(dc: DeviceContext): ICoCoPaContext {
70
76
// as of 1.8.11 arduino is on C++11
71
77
ccp . CCppPropertiesCppStandard . Cpp11 ) ;
72
78
try {
79
+ const pPath = path . join ( ArduinoWorkspace . rootPath , constants . CPP_CONFIG_FILE ) ;
73
80
const prop = new ccp . CCppProperties ( ) ;
74
81
prop . read ( pPath ) ;
75
82
prop . merge ( content , ccp . CCppPropertiesMergeMode . ReplaceSameNames ) ;
0 commit comments