-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
713 additions
and
513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "MockSkript"] | ||
path = MockSkript | ||
url = https://github.com/SkEditorPlus/MockSkript | ||
url = https://github.com/SkEditorTeam/MockSkript |
Submodule MockSkript
updated
149 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 0 additions & 80 deletions
80
MockSkriptBridge/src/main/java/me/glicz/skanalyzer/bridge/AnalyzerCommandSender.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
MockSkriptBridge/src/main/java/me/glicz/skanalyzer/bridge/log/CachingLogHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package me.glicz.skanalyzer.bridge.log; | ||
|
||
import ch.njol.skript.log.LogEntry; | ||
import ch.njol.skript.log.LogHandler; | ||
import ch.njol.skript.log.SkriptLogger; | ||
import me.glicz.skanalyzer.error.ScriptError; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Unmodifiable; | ||
|
||
import java.io.File; | ||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class CachingLogHandler extends LogHandler { | ||
private final Map<File, List<ScriptError>> scriptErrors = new HashMap<>(); | ||
|
||
public @Unmodifiable List<ScriptError> scriptErrors(File file) { | ||
if (scriptErrors.containsKey(file)) { | ||
return List.copyOf(scriptErrors.get(file)); | ||
} | ||
return List.of(); | ||
} | ||
|
||
@Override | ||
public @NotNull LogResult log(@NotNull LogEntry entry) { | ||
if (entry.node != null) { | ||
this.scriptErrors.computeIfAbsent(entry.node.getConfig().getFile(), file -> new ArrayList<>()) | ||
.add(new ScriptError(entry.node.getLine(), entry.message, entry.level)); | ||
} | ||
|
||
return LogResult.CACHED; | ||
} | ||
|
||
@Override | ||
public @NotNull CachingLogHandler start() { | ||
return SkriptLogger.startLogHandler(this); | ||
} | ||
} |
Oops, something went wrong.