Skip to content

Commit 2cbca1c

Browse files
committed
Initial support for 243
1 parent 9f9880f commit 2cbca1c

File tree

8 files changed

+76
-7
lines changed

8 files changed

+76
-7
lines changed

.github/workflows/build-plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
strategy:
2929
fail-fast: true
3030
matrix:
31-
platform-version: [ 241, 242 ]
31+
platform-version: [ 241, 242, 243 ]
3232
env:
3333
ORG_GRADLE_PROJECT_buildNumber: ${{ needs.generate-build-number.outputs.build_number }}
3434
ORG_GRADLE_PROJECT_platformVersion: ${{ matrix.platform-version }}

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
# Make sequence from two outputs with version is not possible here.
8383
rust-version: ${{ fromJSON(needs.get-rust-versions.outputs.matrix) }}
8484
base-ide: [ IU ]
85-
platform-version: [ 241, 242 ]
85+
platform-version: [ 241, 242, 243 ]
8686
# it's enough to verify plugin structure only once per platform version
8787
verify-plugin: [ false ]
8888
default-edition-for-tests: [ 2021 ]

build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ val copyrightPlugin: String by project
3434
val javaPlugin = "com.intellij.java"
3535
val javaIdePlugin = "com.intellij.java.ide"
3636
val javaScriptPlugin = "JavaScript"
37+
val jsonPlugin = "com.intellij.modules.json"
3738
val mlCompletionPlugin = "com.intellij.completion.ml.ranking"
3839

3940
val compileNativeCodeTaskName = "compileNativeCode"
@@ -196,6 +197,11 @@ allprojects {
196197

197198
pluginVerifier()
198199
instrumentationTools()
200+
// BACKCOMPAT: 2024.2. Always include jsonPlugin.
201+
// Also move rust-toml.xml with explicit dependency on JSON plugin back to src.
202+
if (baseVersion.startsWith("243.") || baseVersion.startsWith("2024.3")) {
203+
bundledPlugin(jsonPlugin)
204+
}
199205

200206
// used in MacroExpansionManager.kt and ResolveCommonThreadPool.kt
201207
testFramework(TestFrameworkType.Platform, configurationName = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES)

gradle-243.properties

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Existent IDE versions can be found in the following repos:
2+
# https://www.jetbrains.com/intellij-repository/releases/
3+
# https://www.jetbrains.com/intellij-repository/snapshots/
4+
ideaVersion=243.12818.47
5+
6+
# https://plugins.jetbrains.com/plugin/8195-toml/versions
7+
tomlPlugin=org.toml.lang:243.12818.56
8+
# https://plugins.jetbrains.com/plugin/12175-grazie-lite/versions
9+
graziePlugin=tanvd.grazi:242.20224.155
10+
# https://plugins.jetbrains.com/plugin/227-psiviewer/versions
11+
psiViewerPlugin=PsiViewer:243.7768
12+
# https://plugins.jetbrains.com/plugin/13114-copyright/versions
13+
copyrightPlugin=com.intellij.copyright:242.20224.237
14+
15+
# please see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description
16+
sinceBuild=243
17+
untilBuild=243.*

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
propertiesPluginEnvironmentNameProperty=platformVersion
2-
# Supported platforms: 241, 242
2+
# Supported platforms: 241, 242, 243
33
platformVersion=242
44
# Supported IDEs: IU
55
baseIDE=IU
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Use of this source code is governed by the MIT license that can be
3+
* found in the LICENSE file.
4+
*/
5+
6+
package org.rust
7+
8+
import com.intellij.ide.util.treeView.smartTree.Sorter
9+
import com.intellij.openapi.actionSystem.DataContext
10+
import com.intellij.platform.navbar.NavBarItemPresentationData
11+
import com.intellij.platform.navbar.backend.NavBarItem
12+
import com.intellij.platform.navbar.backend.impl.pathToItem
13+
import com.intellij.util.concurrency.annotations.RequiresReadLock
14+
import org.jetbrains.annotations.TestOnly
15+
16+
// BACKCOMPAT 2024.1: use directly in RsCombinedVisibilityAlphaSorterTest
17+
val alphaSorterId = Sorter.getAlphaSorterId()
18+
19+
// BACKCOMPAT 2024.1: move to RsNavBarTest
20+
@Suppress("UnstableApiUsage")
21+
@TestOnly
22+
@RequiresReadLock
23+
fun contextNavBarPathStrings(ctx: DataContext): List<String> {
24+
// Navigation bar implementation was split into several modules, which made `navbar.testFramework` test scope only.
25+
//
26+
// See https://youtrack.jetbrains.com/issue/IJPL-850/Split-navigation-bar-implementation-into-several-modules,
27+
// https://github.com/JetBrains/intellij-community/commit/a9e1406257b330d17d2a3f78f47b2d2113eca97c and
28+
// https://github.com/JetBrains/intellij-community/commit/bfa6619891699658f86a7bf8bdf7726a67bc6efd
29+
30+
// Code copied from [platform/navbar/testFramework/src/testFramework.kt](https://github.com/JetBrains/intellij-community/blob/d161fd043392998e10c4551df92634dbda5a06b5/platform/navbar/testFramework/src/testFramework.kt#L34).
31+
val contextItem = NavBarItem.NAVBAR_ITEM_KEY.getData(ctx)
32+
?.dereference()
33+
?: return emptyList()
34+
return contextItem.pathToItem().map {
35+
(it.presentation() as NavBarItemPresentationData).text
36+
}
37+
}
38+
39+
// BACKCOMPAT 2024.1: unwrap to contextNavBarPathStrings
40+
fun contextNavBarPathStringsCompat(ctx: DataContext): List<String> {
41+
return contextNavBarPathStrings(ctx)
42+
}

src/main/kotlin/org/rust/ide/newProject/RsProjectGeneratorPeer.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ class RsProjectGeneratorPeer(cargoProjectDir: Path = Paths.get(".")) : Generator
2222

2323
override fun getSettings(): ConfigurationData = newProjectPanel.data
2424

25-
override fun getComponent(myLocationField: TextFieldWithBrowseButton, checkValid: Runnable): JComponent {
26-
this.checkValid = checkValid
27-
return super.getComponent(myLocationField, checkValid)
28-
}
25+
// BACKCOMPAT: 2024.3 EAP. Restore later.
26+
// https://github.com/JetBrains/intellij-community/commit/d1635e67b01e4448ab8b4abb923321296147a40b
27+
// override fun getComponent(myLocationField: TextFieldWithBrowseButton, checkValid: Runnable): JComponent {
28+
// this.checkValid = checkValid
29+
// return super.getComponent(myLocationField, checkValid)
30+
// }
2931

3032
override fun getComponent(): JComponent = panel {
3133
newProjectPanel.attachTo(this)

src/main/resources/META-INF/rust-toml.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<idea-plugin>
2+
<depends>com.intellij.modules.json</depends>
3+
24
<extensions defaultExtensionNs="com.intellij">
35
<psi.referenceContributor language="TOML"
46
implementation="org.rust.toml.resolve.CargoTomlReferenceContributor"/>

0 commit comments

Comments
 (0)