diff --git a/java/java-tests/BUILD.bazel b/java/java-tests/BUILD.bazel index b8c8781f625f..cb507134e9c8 100644 --- a/java/java-tests/BUILD.bazel +++ b/java/java-tests/BUILD.bazel @@ -31,6 +31,7 @@ jvm_library( "//java/idea-ui:ui", "//platform/usageView-impl", "//platform/vcs-api:vcs", + "//platform/vcs-impl/shared", "//platform/editor-ui-ex:editor-ex", "//java/execution/impl", "//platform/diff-api:diff", diff --git a/java/java-tests/intellij.java.tests.iml b/java/java-tests/intellij.java.tests.iml index 46d317f4cfe0..748250774843 100644 --- a/java/java-tests/intellij.java.tests.iml +++ b/java/java-tests/intellij.java.tests.iml @@ -22,6 +22,7 @@ + diff --git a/platform/collaboration-tools/BUILD.bazel b/platform/collaboration-tools/BUILD.bazel index ca670d39d3b3..4370b7045916 100644 --- a/platform/collaboration-tools/BUILD.bazel +++ b/platform/collaboration-tools/BUILD.bazel @@ -43,6 +43,7 @@ jvm_library( "//platform/credential-store-impl:credentialStore-impl", "//platform/dvcs-impl/shared", "@lib//:http-client", + "//platform/vcs-impl/shared", ], runtime_deps = [":collaboration-tools_resources"] ) @@ -98,6 +99,7 @@ jvm_library( "@lib//:http-client", "@lib//:app-cash-turbine-jvm", "@lib//:assert_j", + "//platform/vcs-impl/shared", ], runtime_deps = [":collaboration-tools_resources"] ) diff --git a/platform/collaboration-tools/intellij.platform.collaborationTools.iml b/platform/collaboration-tools/intellij.platform.collaborationTools.iml index 7037df0d07c9..7b14b1ed0d82 100644 --- a/platform/collaboration-tools/intellij.platform.collaborationTools.iml +++ b/platform/collaboration-tools/intellij.platform.collaborationTools.iml @@ -49,5 +49,6 @@ + \ No newline at end of file diff --git a/platform/vcs-api/api-dump-experimental.txt b/platform/vcs-api/api-dump-experimental.txt index 23aa4050c182..42439d759e42 100644 --- a/platform/vcs-api/api-dump-experimental.txt +++ b/platform/vcs-api/api-dump-experimental.txt @@ -13,8 +13,6 @@ *f:com.intellij.codeInsight.hints.VcsCodeVisionLanguageContext$Companion - sf:EXTENSION:java.lang.String - f:getProvidersExtensionPoint():com.intellij.lang.LanguageExtension -*:com.intellij.openapi.vcs.LinkDescriptor -- a:getRange():com.intellij.openapi.util.TextRange *:com.intellij.openapi.vcs.VcsFileListenerIgnoredFilesProvider - *sf:Companion:com.intellij.openapi.vcs.VcsFileListenerIgnoredFilesProvider$Companion - s:isAdditionAllowed(com.intellij.openapi.project.Project,com.intellij.openapi.vcs.FilePath):Z diff --git a/platform/vcs-api/api-dump.txt b/platform/vcs-api/api-dump.txt index 3872bd4e8e43..abd83d09cfc7 100644 --- a/platform/vcs-api/api-dump.txt +++ b/platform/vcs-api/api-dump.txt @@ -268,35 +268,6 @@ f:com.intellij.openapi.vcs.Ignored - f:getMatchedPattern():java.lang.String - hashCode():I a:com.intellij.openapi.vcs.IgnoredCheckResult -c:com.intellij.openapi.vcs.IssueNavigationConfiguration -- com.intellij.openapi.util.SimpleModificationTracker -- com.intellij.openapi.components.PersistentStateComponent -- ():V -- s:findIssueLinkMatches(java.lang.CharSequence,com.intellij.openapi.vcs.IssueNavigationLink,java.util.List):V -- findIssueLinks(java.lang.CharSequence):java.util.List -- s:getInstance(com.intellij.openapi.project.Project):com.intellij.openapi.vcs.IssueNavigationConfiguration -- getLinks():java.util.List -- getState():com.intellij.openapi.vcs.IssueNavigationConfiguration -- loadState(com.intellij.openapi.vcs.IssueNavigationConfiguration):V -- s:processTextWithLinks(java.lang.String,java.util.List,java.util.function.Consumer,java.util.function.BiConsumer):V -- setLinks(java.util.List):V -c:com.intellij.openapi.vcs.IssueNavigationConfiguration$LinkMatch -- com.intellij.openapi.vcs.LinkDescriptor -- java.lang.Comparable -- (com.intellij.openapi.util.TextRange,java.lang.String):V -- compareTo(java.lang.Object):I -- getRange():com.intellij.openapi.util.TextRange -- getTargetUrl():java.lang.String -c:com.intellij.openapi.vcs.IssueNavigationLink -- ():V -- (java.lang.String,java.lang.String):V -- equals(java.lang.Object):Z -- getIssuePattern():java.util.regex.Pattern -- getIssueRegexp():java.lang.String -- getLinkRegexp():java.lang.String -- hashCode():I -- setIssueRegexp(java.lang.String):V -- setLinkRegexp(java.lang.String):V f:com.intellij.openapi.vcs.LineHandlerHelper - ():V - s:splitText(java.lang.String):java.util.List diff --git a/platform/vcs-impl/resources/META-INF/VcsExtensions.xml b/platform/vcs-impl/resources/META-INF/VcsExtensions.xml index ed22eb205897..c43cb345f590 100644 --- a/platform/vcs-impl/resources/META-INF/VcsExtensions.xml +++ b/platform/vcs-impl/resources/META-INF/VcsExtensions.xml @@ -12,7 +12,6 @@ - diff --git a/platform/vcs-impl/shared/BUILD.bazel b/platform/vcs-impl/shared/BUILD.bazel index 0b9893e6c167..c65103638aa4 100644 --- a/platform/vcs-impl/shared/BUILD.bazel +++ b/platform/vcs-impl/shared/BUILD.bazel @@ -24,6 +24,7 @@ jvm_library( "//platform/platform-impl/rpc", "//platform/diagnostic", "@lib//:opentelemetry", + "//platform/platform-impl:ide-impl", ], runtime_deps = [":shared_resources"] ) diff --git a/platform/vcs-impl/shared/api-dump-experimental.txt b/platform/vcs-impl/shared/api-dump-experimental.txt new file mode 100644 index 000000000000..f1fdbe526bc7 --- /dev/null +++ b/platform/vcs-impl/shared/api-dump-experimental.txt @@ -0,0 +1,2 @@ +*:com.intellij.openapi.vcs.LinkDescriptor +- a:getRange():com.intellij.openapi.util.TextRange diff --git a/platform/vcs-impl/shared/api-dump.txt b/platform/vcs-impl/shared/api-dump.txt index 0068f023f6b9..8cfde151cd04 100644 --- a/platform/vcs-impl/shared/api-dump.txt +++ b/platform/vcs-impl/shared/api-dump.txt @@ -1,3 +1,33 @@ +c:com.intellij.openapi.vcs.IssueNavigationConfiguration +- com.intellij.openapi.util.SimpleModificationTracker +- com.intellij.openapi.components.PersistentStateComponent +- ():V +- s:findIssueLinkMatches(java.lang.CharSequence,com.intellij.openapi.vcs.IssueNavigationLink,java.util.List):V +- findIssueLinks(java.lang.CharSequence):java.util.List +- s:getInstance(com.intellij.openapi.project.Project):com.intellij.openapi.vcs.IssueNavigationConfiguration +- getLinks():java.util.List +- getState():com.intellij.openapi.vcs.IssueNavigationConfiguration +- loadState(com.intellij.openapi.vcs.IssueNavigationConfiguration):V +- noStateLoaded():V +- s:processTextWithLinks(java.lang.String,java.util.List,java.util.function.Consumer,java.util.function.BiConsumer):V +- setLinks(java.util.List):V +c:com.intellij.openapi.vcs.IssueNavigationConfiguration$LinkMatch +- com.intellij.openapi.vcs.LinkDescriptor +- java.lang.Comparable +- (com.intellij.openapi.util.TextRange,java.lang.String):V +- compareTo(java.lang.Object):I +- getRange():com.intellij.openapi.util.TextRange +- getTargetUrl():java.lang.String +c:com.intellij.openapi.vcs.IssueNavigationLink +- ():V +- (java.lang.String,java.lang.String):V +- equals(java.lang.Object):Z +- getIssuePattern():java.util.regex.Pattern +- getIssueRegexp():java.lang.String +- getLinkRegexp():java.lang.String +- hashCode():I +- setIssueRegexp(java.lang.String):V +- setLinkRegexp(java.lang.String):V com.intellij.platform.vcs.impl.shared.changes.DiffPreviewUpdateProcessor - a:clear():V - a:getComponent():javax.swing.JComponent diff --git a/platform/vcs-impl/shared/intellij.platform.vcs.impl.shared.iml b/platform/vcs-impl/shared/intellij.platform.vcs.impl.shared.iml index ff243c27d064..51ff8d32b1af 100644 --- a/platform/vcs-impl/shared/intellij.platform.vcs.impl.shared.iml +++ b/platform/vcs-impl/shared/intellij.platform.vcs.impl.shared.iml @@ -45,5 +45,6 @@ + \ No newline at end of file diff --git a/platform/vcs-impl/shared/resources/intellij.platform.vcs.impl.shared.xml b/platform/vcs-impl/shared/resources/intellij.platform.vcs.impl.shared.xml index 443bf2f8fd30..8a30e9441930 100644 --- a/platform/vcs-impl/shared/resources/intellij.platform.vcs.impl.shared.xml +++ b/platform/vcs-impl/shared/resources/intellij.platform.vcs.impl.shared.xml @@ -1,4 +1,4 @@ - + @@ -6,5 +6,9 @@ + + + + diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/IssueNavigationConfiguration.java b/platform/vcs-impl/shared/src/com/intellij/openapi/vcs/IssueNavigationConfiguration.java similarity index 88% rename from platform/vcs-api/src/com/intellij/openapi/vcs/IssueNavigationConfiguration.java rename to platform/vcs-impl/shared/src/com/intellij/openapi/vcs/IssueNavigationConfiguration.java index 9cadf084e183..320c6be6961d 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/IssueNavigationConfiguration.java +++ b/platform/vcs-impl/shared/src/com/intellij/openapi/vcs/IssueNavigationConfiguration.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.vcs; @@ -13,6 +13,7 @@ import com.intellij.openapi.util.SimpleModificationTracker; import com.intellij.openapi.util.TextRange; import com.intellij.util.io.URLUtil; import com.intellij.util.xmlb.XmlSerializerUtil; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; @@ -25,10 +26,18 @@ import java.util.function.Consumer; import java.util.regex.Matcher; import java.util.regex.Pattern; - -@State(name = "IssueNavigationConfiguration", storages = @Storage("vcs.xml")) +/** + * Settings state is available both on frontend and backend. + * However, the synchronization direction is only backend -> frontend, which provides only read access on the frontend side. + * + * @see com.intellij.platform.vcs.impl.shared.VcsRemoteSettingsInfoProvider + */ +@State(name = IssueNavigationConfiguration.SETTINGS_KEY, storages = @Storage("vcs.xml")) public class IssueNavigationConfiguration extends SimpleModificationTracker implements PersistentStateComponent { + @ApiStatus.Internal + public static final String SETTINGS_KEY = "IssueNavigationConfiguration"; + private static final Logger LOG = Logger.getInstance(IssueNavigationConfiguration.class); public static IssueNavigationConfiguration getInstance(Project project) { @@ -56,6 +65,11 @@ public class IssueNavigationConfiguration extends SimpleModificationTracker XmlSerializerUtil.copyBean(state, this); } + @Override + public void noStateLoaded() { + loadState(new IssueNavigationConfiguration()); + } + public static class LinkMatch implements LinkDescriptor, Comparable { private final TextRange myRange; private final String myTargetUrl; diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/IssueNavigationLink.java b/platform/vcs-impl/shared/src/com/intellij/openapi/vcs/IssueNavigationLink.java similarity index 96% rename from platform/vcs-api/src/com/intellij/openapi/vcs/IssueNavigationLink.java rename to platform/vcs-impl/shared/src/com/intellij/openapi/vcs/IssueNavigationLink.java index de88c3d59ef6..f9515b3dc56d 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/IssueNavigationLink.java +++ b/platform/vcs-impl/shared/src/com/intellij/openapi/vcs/IssueNavigationLink.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.vcs; diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/LinkDescriptor.kt b/platform/vcs-impl/shared/src/com/intellij/openapi/vcs/LinkDescriptor.kt similarity index 85% rename from platform/vcs-api/src/com/intellij/openapi/vcs/LinkDescriptor.kt rename to platform/vcs-impl/shared/src/com/intellij/openapi/vcs/LinkDescriptor.kt index 86600a3b8a51..3f40b7c598aa 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/LinkDescriptor.kt +++ b/platform/vcs-impl/shared/src/com/intellij/openapi/vcs/LinkDescriptor.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.vcs import com.intellij.openapi.util.TextRange @@ -13,4 +13,4 @@ import org.jetbrains.annotations.ApiStatus @ApiStatus.Experimental interface LinkDescriptor { val range: TextRange -} +} \ No newline at end of file diff --git a/platform/vcs-impl/shared/src/com/intellij/platform/vcs/impl/shared/VcsRemoteSettingsInfoProvider.kt b/platform/vcs-impl/shared/src/com/intellij/platform/vcs/impl/shared/VcsRemoteSettingsInfoProvider.kt new file mode 100644 index 000000000000..5de134cbf115 --- /dev/null +++ b/platform/vcs-impl/shared/src/com/intellij/platform/vcs/impl/shared/VcsRemoteSettingsInfoProvider.kt @@ -0,0 +1,11 @@ +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.platform.vcs.impl.shared + +import com.intellij.ide.settings.RemoteSettingInfo +import com.intellij.ide.settings.RemoteSettingInfoProvider +import com.intellij.openapi.vcs.IssueNavigationConfiguration + +internal class VcsRemoteSettingsInfoProvider : RemoteSettingInfoProvider { + override fun getRemoteSettingsInfo(): Map = + mapOf(IssueNavigationConfiguration.SETTINGS_KEY to RemoteSettingInfo(RemoteSettingInfo.Direction.OnlyFromBackend)) +} \ No newline at end of file diff --git a/plugins/kotlin/idea/tests/BUILD.bazel b/plugins/kotlin/idea/tests/BUILD.bazel index 45a84e990ffa..3fe8ceb24494 100644 --- a/plugins/kotlin/idea/tests/BUILD.bazel +++ b/plugins/kotlin/idea/tests/BUILD.bazel @@ -40,6 +40,7 @@ jvm_library( "@lib//:fastutil-min", "//platform/usageView-impl", "//platform/vcs-api:vcs", + "//platform/vcs-impl/shared", "//platform/workspace/storage", "//plugins/kotlin/plugin/k1", "//plugins/kotlin/code-insight/api", diff --git a/plugins/kotlin/idea/tests/kotlin.idea.tests.iml b/plugins/kotlin/idea/tests/kotlin.idea.tests.iml index 991342f1f3b8..78583afb2bc7 100644 --- a/plugins/kotlin/idea/tests/kotlin.idea.tests.iml +++ b/plugins/kotlin/idea/tests/kotlin.idea.tests.iml @@ -40,6 +40,7 @@ +