Skip to content

Commit da82ae4

Browse files
authored
Merge pull request microsoft#67921 from fadeevab/makefile-update
Makefile colorizing tests - handling variable expansion in a variable name
2 parents b0b6dc6 + e911796 commit da82ae4

2 files changed

Lines changed: 261 additions & 1 deletion

File tree

extensions/make/test/colorize-fixtures/makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,10 @@ var:=123
7575
var!=echo val
7676
var:=val \
7777
notvar=butval
78+
79+
var-$(nested-var)=val
80+
81+
# Spaces in a nested shell will hurt a colorizing of variable,
82+
# but not so much.
83+
var-$(shell printf 2) := val2
84+
$(info Should be 'val2' here: $(var-2))

extensions/make/test/colorize-results/makefile.json

Lines changed: 254 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3012,5 +3012,258 @@
30123012
"light_vs": "default: #000000",
30133013
"hc_black": "default: #FFFFFF"
30143014
}
3015+
},
3016+
{
3017+
"c": "var-",
3018+
"t": "source.makefile variable.other.makefile",
3019+
"r": {
3020+
"dark_plus": "variable: #9CDCFE",
3021+
"light_plus": "variable: #001080",
3022+
"dark_vs": "default: #D4D4D4",
3023+
"light_vs": "default: #000000",
3024+
"hc_black": "variable: #9CDCFE"
3025+
}
3026+
},
3027+
{
3028+
"c": "$(",
3029+
"t": "source.makefile variable.other.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
3030+
"r": {
3031+
"dark_plus": "string: #CE9178",
3032+
"light_plus": "string: #A31515",
3033+
"dark_vs": "string: #CE9178",
3034+
"light_vs": "string: #A31515",
3035+
"hc_black": "string: #CE9178"
3036+
}
3037+
},
3038+
{
3039+
"c": "nested-var",
3040+
"t": "source.makefile variable.other.makefile string.interpolated.makefile variable.other.makefile",
3041+
"r": {
3042+
"dark_plus": "variable: #9CDCFE",
3043+
"light_plus": "variable: #001080",
3044+
"dark_vs": "string: #CE9178",
3045+
"light_vs": "string: #A31515",
3046+
"hc_black": "variable: #9CDCFE"
3047+
}
3048+
},
3049+
{
3050+
"c": ")",
3051+
"t": "source.makefile variable.other.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
3052+
"r": {
3053+
"dark_plus": "string: #CE9178",
3054+
"light_plus": "string: #A31515",
3055+
"dark_vs": "string: #CE9178",
3056+
"light_vs": "string: #A31515",
3057+
"hc_black": "string: #CE9178"
3058+
}
3059+
},
3060+
{
3061+
"c": "=",
3062+
"t": "source.makefile punctuation.separator.key-value.makefile",
3063+
"r": {
3064+
"dark_plus": "default: #D4D4D4",
3065+
"light_plus": "default: #000000",
3066+
"dark_vs": "default: #D4D4D4",
3067+
"light_vs": "default: #000000",
3068+
"hc_black": "default: #FFFFFF"
3069+
}
3070+
},
3071+
{
3072+
"c": "val",
3073+
"t": "source.makefile",
3074+
"r": {
3075+
"dark_plus": "default: #D4D4D4",
3076+
"light_plus": "default: #000000",
3077+
"dark_vs": "default: #D4D4D4",
3078+
"light_vs": "default: #000000",
3079+
"hc_black": "default: #FFFFFF"
3080+
}
3081+
},
3082+
{
3083+
"c": "#",
3084+
"t": "source.makefile comment.line.number-sign.makefile punctuation.definition.comment.makefile",
3085+
"r": {
3086+
"dark_plus": "comment: #6A9955",
3087+
"light_plus": "comment: #008000",
3088+
"dark_vs": "comment: #6A9955",
3089+
"light_vs": "comment: #008000",
3090+
"hc_black": "comment: #7CA668"
3091+
}
3092+
},
3093+
{
3094+
"c": " Spaces in a nested shell will hurt a colorizing of variable,",
3095+
"t": "source.makefile comment.line.number-sign.makefile",
3096+
"r": {
3097+
"dark_plus": "comment: #6A9955",
3098+
"light_plus": "comment: #008000",
3099+
"dark_vs": "comment: #6A9955",
3100+
"light_vs": "comment: #008000",
3101+
"hc_black": "comment: #7CA668"
3102+
}
3103+
},
3104+
{
3105+
"c": "#",
3106+
"t": "source.makefile comment.line.number-sign.makefile punctuation.definition.comment.makefile",
3107+
"r": {
3108+
"dark_plus": "comment: #6A9955",
3109+
"light_plus": "comment: #008000",
3110+
"dark_vs": "comment: #6A9955",
3111+
"light_vs": "comment: #008000",
3112+
"hc_black": "comment: #7CA668"
3113+
}
3114+
},
3115+
{
3116+
"c": " but not so much.",
3117+
"t": "source.makefile comment.line.number-sign.makefile",
3118+
"r": {
3119+
"dark_plus": "comment: #6A9955",
3120+
"light_plus": "comment: #008000",
3121+
"dark_vs": "comment: #6A9955",
3122+
"light_vs": "comment: #008000",
3123+
"hc_black": "comment: #7CA668"
3124+
}
3125+
},
3126+
{
3127+
"c": "var-",
3128+
"t": "source.makefile",
3129+
"r": {
3130+
"dark_plus": "default: #D4D4D4",
3131+
"light_plus": "default: #000000",
3132+
"dark_vs": "default: #D4D4D4",
3133+
"light_vs": "default: #000000",
3134+
"hc_black": "default: #FFFFFF"
3135+
}
3136+
},
3137+
{
3138+
"c": "$(",
3139+
"t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
3140+
"r": {
3141+
"dark_plus": "string: #CE9178",
3142+
"light_plus": "string: #A31515",
3143+
"dark_vs": "string: #CE9178",
3144+
"light_vs": "string: #A31515",
3145+
"hc_black": "string: #CE9178"
3146+
}
3147+
},
3148+
{
3149+
"c": "shell",
3150+
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile support.function.shell.makefile",
3151+
"r": {
3152+
"dark_plus": "support.function: #DCDCAA",
3153+
"light_plus": "support.function: #795E26",
3154+
"dark_vs": "string: #CE9178",
3155+
"light_vs": "string: #A31515",
3156+
"hc_black": "support.function: #DCDCAA"
3157+
}
3158+
},
3159+
{
3160+
"c": " printf 2",
3161+
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile",
3162+
"r": {
3163+
"dark_plus": "string: #CE9178",
3164+
"light_plus": "string: #A31515",
3165+
"dark_vs": "string: #CE9178",
3166+
"light_vs": "string: #A31515",
3167+
"hc_black": "string: #CE9178"
3168+
}
3169+
},
3170+
{
3171+
"c": ")",
3172+
"t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
3173+
"r": {
3174+
"dark_plus": "string: #CE9178",
3175+
"light_plus": "string: #A31515",
3176+
"dark_vs": "string: #CE9178",
3177+
"light_vs": "string: #A31515",
3178+
"hc_black": "string: #CE9178"
3179+
}
3180+
},
3181+
{
3182+
"c": " := val2",
3183+
"t": "source.makefile",
3184+
"r": {
3185+
"dark_plus": "default: #D4D4D4",
3186+
"light_plus": "default: #000000",
3187+
"dark_vs": "default: #D4D4D4",
3188+
"light_vs": "default: #000000",
3189+
"hc_black": "default: #FFFFFF"
3190+
}
3191+
},
3192+
{
3193+
"c": "$(",
3194+
"t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
3195+
"r": {
3196+
"dark_plus": "string: #CE9178",
3197+
"light_plus": "string: #A31515",
3198+
"dark_vs": "string: #CE9178",
3199+
"light_vs": "string: #A31515",
3200+
"hc_black": "string: #CE9178"
3201+
}
3202+
},
3203+
{
3204+
"c": "info",
3205+
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile support.function.info.makefile",
3206+
"r": {
3207+
"dark_plus": "support.function: #DCDCAA",
3208+
"light_plus": "support.function: #795E26",
3209+
"dark_vs": "string: #CE9178",
3210+
"light_vs": "string: #A31515",
3211+
"hc_black": "support.function: #DCDCAA"
3212+
}
3213+
},
3214+
{
3215+
"c": " Should be 'val2' here: ",
3216+
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile",
3217+
"r": {
3218+
"dark_plus": "string: #CE9178",
3219+
"light_plus": "string: #A31515",
3220+
"dark_vs": "string: #CE9178",
3221+
"light_vs": "string: #A31515",
3222+
"hc_black": "string: #CE9178"
3223+
}
3224+
},
3225+
{
3226+
"c": "$(",
3227+
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
3228+
"r": {
3229+
"dark_plus": "string: #CE9178",
3230+
"light_plus": "string: #A31515",
3231+
"dark_vs": "string: #CE9178",
3232+
"light_vs": "string: #A31515",
3233+
"hc_black": "string: #CE9178"
3234+
}
3235+
},
3236+
{
3237+
"c": "var-2",
3238+
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile string.interpolated.makefile variable.other.makefile",
3239+
"r": {
3240+
"dark_plus": "variable: #9CDCFE",
3241+
"light_plus": "variable: #001080",
3242+
"dark_vs": "string: #CE9178",
3243+
"light_vs": "string: #A31515",
3244+
"hc_black": "variable: #9CDCFE"
3245+
}
3246+
},
3247+
{
3248+
"c": ")",
3249+
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
3250+
"r": {
3251+
"dark_plus": "string: #CE9178",
3252+
"light_plus": "string: #A31515",
3253+
"dark_vs": "string: #CE9178",
3254+
"light_vs": "string: #A31515",
3255+
"hc_black": "string: #CE9178"
3256+
}
3257+
},
3258+
{
3259+
"c": ")",
3260+
"t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
3261+
"r": {
3262+
"dark_plus": "string: #CE9178",
3263+
"light_plus": "string: #A31515",
3264+
"dark_vs": "string: #CE9178",
3265+
"light_vs": "string: #A31515",
3266+
"hc_black": "string: #CE9178"
3267+
}
30153268
}
3016-
]
3269+
]

0 commit comments

Comments
 (0)