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

[C] Make function parameter names optional #4093

Merged
merged 1 commit into from
Nov 17, 2024

Conversation

braewoods
Copy link
Contributor

Function parameter names are now optional in C and C++. Previously the syntax highlighting rules would assume that the last identifier found in a parameter was the parameter name but this was making it impossible to properly highlight parameters without a parameter name.

The only solution I could find was to include the specific types and modifiers before the more general match for the parameter name. With this, the types and modifiers are no longer mistaken for a parameter name.

Function parameter names are now optional in C and C++. Previously
the syntax highlighting rules would assume that the last identifier
found in a parameter was the parameter name but this was making it
impossible to properly highlight parameters without a parameter name.

The only solution I could find was to include the specific types and
modifiers before the more general match for the parameter name. With
this, the types and modifiers are no longer mistaken for a parameter
name.
@deathaxe
Copy link
Collaborator

A general approach to support type only signatures, requires different context structure.

Java syntax would be a good starting point to learn how to do so. But I think it might require more significant changes as we first need to properly support all the generics to be able to do so.

@deathaxe deathaxe merged commit cccff30 into sublimehq:master Nov 17, 2024
1 check passed
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.

3 participants