-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
(makefile) Syntax highlighting of Makefiles #3878
Comments
Well the "all green" after a certain point is likely a bug in how we handle strings, but if that sample is any indicator it looks like our handling of makefiles is pretty poor. Would definitely be open to someone stepping up and improving things here. The grammar is currently pretty simple and should be easier to build on than some. |
Hi Would like to work on this issue |
Go for it. :) |
All our code is open source, share it wherever... But I think one docker convention is that Dockerfile.* can be a dockerfile... so that might technically be correct in some sense, despite also being very wrong. Curious what the VS Code people will say. |
HI @joshgoebel . ifeq (bash,$(findstring bash,$(SHELL)))
toUpper = $(shell string="$(strip $1)"; printf "%s" $${string^^}) I believe this is happening because the first string mentioned in the function call '"$(strip $1)"' is not being identified correctly and I think the cause is 'FUNC' variable in makefile.js doesn't currently include QUOTE_STRING highlight.js/src/languages/makefile.js Lines 32 to 42 in 17494c8
If I change the same to include QUOTE_STRING as done in my PR This does solve the initial formatting issue. I am trying to fix this, but unable to understand on how I can proceed 😅 . Can you please help? Kindly help. Thanks. 😄 |
Keywords match in the order defined, so reverse the order of filter and filter-out. If we're going to start including more things in $() then it's no longer only variables we're dealing with so we should remove that top-level scope... perhaps add another rule to detect only SIMPLE variables like I'm not sure exactly what the context of the code inside the `$() is though vs that outside. |
Maybe that's because of: highlight.js/src/languages/makefile.js Lines 11 to 12 in 17494c8
highlight.js/src/languages/makefile.js Lines 32 to 33 in 17494c8
hence the value of |
Correct or blank, but I'm not familiar enough with Makefile to know what that content is... |
|
I understood for filter and filter-out, thanks for the explanation. I will make the change. Is it regarding having function call and multiple arguments in What do you mean by top-level scope here?
|
Ahh yess. Guess the FUNC variable needs a class name change, will look into this. Thanks |
FYI: The current changes in #3898 are not adequate to fix the problem in the OP. Note To assist you guys in improving the highlighting of makefiles: |
Describe the issue
Syntax highlighting of Makefiles is bugged.
Which language seems to have the issue?
lang-makefile
Are you using
highlight
orhighlightAuto
?no idea what Stackexchange uses...
Sample Code to Reproduce
Expected behavior
Something similar to how
kate
renders it, although that has some errors also... (see the orange lines)Additional context
See the Meta discussion: https://meta.stackexchange.com/q/393515/1288919
The text was updated successfully, but these errors were encountered: