forked from JetBrains/intellij-bsp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* no targets test * DocumentIdToTargetsIdsMapDelegate impl * blackbox testing * magic model -> magic meta model * directry sources support * test * should map multiple files in multiple directories to multiple targets including file based targets test * file based sources tests refactor * directory based sources tests refactor * file and directory based sources tests refactor * URI toAbsolutePath extension * targets parameter * DocumentTargetsDetails introduction * TargetsDetailsForDocumentProvider * test rename * TargetsDetailsForDocumentProvider internal * TargetsDetailsForDocument extraction * OverlappingTargetsGraphDelegate init * OverlappingTargetsGraph impl * TargetsDetailsForDocumentProviderGetTargetsDetailsForDocumentTest name update * display names in tests * targetsDetailsForDocumentProvider.getAllDocumentsTest() tests * interface extraction * code reformat * interface update * NonOverlappingTargetsDelegate impl * interface update * WorkspaceModelTestMockImpl init * tests fix * WorkspaceEntityStorageBuilderTestMockImpl update * interface update * .targets removal * getAllLoadedTargets, getAllNotLoadedTargets, loadDefaultTargets tests * .loadTarget * .loadDefaultTargets update * .getTargetsDetailsForDocument * little up * .create() * visibility update * real flow tests * .reduceSets() extension * javadoc * readme * new lines v1 * MagicMetaModel * readme * MagicMetaModelImpl * NonOverlappingTargetsDelegate * OverlappingTargetsGraph * TargetsDetailsForDocument * tests * linter * changelog update * imports * gradle cleanup * linter * fixxx * pluginnnn * github action update
- Loading branch information
Showing
38 changed files
with
3,049 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[*] | ||
indent_style=space | ||
indent_size=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# Build Server Protocol for IntelliJ IDEA | ||
|
||
<!-- Plugin description --> | ||
Build Server Protocol | ||
|
||
!! WORK IN PROGRESS !! | ||
|
||
!! WORK IN PROGRESS !! | ||
<!-- Plugin description end --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
kotlin { | ||
explicitApi() | ||
} |
86 changes: 86 additions & 0 deletions
86
magicmetamodel/src/main/kotlin/org/jetbrains/magicmetamodel/MagicMetaModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package org.jetbrains.magicmetamodel | ||
|
||
import ch.epfl.scala.bsp4j.BuildTarget | ||
import ch.epfl.scala.bsp4j.BuildTargetIdentifier | ||
import ch.epfl.scala.bsp4j.SourcesItem | ||
import ch.epfl.scala.bsp4j.TextDocumentIdentifier | ||
import com.intellij.openapi.diagnostic.debug | ||
import com.intellij.openapi.diagnostic.logger | ||
import com.intellij.workspaceModel.ide.WorkspaceModel | ||
import org.jetbrains.magicmetamodel.impl.MagicMetaModelImpl | ||
|
||
/** | ||
* Contains information about loaded target and not loaded targets for given document. | ||
* | ||
* @see [MagicMetaModel.getTargetsDetailsForDocument] | ||
*/ | ||
public data class DocumentTargetsDetails( | ||
public val loadedTargetId: BuildTargetIdentifier?, | ||
public val notLoadedTargetsIds: List<BuildTargetIdentifier>, | ||
) | ||
|
||
/** | ||
* Provides operations on model entries. | ||
* | ||
* The main reason for its existence is the integration of the model obtained from | ||
* the BSP containing shared sources and [WorkspaceModel]. | ||
*/ | ||
public interface MagicMetaModel { | ||
|
||
/** | ||
* Loads default targets to the model - can be all targets, can be subset of them. | ||
* | ||
* If the project contains shared sources, the loaded targets should not share sources. | ||
* For example, if there are :target1 and :target2 that have the same sources, *only one of them* could be loaded. | ||
* | ||
* Requires write action if used with [WorkspaceModel]. | ||
*/ | ||
public fun loadDefaultTargets() | ||
|
||
/** | ||
* Loads given target. | ||
* | ||
* If the project contains shared sources, all "overlapping" targets should be unloaded. | ||
* For example, if there are :target1 and :target2 that have the same sources, | ||
* and :target1 is currently loaded and :target2 is loaded then after this call *:target1 should no longer be loaded*. | ||
* | ||
* Requires write action if used with [WorkspaceModel]. | ||
*/ | ||
public fun loadTarget(targetId: BuildTargetIdentifier) | ||
|
||
/** | ||
* Get targets details for given document. | ||
* | ||
* The response contains a loaded target that contains the document, | ||
* or null if no loaded target contains the document. | ||
* The response also contains unloaded targets that contain the document. | ||
*/ | ||
public fun getTargetsDetailsForDocument(documentId: TextDocumentIdentifier): DocumentTargetsDetails | ||
|
||
/** | ||
* Get all currently loaded targets. | ||
*/ | ||
public fun getAllLoadedTargets(): List<BuildTarget> | ||
|
||
/** | ||
* Get all currently not loaded targets. | ||
*/ | ||
public fun getAllNotLoadedTargets(): List<BuildTarget> | ||
|
||
public companion object { | ||
private val LOGGER = logger<MagicMetaModel>() | ||
|
||
/** | ||
* Create instance of [MagicMetaModelImpl] which supports shared sources | ||
* provided by the BSP and works on top of [WorkspaceModel]. | ||
*/ | ||
public fun create( | ||
workspaceModel: WorkspaceModel, | ||
targets: List<BuildTarget>, | ||
sources: List<SourcesItem>, | ||
): MagicMetaModel { | ||
LOGGER.debug { "Creating MagicMetaModelImpl for $workspaceModel, $targets. $sources..." } | ||
return MagicMetaModelImpl(workspaceModel, targets, sources) | ||
} | ||
} | ||
} |
Oops, something went wrong.