File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -324,8 +324,9 @@ def _normalize_define(define_string):
324
324
define_string = define_string .strip ()
325
325
if "=" in define_string :
326
326
define , value = define_string .split ("=" , maxsplit = 1 )
327
- if '"' in value and not value .startswith ("\\ " ):
328
- # Escape only raw values
327
+ if any (char in value for char in (' ' , '<' , '>' )):
328
+ value = f'"{ value } "'
329
+ elif '"' in value and not value .startswith ("\\ " ):
329
330
value = value .replace ('"' , '\\ "' )
330
331
return (define , value )
331
332
return define_string
@@ -336,8 +337,11 @@ def _normalize_define(define_string):
336
337
]
337
338
338
339
for f in compile_group .get ("compileCommandFragments" , []):
339
- if f .get ("fragment" , "" ).startswith ("-D" ):
340
- result .append (_normalize_define (f ["fragment" ][2 :]))
340
+ fragment = f .get ("fragment" , "" ).strip ()
341
+ if fragment .startswith ('"' ):
342
+ fragment = fragment .strip ('"' )
343
+ if fragment .startswith ("-D" ):
344
+ result .append (_normalize_define (fragment [2 :]))
341
345
342
346
return result
343
347
You can’t perform that action at this time.
0 commit comments