fix: Fallback metadata for windows debug

This commit is contained in:
FalsePattern 2024-07-18 10:40:10 +02:00
parent dd942750d4
commit 905df582e4
Signed by: falsepattern
GPG key ID: E930CDEC50C50E23
5 changed files with 45 additions and 1 deletions

View file

@ -19,6 +19,9 @@ Changelog structure reference:
### Fixed
- Debugger
- Added fallback metadata for windows debugger downloading
- Zig
- Color settings has more accurate color preview text.
- Better builtin indentation

View file

@ -1,3 +1,4 @@
import de.undercouch.gradle.tasks.download.Download
import groovy.xml.XmlParser
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML
@ -16,6 +17,7 @@ plugins {
id("org.jetbrains.intellij.platform") version("2.0.0-beta8")
id("org.jetbrains.changelog") version("2.2.1")
id("org.jetbrains.grammarkit") version("2022.3.2.2")
id("de.undercouch.download") version("5.6.0")
}
val publishVersions = listOf("232", "233", "241", "242")
@ -231,6 +233,19 @@ project(":debugger") {
}
}
}
val genOutputDir = layout.buildDirectory.dir("generated-resources")
sourceSets["main"].resources.srcDir(genOutputDir)
tasks {
register<Download>("downloadProps") {
src("https://falsepattern.com/zigbrains/msvc.properties")
dest(genOutputDir.map { it.file("msvc.properties") })
}
processResources {
dependsOn("downloadProps")
}
}
}
project(":zon") {

View file

@ -14,6 +14,8 @@ notification.title.debugger=Debugger
notification.content.debugger.successfully.downloaded=Debugger successfully downloaded
notification.content.debugger.downloading.failed=Debugger downloading failed
notification.content.debugger.metadata.downloading.failed=Debugger metadata downloading failed
notification.content.debugger.metadata.fallback.fetch.failed=Debugger fallback metadata fetch failed
notification.content.debugger.metadata.fallback.parse.failed=Debugger fallback metadata parse failed
settings.debugger.toolchain.download.debugger.automatically.checkbox=Download and update the debugger automatically
settings.debugger.title=Zig
settings.debugger.toolchain.debugger.label=Debugger:

View file

@ -33,6 +33,7 @@ import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Files;
@ -371,11 +372,34 @@ public final class ZigDebuggerToolchainService {
//TODO logging
e.printStackTrace();
Notifications.Bus.notify(new Notification(
"Zig Debugger",
"ZigBrains.Debugger.Error",
ZigBundle.message("notification.title.debugger"),
ZigBundle.message("notification.content.debugger.metadata.downloading.failed"),
NotificationType.ERROR
));
//Try to load fallback file
try {
@Cleanup val resource = ZigDebuggerToolchainService.class.getResourceAsStream("msvc.properties");
if (resource == null) {
Notifications.Bus.notify(new Notification(
"ZigBrains.Debugger.Error",
ZigBundle.message("notification.title.debugger"),
ZigBundle.message("notification.content.debugger.metadata.fallback.fetch.failed"),
NotificationType.ERROR
));
return prop;
}
val reader = new InputStreamReader(resource);
prop.load(reader);
} catch (IOException ex) {
ex.printStackTrace();
Notifications.Bus.notify(new Notification(
"ZigBrains.Debugger.Error",
ZigBundle.message("notification.title.debugger"),
ZigBundle.message("notification.content.debugger.metadata.fallback.parse.failed"),
NotificationType.ERROR
));
}
}
return prop;
}

View file

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB