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

Highlight unused function argument name as Comment #7

Conversation

Simerax
Copy link

@Simerax Simerax commented Mar 9, 2021

Supposed to fix: #6

looks something likes this:
Bildschirmfoto vom 2021-03-09 01-13-07

does not change the highlighting rules of identifiers outside the
function argument list
@Simerax
Copy link
Author

Simerax commented Mar 9, 2021

I just realized it breaks on Functions Argument Types which contain parenthesis since gleamType is not aware of them.
Ill convert this PR to a draft and take a look tomorrow.
Bildschirmfoto vom 2021-03-09 01-24-28

@Simerax Simerax marked this pull request as draft March 9, 2021 00:25
@Simerax
Copy link
Author

Simerax commented Mar 9, 2021

okay I tried now for some time. I can't figure out how to make nested types work.
I managed to get simple types like List(String) to work but only because I hardcoded the first recursion of gleamType (change not commited).
I don't really have the skills to make this work for infinite nested types.

This also looked a little odd because parenthesis got highlighted as well.
Bildschirmfoto vom 2021-03-09 19-36-42

The main issue is that the gleamFunctionArguments is a region which starts with ( and ends with ). The parenthesis in the argument type break this region.

@lpil do you have any idea on how to make this work?

@lpil
Copy link
Member

lpil commented Mar 10, 2021

@lpil do you have any idea on how to make this work?

I do not I'm afraid :(

@Simerax
Copy link
Author

Simerax commented Mar 12, 2021

I will close this pr for now and just keep the issue around. Maybe someone with the right skills finds the time to work on it. I think for advanced features like this the whole syntax definition would need a rewrite.

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.

Discussion/Feature: highlight unused function argument as comment
2 participants