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

v5.9.0 - Added 2023.3 Build Support #316

Merged
merged 4 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

#### Unreleased

#### 5.9.0

- Added 2023.3 Build Support
- Removed some internal API usages

#### 5.8.0

- Added 2023.2 Build Support
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ tasks.runPluginVerifier {
tasks.patchPluginXml {
version.set(projectVersion)
sinceBuild.set('203.7148.57')
untilBuild.set('232.*')
untilBuild.set('233.*')

def changelogPath = "$projectDir/build/html/CHANGELOG.html"
def readmePath = "$projectDir/build/html/README.html"
Expand Down
47 changes: 0 additions & 47 deletions src/main/kotlin/com/markskelton/integrations/ErrorReporter.kt
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
package com.markskelton.integrations

import com.intellij.ide.IdeBundle
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.ide.ui.LafManager
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.ApplicationNamesInfo
import com.intellij.openapi.application.ex.ApplicationInfoEx
import com.intellij.openapi.application.impl.ApplicationInfoImpl
import com.intellij.openapi.diagnostic.ErrorReportSubmitter
import com.intellij.openapi.diagnostic.IdeaLoggingEvent
import com.intellij.openapi.diagnostic.SubmittedReportInfo
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.io.FileUtilRt
import com.intellij.openapi.util.registry.Registry
import com.intellij.util.Consumer
import com.intellij.util.text.DateFormatUtil
import com.markskelton.settings.ThemeSettings
import com.markskelton.tools.runSafely
import com.markskelton.tools.runSafelyWithResult
Expand All @@ -26,8 +19,6 @@ import io.sentry.protocol.Message
import io.sentry.protocol.User
import java.awt.Component
import java.lang.management.ManagementFactory
import java.text.SimpleDateFormat
import java.util.Arrays
import java.util.Properties
import java.util.stream.Collectors

Expand Down Expand Up @@ -62,7 +53,6 @@ class ErrorReporter : ErrorReportSubmitter() {
SentryEvent()
.apply {
this.level = SentryLevel.ERROR
this.serverName = getAppName().second
this.setExtra("Additional Info", additionalInfo ?: "None")
}
).apply {
Expand All @@ -82,22 +72,14 @@ class ErrorReporter : ErrorReportSubmitter() {
}

private fun addSystemInfo(event: SentryEvent): SentryEvent {
val pair = getAppName()
val appInfo = pair.first
val appName = pair.second
val properties = System.getProperties()
return event.apply {
setExtra("App Name", appName)
setExtra("Build Info", getBuildInfo(appInfo))
setExtra("JRE", getJRE(properties))
setExtra("VM", getVM(properties))
setExtra("System Info", SystemInfo.getOsNameAndVersion())
setExtra("GC", getGC())
setExtra("Memory", Runtime.getRuntime().maxMemory() / FileUtilRt.MEGABYTE)
setExtra("Cores", Runtime.getRuntime().availableProcessors())
setExtra("Registry", getRegistry())
setExtra("Non-Bundled Plugins", getNonBundledPlugins())
setExtra("Current LAF", LafManager.getInstance().currentLookAndFeel?.name ?: "")
setExtra("One Dark Config", ThemeSettings.instance.asJson())
}
}
Expand All @@ -114,35 +96,6 @@ class ErrorReporter : ErrorReportSubmitter() {
return IdeBundle.message("about.box.vm", vmVersion, vmVendor)
}

private fun getNonBundledPlugins(): String {
return Arrays.stream(PluginManagerCore.getPlugins())
.filter { p -> !p.isBundled && p.isEnabled }
.map { p -> p.pluginId.idString }.collect(Collectors.joining(","))
}

private fun getRegistry() = Registry.getAll().stream().filter { it.isChangedFromDefault }
.map { v -> v.key + "=" + v.asString() }.collect(Collectors.joining(","))

private fun getGC() = ManagementFactory.getGarbageCollectorMXBeans().stream()
.map { it.name }.collect(Collectors.joining(","))

private fun getBuildInfo(appInfo: ApplicationInfoImpl): String {
var buildInfo = IdeBundle.message("about.box.build.number", appInfo.build.asString())
val cal = appInfo.buildDate
var buildDate = ""
if (appInfo.build.isSnapshot) {
buildDate = SimpleDateFormat("HH:mm, ").format(cal.time)
}
buildDate += DateFormatUtil.formatAboutDialogDate(cal.time)
buildInfo += IdeBundle.message("about.box.build.date", buildDate)
return buildInfo
}

private fun getAppName(): Pair<ApplicationInfoImpl, String> {
val appInfo = ApplicationInfoEx.getInstanceEx() as ApplicationInfoImpl
var appName = appInfo.fullApplicationName
val edition = ApplicationNamesInfo.getInstance().editionName
if (edition != null) appName += " ($edition)"
return Pair(appInfo, appName)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.intellij.lang.annotations.Language
val UPDATE_MESSAGE: String = """
What's New?<br>
<ul>
<li>2023.2 Build Support</li>
<li>2023.3 Build Support</li>
</ul>
<br>Please see the <a href='https://github.com/one-dark/jetbrains-one-dark-theme/blob/master/CHANGELOG.md'>Changelog</a> for more details.
<br>
Expand Down
Loading