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

greedy_parent rule for say command doesn't apply properly #52

Open
Alluysl opened this issue Jul 30, 2021 · 4 comments · May be fixed by #54
Open

greedy_parent rule for say command doesn't apply properly #52

Alluysl opened this issue Jul 30, 2021 · 4 comments · May be fixed by #54
Assignees
Labels
bug Something isn't working

Comments

@Alluysl
Copy link

Alluysl commented Jul 30, 2021

Bug report checklist:
[✔️] The language-mcfunction extension only provides syntax highlighting. Have you confirmed that your issue is with the syntax highlighting, and not other features such as squiggly underlines, warning indicators, and/or pop-ups?
[✔️] Ensure that you are able to reproduce the issue without any other datapack-related extensions enabled.
[✔️] Make sure you attach a screenshot to your bug report. Bug reports without a screenshot will be closed.

Bug description:
In Sublime (don't know about VSC), the say command which should highlight everything after it in a single color, doesn't do so unless called within an execute command, or preceded by a space (third line is a lone tab):
image

@Arcensoth
Copy link
Owner

I'm able to reproduce this in SublimeText and VSCode, but only with the say command - which, at first, I thought was strange, until I dug into the version-agnostic grammar and made the grim realization that say is effectively special-cased to do this.

The behaviour outlined in this issue is definitely a bug. However, I'm also concerned about other potential bugs caused by greedy_parent as a whole - even if it's fixed and working as intended. For example: somebody has the name say for their storage, objective, or fake-player, in which case the rest of the line will be consumed.

The solution I'm gunning for is to simply remove the greedy_parent rule altogether. A side-effect of this change is that all text after any actual say commands will also go back to being highlighted independently. (On the other hand, selectors after say will be highlighted.) One might argue that this only shifts the problem from one place to another, but I don't have an issue with this solution because it's more in-line with the rest of the version-agnostic grammar. As always, I'll save the special-casing for the version-specific grammars that may or may not ever come to fruition.

@Arcensoth Arcensoth self-assigned this Jul 30, 2021
@Arcensoth Arcensoth added the bug Something isn't working label Jul 30, 2021
@Arcensoth
Copy link
Owner

Putting this here so it's easy to copy-paste for reference:

say execute run scoreboard objectives list
 say execute run scoreboard objectives list
	say execute run scoreboard objectives list
	 say execute run scoreboard objectives list
execute run say execute run scoreboard objectives list

@Alluysl
Copy link
Author

Alluysl commented Aug 1, 2021

I don't feel like this is worth opening a separate issue, I noticed that putting kill as the last thing in the file (so [ k ][ i ][ l ][ l ][EOF] - the problem doesn't happen when there's a space or a line break after it) highlights it as a syntax error:
image

It's not a problem with execute or with a target:
image
image

@Arcensoth
Copy link
Owner

I don't feel like this is worth opening a separate issue, I noticed that putting kill as the last thing in the file (so [ k ][ i ][ l ][ l ][EOF] - the problem doesn't happen when there's a space or a line break after it) highlights it as a syntax error:
image

It's not a problem with execute or with a target:
image
image

I can imagine why that's happening but I think it's better off in a separate issue, so I've created #53 for this.

@Arcensoth Arcensoth linked a pull request Sep 25, 2021 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants