OPENIDE #172 Fix some problems found for version 2025.1

(cherry picked from commit 8ee333dbc6)
This commit is contained in:
Nikita Iarychenko
2025-04-25 11:50:27 +04:00
parent f646d43bc9
commit 941e50fa07
8 changed files with 30 additions and 17 deletions

4
.idea/modules.xml generated
View File

@@ -1118,8 +1118,8 @@
<module fileurl="file://$PROJECT_DIR$/plugins/settings-repository/intellij.settingsRepository.iml" filepath="$PROJECT_DIR$/plugins/settings-repository/intellij.settingsRepository.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/settings-repository/intellij.settingsRepository.tests.iml" filepath="$PROJECT_DIR$/plugins/settings-repository/intellij.settingsRepository.tests.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/sh/intellij.sh.iml" filepath="$PROJECT_DIR$/plugins/sh/intellij.sh.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/settings-sync/jba/intellij.settingsSync.iml" filepath="$PROJECT_DIR$/plugins/settings-sync/jba/intellij.settingsSync.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/settings-sync-core/intellij.settingsSync.core.iml" filepath="$PROJECT_DIR$/platform/settings-sync-core/intellij.settingsSync.core.iml" />
<!--<module fileurl="file://$PROJECT_DIR$/plugins/settings-sync/jba/intellij.settingsSync.iml" filepath="$PROJECT_DIR$/plugins/settings-sync/jba/intellij.settingsSync.iml" />-->
<!--<module fileurl="file://$PROJECT_DIR$/platform/settings-sync-core/intellij.settingsSync.core.iml" filepath="$PROJECT_DIR$/platform/settings-sync-core/intellij.settingsSync.core.iml" />-->
<module fileurl="file://$PROJECT_DIR$/plugins/sh/copyright/intellij.sh.copyright.iml" filepath="$PROJECT_DIR$/plugins/sh/copyright/intellij.sh.copyright.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/sh/copyright/intellij.sh.copyright.tests.iml" filepath="$PROJECT_DIR$/plugins/sh/copyright/intellij.sh.copyright.tests.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/sh/core/intellij.sh.core.iml" filepath="$PROJECT_DIR$/plugins/sh/core/intellij.sh.core.iml" />

View File

@@ -59,7 +59,7 @@ object OpenIdePluginBundler {
private fun findFragmentUrl(element: Element?, majorVersion: String): String {
return element?.getChildren("plugin")
?.firstOrNull { it.getAttributeValue("version").extractMajorVersion() == majorVersion }
?.lastOrNull { it.getAttributeValue("version").extractMajorVersion() == majorVersion }
?.getAttributeValue("url")
?: throw RuntimeException("Amlicode plugin url not found for $majorVersion version")
}

View File

@@ -93,15 +93,15 @@ open class ITNReporter internal constructor(private val postUrl: String) : Error
): Boolean {
service<ITNProxyCoroutineScopeHolder>().coroutineScope.launch {
try {
val reportId = if (project != null) {
if (project != null) {
withBackgroundProgress(project, DiagnosticBundle.message("title.submitting.error.report")) {
ITNProxy.sendError(errorBean, postUrl)
ITNUtils.sendError(errorBean)
}
}
else {
ITNProxy.sendError(errorBean, postUrl)
ITNUtils.sendError(errorBean)
}
onSuccess(project, reportId, callback)
onSuccess(project, callback)
}
catch (e: Exception) {
onError(project, e, errorBean, parentComponent, callback)
@@ -110,10 +110,8 @@ open class ITNReporter internal constructor(private val postUrl: String) : Error
return true
}
private fun onSuccess(project: Project?, reportId: Long, callback: (SubmittedReportInfo) -> Unit) {
val reportUrl = ITNProxy.getBrowseUrl(reportId)
callback(SubmittedReportInfo(reportUrl, reportId.toString(), SubmittedReportInfo.SubmissionStatus.NEW_ISSUE))
private fun onSuccess(project: Project?, callback: (SubmittedReportInfo) -> Unit) {
callback(SubmittedReportInfo(SubmittedReportInfo.SubmissionStatus.NEW_ISSUE))
if (!NOTIFY_SUCCESS_EACH_REPORT.get()) return
val content = DiagnosticBundle.message("error.report.gratitude")

View File

@@ -17,11 +17,13 @@ import com.intellij.ide.ApplicationActivity
import com.intellij.idea.IdeaLogger
import com.intellij.openapi.application.ApplicationInfo
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.diagnostic.IdeaLoggingEvent
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.io.FileUtilRt
import com.intellij.openapi.util.text.StringUtil
import com.intellij.util.ObjectUtils
import com.intellij.util.asSafely
import io.sentry.Sentry
import io.sentry.SentryEvent
import io.sentry.SentryLevel
@@ -39,7 +41,7 @@ object ITNUtils {
internal fun sendError(error: ITNProxy.ErrorBean) {
val event = SentryEvent()
event.level = SentryLevel.ERROR
event.throwable = (error.event as IdeaReportingEvent).data.throwable
event.throwable = (error.event).data.asSafely<AbstractMessage>()?.throwable
event.release = ApplicationInfo.getInstance().build.asString()
event.user = User().apply {

View File

@@ -351,6 +351,7 @@ public final class ConsentOptions implements ModificationTracker {
else {
// EAP feedback consent is relevant to EA builds only
allDefaults.remove(lookupConsentID(EAP_FEEDBACK_OPTION_ID));
allDefaults.remove(AI_DATA_COLLECTION_OPTION_ID);
}
for (Iterator<Map.Entry<String, Map<Locale, Consent>>> it = allDefaults.entrySet().iterator(); it.hasNext(); ) {

View File

@@ -18,6 +18,7 @@ import ru.openide.welcome.screen.editor.WelcomeScreenFile
import ru.openide.welcome.screen.editor.WelcomeScreenFileSystem
import ru.openide.welcome.screen.editor.WelcomeScreenFileType
import com.intellij.openapi.application.invokeLater
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.extensions.PluginId
import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.fileEditor.OpenFileDescriptor
@@ -34,7 +35,10 @@ import ru.openide.html.*
class WelcomeScreenHelper(val project: Project) {
fun showWelcomeScreen() {
if (!JBCefApp.isSupported()) return
if (!JBCefApp.isSupported()) {
LOG.info("JBCef is not supported!")
return
}
val editorManager = FileEditorManager.getInstance(project)
val openedWelcome = editorManager.allEditors.firstOrNull(WelcomeScreenFileType::isMyEditor)
@@ -49,7 +53,10 @@ class WelcomeScreenHelper(val project: Project) {
}
fun createModel(file: VirtualFile): HtmlCefEditorModel? {
if (!WelcomeScreenFileType.isMyFile(file)) return null
if (!WelcomeScreenFileType.isMyFile(file)) {
LOG.info("Filetype for WelcomeScreen is ${file.fileType.name}")
return null
}
val htmlTemplate = HtmlEditorTemplate(TEMPLATE_NAME).apply {
addParam(THEME, if (StartupUiUtil.isDarkTheme) "theme-dark" else "")
}
@@ -105,5 +112,6 @@ class WelcomeScreenHelper(val project: Project) {
private const val SUGGESTION_QUERY_NAME = "suggestionQuery"
private const val PYTHON_PLUGIN_ID = "PythonCore"
private const val DOCKER_PLUGIN_ID = "ru.openide.docker"
private val LOG = logger<WelcomeScreenHelper>()
}
}

View File

@@ -30,8 +30,8 @@
<module name="intellij.platform.diagnostic.freezeAnalyzer"/>
<module name="intellij.platform.diagnostic.freezes"/>
<module name="intellij.platform.warmup"/>
<module name="intellij.settingsSync.core"/>
<!--<module name="intellij.settingsSync.core"/>-->
<module name="intellij.libraries.lucene.common"/>
<module name="intellij.libraries.ai.grazie.spell.gec.engine.local"/>
<module name="intellij.spellchecker"/>

View File

@@ -1,3 +1,7 @@
<!-- Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<!-- -->
<!-- Modified by Nikita Iarychenko at 2025 as part of the OpenIDE project(https://openide.ru). -->
<!-- Any modifications are available on the same license terms as the original source code. -->
<idea-plugin package="com.intellij.platform.whatsNew">
<extensions defaultExtensionNs="com.intellij">
<postStartupActivity implementation="com.intellij.platform.whatsNew.WhatsNewShowOnStartCheckService" order="last"/>
@@ -8,6 +12,6 @@
<registryKey defaultValue="false" description="Whats new test mode" key="whats.new.test.mode" restartRequired="false" />
</extensions>
<actions resource-bundle="messages.ActionsBundle">
<action id="WhatsNewAction" class="com.intellij.platform.whatsNew.WhatsNewAction" overrides="true"/>
<!--<action id="WhatsNewAction" class="com.intellij.platform.whatsNew.WhatsNewAction" overrides="true"/>-->
</actions>
</idea-plugin>