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.
[maintenance]
BuildTargetClassifierExtension
uses WithBuildToolId
…
… api now default impl default removal rebase fix Merge remote-tracking branch 'origin/main' into abrams/target-classifier-ep # Conflicts: # src/main/kotlin/org/jetbrains/plugins/bsp/extension/points/BspBuildTargetClassifierExtension.kt # src/main/resources/META-INF/plugin.xml Merge remote-tracking branch 'origin/main' into abrams/target-classifier-ep # Conflicts: # src/main/kotlin/org/jetbrains/plugins/bsp/config/PersistentProjectProperties.kt # src/main/kotlin/org/jetbrains/plugins/bsp/extension/points/WithBuildToolId.kt # src/main/kotlin/org/jetbrains/plugins/bsp/ui/widgets/tool/window/components/BuildTargetTree.kt [maintenance] `BuildTargetClassifierExtension` update [maintenance] `WithBuildToolId` moved to a better location Merge-request: BAZEL-MR-672 Merged-by: Marcin Abramowicz <[email protected]>
- Loading branch information
1 parent
6e78a87
commit 38f151b
Showing
6 changed files
with
88 additions
and
100 deletions.
There are no files selected for viewing
15 changes: 0 additions & 15 deletions
15
...in/kotlin/org/jetbrains/plugins/bsp/extension/points/BspBuildTargetClassifierExtension.kt
This file was deleted.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
src/main/kotlin/org/jetbrains/plugins/bsp/extension/points/BuildTargetClassifierExtension.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,65 @@ | ||
package org.jetbrains.plugins.bsp.extension.points | ||
|
||
import com.intellij.openapi.extensions.ExtensionPointName | ||
import org.jetbrains.magicmetamodel.impl.workspacemodel.BuildTargetId | ||
|
||
public interface BuildTargetClassifierExtension : WithBuildToolId { | ||
/** | ||
* Sets a separator for chaining target directories. Example: | ||
* ``` | ||
* aaa | ||
* | bbb | ||
* | ccc | ||
* | ddd | ||
* | eee | ||
* | BUILD_TARGET | ||
* ``` | ||
* If the separator is set (for example to "+_"), the tree above will be rendered as: | ||
* ``` | ||
* aaa | ||
* | bbb | ||
* | ccc+_ddd+_eee | ||
* | BUILD_TARGET | ||
* ``` | ||
* This affects only directories with just one child, this child being another directory | ||
*/ | ||
public val separator: String? | ||
|
||
/** | ||
* @param buildTargetIdentifier a build target | ||
* @return list of directories corresponding to a desired path of the given build target in the tree. | ||
* For example, path `["aaa", "bbb"]` will render as: | ||
* ``` | ||
* aaa | ||
* | bbb | ||
* | <buildTarget> | ||
* ``` | ||
* If an empty list is returned, the build target will be rendered in the tree's top level | ||
*/ | ||
public fun calculateBuildTargetPath(buildTargetIdentifier: BuildTargetId): List<String> | ||
|
||
/** | ||
* @param buildTargetIdentifier a build target | ||
* @return the name under which the given build target will be rendered in the tree | ||
*/ | ||
public fun calculateBuildTargetName(buildTargetIdentifier: BuildTargetId): String | ||
|
||
public companion object { | ||
internal val ep = | ||
ExtensionPointName.create<BuildTargetClassifierExtension>("org.jetbrains.bsp.buildTargetClassifierExtension") | ||
} | ||
} | ||
|
||
/** | ||
* Default implementation of the [BuildTargetClassifierExtension] interface. | ||
* It will be used in BSP project and when no other implementation exists. | ||
*/ | ||
internal class DefaultBuildTargetClassifierExtension : BuildTargetClassifierExtension { | ||
override val buildToolId: BuildToolId = bspBuildToolId | ||
|
||
override val separator: String? = null | ||
|
||
override fun calculateBuildTargetPath(buildTargetIdentifier: BuildTargetId): List<String> = emptyList() | ||
|
||
override fun calculateBuildTargetName(buildTargetIdentifier: BuildTargetId): String = buildTargetIdentifier | ||
} |
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
66 changes: 0 additions & 66 deletions
66
...kotlin/org/jetbrains/plugins/bsp/ui/widgets/tool/window/utils/BspBuildTargetClassifier.kt
This file was deleted.
Oops, something went wrong.
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