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

Unreachable Code #6960

Open
wants to merge 24 commits into
base: dev/feature
Choose a base branch
from
Open

Conversation

UnderscoreTud
Copy link
Member

@UnderscoreTud UnderscoreTud commented Aug 5, 2024

Description

This PR adds a warning for unreachable code using a new API that gives statements/sections a way to define what happens after its execution.
Currently, the Intent API only supports "stop" intentions.

As well as fixing a bug where the return effect would always stop the trigger rather than just the returning section.


Target Minecraft Versions: any
Requirements: none
Related Issues: none

@Fusezion

This comment was marked as resolved.

…chable code warning using config or the suppress warning effect
src/main/java/ch/njol/skript/ScriptLoader.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/lang/ExecutionIntent.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/lang/TriggerSection.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/sections/SecConditional.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/sections/SecConditional.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/sections/SecConditional.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/lang/ExecutionIntent.java Outdated Show resolved Hide resolved
@sovdeeth sovdeeth added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Aug 15, 2024
Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking really good

@APickledWalrus APickledWalrus added the 2.10 Targeting a 2.10.X version release label Aug 15, 2024
@APickledWalrus
Copy link
Member

APickledWalrus commented Aug 15, 2024

Also, I am a little unsure about the config option. I don't think that it is necessary given the suppress effect exists. I'd like to see what others think though.

@UnderscoreTud
Copy link
Member Author

Also, I am a little unsure about the config option. I don't think that it is necessary given the suppress effect exists. I'd like to see what others think though.

All warnings that may be suppressed by the suppress effect, excluding the deprecated syntax warning, have a config option equivalent. So, I think it's more consistent that way.

@UnderscoreTud UnderscoreTud added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Sep 4, 2024
src/main/java/ch/njol/skript/sections/SecConditional.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/lang/Section.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffReturn.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/lang/Section.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffContinue.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffContinue.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffExit.java Outdated Show resolved Hide resolved
# Conflicts:
#	src/main/java/ch/njol/skript/effects/EffContinue.java
#	src/main/java/ch/njol/skript/effects/EffExit.java
#	src/main/java/ch/njol/skript/effects/EffReturn.java
#	src/main/java/ch/njol/skript/effects/EffSuppressWarnings.java
Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent work. i think this is ready to go (apart from the one small issue...)

src/main/java/ch/njol/skript/sections/SecConditional.java Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.10 Targeting a 2.10.X version release bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. enhancement Feature request, an issue about something that could be improved, or a PR improving something.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants