Skip to content

Commit

Permalink
Fix missing newline and handle syntaxes without documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
sovdeeth committed Jan 3, 2025
1 parent 57e8fe5 commit db864f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public record ErrorSource(
* @return A new error source.
*/
public static @NotNull ErrorSource fromNodeAndElement(@Nullable Node node, @NotNull SyntaxElement element) {
String elementName = element.getClass().getAnnotation(Name.class).value().trim().replaceAll("\n", "");
Name annotation = element.getClass().getAnnotation(Name.class);
String elementName = annotation != null ? annotation.value().trim().replaceAll("\n", "") : element.getClass().getSimpleName();
if (node == null) {
return new ErrorSource(element.getSyntaxTypeName(), elementName, 0, "-unknown-", "-unknown-");
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/lang/english.lang
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ skript command:
log:
# runtime errors
runtime:
error: <light red>The script '<gray>%s<light red>' encountered an error while executing the '<gray>%s<light red>' %s<light red>:
error: <light red>The script '<gray>%s<light red>' encountered an error while executing the '<gray>%s<light red>' %s<light red>:\n
errors skipped: <gold>%d<light red> runtime error[s] were thrown but not printed in the last frame. From: <gray>%s
errors timed out: <gold>Line %d<light red> of script '<gray>%s<light red>' produced too many runtime errors (<gray>%d<light red> allowed per frame). No errors from this line will be printed for %d frames.
error notification: <light red>Script '<gray>%s<light red>' produced runtime errors. Please check console logs for details.
error notification plural: <light red>Script '<gray>%s<light red>' and %d others produced runtime errors. Please check console logs for details.

warning: <yellow>The script '<gray>%s<yellow>' encountered a warning while executing the '<gray>%s<yellow>' %s<yellow>:
warning: <yellow>The script '<gray>%s<yellow>' encountered a warning while executing the '<gray>%s<yellow>' %s<yellow>:\n
warnings skipped: <yellow>%d<yellow> runtime warning[s] were thrown but not printed in the last frame. From: <gray>%s
warnings timed out: <gold>Line %d<yellow> of script '<gray>%s<yellow>' produced too many runtime warnings (<gray>%d<yellow> allowed per frame). No warnings from this line will be printed for %d frames.
warning notification: <yellow>Script '<gray>%s<yellow>' produced runtime warnings. Please check console logs for details.
Expand Down

0 comments on commit db864f6

Please sign in to comment.