[lvcs] extract idea gateway API (IJPL-161713)

GitOrigin-RevId: 6e7944d2f7cec28c950a669b00a057f73cf927ca
This commit is contained in:
Dmitry Zhuravlev
2024-09-09 17:37:23 +02:00
committed by intellij-monorepo-bot
parent 05c79ef42f
commit d90f879649
4 changed files with 8 additions and 1 deletions

View File

@@ -436,6 +436,7 @@ c:com.intellij.history.integration.IdeaGateway
- findVirtualFile(java.lang.String):com.intellij.openapi.vfs.VirtualFile
- getDocument(java.lang.String):com.intellij.openapi.editor.Document
- getFileType(java.lang.String):com.intellij.openapi.fileTypes.FileType
- s:getInstance():com.intellij.history.integration.IdeaGateway
- s:getNameOrUrlPart(com.intellij.openapi.vfs.VirtualFile):java.lang.String
- getPathOrUrl(com.intellij.openapi.vfs.VirtualFile):java.lang.String
- ps:getVersionedFilterData():com.intellij.history.integration.IdeaGateway$VersionedFilterData

View File

@@ -82,6 +82,7 @@
<applicationService serviceInterface="com.intellij.history.LocalHistory"
serviceImplementation="com.intellij.history.integration.LocalHistoryImpl"/>
<applicationService serviceImplementation="com.intellij.history.core.LocalHistoryFacade"/>
<applicationService serviceImplementation="com.intellij.history.integration.IdeaGateway"/>
<virtualFileManagerListener
implementation="com.intellij.history.integration.LocalHistoryEventDispatcher$LocalHistoryFileManagerListener"/>

View File

@@ -48,6 +48,10 @@ public class IdeaGateway {
private static final Key<ContentAndTimestamps> SAVED_DOCUMENT_CONTENT_AND_STAMP_KEY
= Key.create("LocalHistory.SAVED_DOCUMENT_CONTENT_AND_STAMP_KEY");
public static @NotNull IdeaGateway getInstance() {
return ApplicationManager.getApplication().getService(IdeaGateway.class);
}
public boolean isVersioned(@NotNull VirtualFile f) {
return isVersioned(f, false);
}

View File

@@ -39,6 +39,7 @@ class LocalHistoryImpl(private val coroutineScope: CoroutineScope) : LocalHistor
/**
* @see [LocalHistory.getInstance]
* @see [LocalHistoryFacade.getInstance]
* @see [IdeaGateway.getInstance]
*/
@JvmStatic
fun getInstanceImpl(): LocalHistoryImpl = getInstance() as LocalHistoryImpl
@@ -54,7 +55,7 @@ class LocalHistoryImpl(private val coroutineScope: CoroutineScope) : LocalHistor
var facade: LocalHistoryFacade? = null
private set
val gateway: IdeaGateway = IdeaGateway()
val gateway: IdeaGateway = IdeaGateway.getInstance()
private var flusherTask: Job? = null
private val initialFlush = AtomicBoolean(true)