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 @@ -321,8 +321,9 @@ def _normalize_define(define_string):
321
321
define_string = define_string .strip ()
322
322
if "=" in define_string :
323
323
define , value = define_string .split ("=" , maxsplit = 1 )
324
- if '"' in value and not value .startswith ("\\ " ):
325
- # Escape only raw values
324
+ if any (char in value for char in (' ' , '<' , '>' )):
325
+ value = f'"{ value } "'
326
+ elif '"' in value and not value .startswith ("\\ " ):
326
327
value = value .replace ('"' , '\\ "' )
327
328
return (define , value )
328
329
return define_string
@@ -333,8 +334,11 @@ def _normalize_define(define_string):
333
334
]
334
335
335
336
for f in compile_group .get ("compileCommandFragments" , []):
336
- if f .get ("fragment" , "" ).startswith ("-D" ):
337
- result .append (_normalize_define (f ["fragment" ][2 :]))
337
+ fragment = f .get ("fragment" , "" ).strip ()
338
+ if fragment .startswith ('"' ):
339
+ fragment = fragment .strip ('"' )
340
+ if fragment .startswith ("-D" ):
341
+ result .append (_normalize_define (fragment [2 :]))
338
342
339
343
return result
340
344
You can’t perform that action at this time.
0 commit comments