Skip to content

Comments

Add syntax highlighting for meson build system#3236

Merged
JoeKar merged 7 commits intomicro-editor:masterfrom
asakovets:meson-syntax
Aug 12, 2025
Merged

Add syntax highlighting for meson build system#3236
JoeKar merged 7 commits intomicro-editor:masterfrom
asakovets:meson-syntax

Conversation

@asakovets
Copy link
Contributor

It is basically a port of upstream syntax highlighting for vim, but a bit less noisy (e.g numbers are not colored).

It is basically a port of upstream syntax highlighting for vim,
but a bit less noisy (e.g numbers are not colored).
@niten94
Copy link
Contributor

niten94 commented Jul 20, 2025

but a bit less noisy (e.g numbers are not colored)

I think it's fine to highlight numbers and symbols, since users chould choose a colorscheme like simple where highlighting on some elements is minimal or none.

I'm inexperienced with syntax files but based on examples and the link in the file, maybe this could be added:

    - constant.number: "\\b(0|[1-9][0-9]*|0b[01]+|0o[0-7]+|0x[0-9a-fA-F]+)\\b"
    - symbol: ','
    - symbol.operator: "[-+*/%?.:=!+<>]"
    - symbol.brackets: "[(){}]|\\[|\\]"

@Andriamanitra
Sorry to ping, but may I request you to review this? I've seen some open source desktop software using Meson, so I think this would be nice to add. Actual examples I know other than documentation include util-linux, seatd, Xorg server and wlroots.

Copy link
Contributor

@Andriamanitra Andriamanitra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with meson but I tried it with a couple meson files and it seems to work alright.

@asakovets
Copy link
Contributor Author

asakovets commented Jul 29, 2025

Hi, sorry for the delayed reply. I almost forgot about this PR. I will look into it when I have time.

@niten94
Copy link
Contributor

niten94 commented Aug 5, 2025

I don't think you should be the one apologizing, considering that this PR received no attention for a long period of time. I've actually used your syntax file sometimes to view Meson build files, but wasn't sure when to properly review it myself.

However it would still be appreciated if it's fine with you to address the comments, so that this can now be merged and included by default.

@asakovets
Copy link
Contributor Author

Hi, @niten94 , @Andriamanitra could you please have another look?

Copy link
Contributor

@niten94 niten94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmaluka @JoeKar
Not sure who to ping but this has now been reviewed, so may this be merged?

@JoeKar
Copy link
Member

JoeKar commented Aug 12, 2025

The problem with reviews resp. approvals of non-maintainers is, that they aren't included in the filtered search:
https://github.com/zyedidia/micro/pulls?q=is%3Apr+is%3Aopen+review%3Aapproved

This will most probably hit a lot more PRs where the community gave their approval.

Anyway, I will have a short look.

@JoeKar JoeKar merged commit bce573b into micro-editor:master Aug 12, 2025
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

Successfully merging this pull request may close these issues.

4 participants