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

[LUA Editor] Fix for 'function' keyword being interpreted as function name when syntax highlighting #17915

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

yaakuro
Copy link
Contributor

@yaakuro yaakuro commented May 13, 2024

What does this PR do?

In the current regex pattern to detect functions, causes also the LUA keyword 'function' being interpreted as a function name. I assume this is not the intention. This PR will introduce an exclude pattern for the 'function' keyword.

How was this PR tested?

Tested on my local Ubuntu 22.04 LTS computer.

This is how it is now:

image

apply this PR will make it:

image

Best regards

Yaakuro

@yaakuro yaakuro requested review from a team as code owners May 13, 2024 18:25
@guillaume-haerinck
Copy link
Contributor

Yeah I think it makes sens to not have lambdas linted as methods, I should check how vscode does it. Do you think of other exceptions?
(Btw there is also the issue of string literal being linted by regex while they should be skipped I should look at it at some point)

@yaakuro
Copy link
Contributor Author

yaakuro commented May 14, 2024

Yeah I think it makes sens to not have lambdas linted as methods, I should check how vscode does it. Do you think of other exceptions? (Btw there is also the issue of string literal being linted by regex while they should be skipped I should look at it at some point)

In which cases? 'string literal'? Any example?

@byrcolin byrcolin added the sig/content Categorizes an issue or PR as relevant to SIG Content. label May 14, 2024
@guillaume-haerinck
Copy link
Contributor

Yeah I think it makes sens to not have lambdas linted as methods, I should check how vscode does it. Do you think of other exceptions? (Btw there is also the issue of string literal being linted by regex while they should be skipped I should look at it at some point)

In which cases? 'string literal'? Any example?

like this. I think its either a wrong state in the state machine linting, or just the regex run on the full word instead of the substring during the parse callback

image

…vent wrong syntax highlighting color.

Signed-off-by: Yaakuro <[email protected]>
@yaakuro yaakuro force-pushed the yaakuro-development-patch-20 branch from 56fb7a6 to bf17f23 Compare May 16, 2024 18:49
@yaakuro
Copy link
Contributor Author

yaakuro commented May 17, 2024

Anything I need to do?

@guillaume-haerinck
Copy link
Contributor

Anything I need to do?

No I'll get to it at some point just need to find the time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/content Categorizes an issue or PR as relevant to SIG Content.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants