Skip to content

Commit 85a2dcb

Browse files
DmPanovintellij-monorepo-bot
authored andcommitted
Revert "[graphql] WEB-64772 migrate libraries to a new project model"
This reverts commit 6e4ed1579bc2c900b784aaec8669ee5cc83a303c. GitOrigin-RevId: f33998d664b2725d1e0890a21e6d90fac96e2645
1 parent 0baa2a9 commit 85a2dcb

File tree

40 files changed

+431
-932
lines changed

40 files changed

+431
-932
lines changed

intellij.graphql.iml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
77
<sourceFolder url="file://$MODULE_DIR$/src/main" isTestSource="false" />
88
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
9-
<sourceFolder url="file://$MODULE_DIR$/src/gen" isTestSource="false" generated="true" />
109
<excludeFolder url="file://$MODULE_DIR$/build" />
1110
</content>
1211
<orderEntry type="inheritedJdk" />

javascript/src/com/intellij/graphql/javascript/workspace/GraphQLNodeModulesIndexContributor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class GraphQLNodeModulesIndexContributor : WorkspaceFileIndexContributor<GraphQL
1111

1212
override fun registerFileSets(entity: GraphQLNodeModulesEntity, registrar: WorkspaceFileSetRegistrar, storage: EntityStorage) {
1313
entity.roots.forEach {
14-
registrar.registerFileSet(it, WorkspaceFileKind.EXTERNAL_SOURCE, entity, GraphQLNodeModulesSourceRootData())
14+
registrar.registerFileSet(it, WorkspaceFileKind.EXTERNAL_SOURCE, entity, GraphQLSourceRootFileSetData())
1515
}
1616
}
1717
}

javascript/src/com/intellij/graphql/javascript/workspace/GraphQLNodeModulesLibraryUpdater.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import com.intellij.lang.jsgraphql.ide.config.model.GraphQLSchemaPointer
66
import com.intellij.openapi.application.ApplicationManager
77
import com.intellij.openapi.components.Service
88
import com.intellij.openapi.components.service
9-
import com.intellij.openapi.components.serviceAsync
109
import com.intellij.openapi.project.Project
1110
import com.intellij.openapi.vfs.VfsUtil
1211
import com.intellij.openapi.vfs.VirtualFileManager
@@ -24,10 +23,12 @@ class GraphQLNodeModulesLibraryUpdater(private val project: Project, @VisibleFor
2423
private val lock = ReentrantLock()
2524
private val roots = mutableSetOf<String>() // lock
2625

26+
private val configProvider = GraphQLConfigProvider.getInstance(project)
27+
2728
fun updateNodeModulesEntity() {
2829
cs.launch {
2930
val prevRoots = lock.withLock { roots.toSet() }
30-
val newRoots = GraphQLConfigProvider.getInstance(project).getAllConfigs(true)
31+
val newRoots = configProvider.getAllConfigs(true)
3132
.asSequence()
3233
.flatMap { it.getProjects().values }
3334
.flatMap { config ->
@@ -57,14 +58,13 @@ class GraphQLNodeModulesLibraryUpdater(private val project: Project, @VisibleFor
5758
}
5859

5960
private suspend fun attachEntity(roots: Collection<String>) {
60-
val workspaceModel = project.serviceAsync<WorkspaceModel>()
61-
val virtualFileUrlManager = workspaceModel.getVirtualFileUrlManager()
61+
val virtualFileUrlManager = WorkspaceModel.getInstance(project).getVirtualFileUrlManager()
6262
val rootUrls = roots.mapTo(mutableSetOf()) { virtualFileUrlManager.getOrCreateFromUrl(it) }
6363
val newModulesEntity = GraphQLNodeModulesEntity(rootUrls, GraphQLNodeModulesEntitySource)
6464
val entityStorage = MutableEntityStorage.create().apply {
6565
addEntity(newModulesEntity)
6666
}
67-
workspaceModel.update("Attach GraphQL node modules") { storage ->
67+
WorkspaceModel.getInstance(project).update("Attach GraphQL node modules") { storage ->
6868
storage.replaceBySource({ it is GraphQLNodeModulesEntitySource }, entityStorage)
6969
}
7070
}

javascript/src/com/intellij/graphql/javascript/workspace/GraphQLNodeModulesSourceRootData.kt renamed to javascript/src/com/intellij/graphql/javascript/workspace/GraphQLSourceRootFileSetData.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ package com.intellij.graphql.javascript.workspace
22

33
import com.intellij.workspaceModel.core.fileIndex.impl.ModuleOrLibrarySourceRootData
44

5-
internal class GraphQLNodeModulesSourceRootData : ModuleOrLibrarySourceRootData
5+
internal class GraphQLSourceRootFileSetData : ModuleOrLibrarySourceRootData

resources/META-INF/plugin.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,9 @@
105105
<fileBasedIndex implementation="com.intellij.lang.jsgraphql.ide.indexing.GraphQLFragmentNameIndex"/>
106106
<fileBasedIndex implementation="com.intellij.lang.jsgraphql.ide.indexing.GraphQLInjectionIndex"/>
107107

108-
<workspaceModel.fileIndexContributor implementation="com.intellij.lang.jsgraphql.schema.library.GraphQLLibraryIndexContributor"/>
109-
<projectView.externalLibraries.workspaceModelNodesProvider
110-
implementation="com.intellij.lang.jsgraphql.schema.library.GraphQLLibraryWorkspaceModelNodesProvider"/>
111-
112108
<indexedRootsProvider
113109
implementation="com.intellij.lang.jsgraphql.ide.introspection.indexing.GraphQLIntrospectionIndexableSetContributor"/>
110+
<additionalLibraryRootsProvider implementation="com.intellij.lang.jsgraphql.schema.library.GraphQLLibraryRootsProvider"/>
114111

115112
<!-- Startup -->
116113
<postStartupActivity implementation="com.intellij.lang.jsgraphql.ide.startup.GraphQLStartupActivity"/>

resources/messages/GraphQLBundle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ graphql.settings.introspection=Introspection
179179
graphql.settings.introspection.open.editor.label=Open introspection results in the editor
180180

181181
# Libraries
182-
graphql.library.prefix=GraphQL: {0}
182+
graphql.library.prefix=GraphQL:
183183
graphql.library.built.in=Specification
184184
graphql.library.relay=Relay
185185
graphql.library.federation=Federation

src/gen/com/intellij/lang/jsgraphql/schema/library/impl/GraphQLLibraryEntityImpl.kt

Lines changed: 0 additions & 299 deletions
This file was deleted.

0 commit comments

Comments
 (0)