Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong tokenization of else statement for ifdef in Makefile #10

Closed
alexr00 opened this issue Nov 9, 2020 · 10 comments
Closed

Wrong tokenization of else statement for ifdef in Makefile #10

alexr00 opened this issue Nov 9, 2020 · 10 comments

Comments

@alexr00
Copy link

alexr00 commented Nov 9, 2020

Issue Type: Bug

In this Makefile sample "else" statement gets a wrong color:

a := 1
target:
ifdef a
	echo a
else
	echo b
endif

Originally from @foreignmeloman in microsoft/vscode#109008

Screenshot:
image

VS Code version: Code - Insiders 1.51.0-insider (13b3c937dc5e3816c79bdd2cdf2cdf6f9c727b75, 2020-10-20T06:07:53.466Z)
OS version: Windows_NT x64 10.0.18363

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8400H CPU @ 2.50GHz (8 x 2496)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.80GB (4.73GB free)
Process Argv --crash-reporter-id b24ee7a9-a4c3-4313-b1c0-661cd65ffc34
Screen Reader no
VM 0%
Extensions: none
@fadeevab
Copy link
Owner

Thanks for reporting. I'll check it out a bit later.

fadeevab pushed a commit that referenced this issue Feb 6, 2021
It fixes "Wrong tokenization of 'else' statement for ifdef in Makefile #10".
@fadeevab
Copy link
Owner

fadeevab commented Feb 6, 2021

Fixed!

Hey, @alexr00, could you return unit-tests for Makefile into vscode repository back? Or could you say where they are. Thank you!

@fadeevab
Copy link
Owner

fadeevab commented Feb 9, 2021

@alexr00 Your guys have to get back code review practices and other SDLC practices, as I see commits moving huge parts of source code here and there without any description and PR. Folks, you are Microsoft, come on! ;)

@fadeevab fadeevab closed this as completed Feb 9, 2021
@foreignmeloman
Copy link

Thanks for the fix! So when will this be available?

@fadeevab
Copy link
Owner

@foreignmeloman Usually, we get the update with the very next VSCode release. The changes from this repo have to be pulled to https://github.com/microsoft/vscode/blob/master/extensions/make/syntaxes/make.tmLanguage.json by @alexr00 or somebody else from the VSCode team. Need just wait.

@alexr00
Copy link
Author

alexr00 commented Feb 12, 2021

@fadeevab I tried pulling in your changes, but I'm seeing some colorizing results that look unintended. Specifically, when a # is preceded by a tab then the line doesn't get tokenized as a comment. Example snippet:

	# "$$" in a shell means to escape makefile's variable substitution.

@fadeevab
Copy link
Owner

@alexr00 Yeah, I changed the behavior of comments colorizing in the scope of #4

image

This is because:

target:
# This is a comment of Makefile
<------># This is a comment of Bash, and it is not gonna be colorized. "Bash inside of Makefile" is a difficult deal.

@alexr00 I didn't update test because there was no test files at the moment of my patch. I can upgrade test cases later... Still, you can upgrade test results for now.

@fadeevab
Copy link
Owner

@alexr00 Or, if you need, we can wait until I upgrade test case results inside of your test system. What do you think?

@alexr00
Copy link
Author

alexr00 commented Feb 15, 2021

@fadeevab no need for you to update the tests, thank you though. I just wasn't sure if this was expected behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants