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