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

Add syntax highlighting for function calls #46

Merged

Conversation

francogarcia
Copy link
Contributor

Hello, @NathanLovato ,
How are you?

Please check if the PR fulfills these requirements:

  • The commit message follows our guidelines.
  • For bug fixes and features:
    • You tested the changes.
    • You updated the docs or changelog.

Related issue (if applicable): Closes #30.

What kind of change does this PR introduce?

The commit add syntax highlighting for function calls.

Does this PR introduce a breaking change?

No.

New feature or change

What is the current behavior?

Function calls are shown in the editor using the regular face.

What is the new behavior?

Function calls are shown in the editor using the font-lock-function-name-face.

Other information

The implementation uses "(" instead (syntax open-parenthesis) as
open-parenthesis is defined from (open-paren (or "{" "[" "(")). As a result,
the regular expression would also highlight array and dictionary variables.

The regular expression does highlight signal definitions with parameters,
though, as they follow the same pattern of function calls. This could be avoided
by ignoring expressions started with "signal" (or by adding a custom rule to
highlight signal definitions).

I think this closes the last issue that required implementation, as it seems that
#25 was implemented in #27, although it is waiting to be merged in another
repository.

I believe that #13 was addressed by #40. If there is still need to change
something (for instance, introduce a variable to add parameters to the
executable), just let me know.

Best regards,
Franco

Closes godotengine#30.

Pattern: identifier optional_spaces open_parenthesis

The implementation uses `"("` instead `(syntax open-parenthesis)` as
`open-parenthesis` is defined from `(open-paren (or "{" "[" "("))`. As a result,
the regular expression would also highlight array and dictionary variables.

The regular expression does highlight signal definitions with parameters,
though, as they follow the same pattern of function calls. This could be avoided
by ignoring expressions started with "signal" (or by adding a custom rule to
highlight signal definitions).
@NathanLovato NathanLovato merged commit 9a74dd3 into godotengine:master Apr 4, 2020
@NathanLovato
Copy link
Collaborator

This is great, thanks for your help. In your PR or commit message, at the end, you can write "Close #xx" to automatically close the issue xx upon merging your PR.

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.

Add syntax highlighting for function calls
2 participants