Skip to content

Commit 9b5c311

Browse files
committed
Initial support for 243
1 parent 353e003 commit 9b5c311

File tree

12 files changed

+97
-17
lines changed

12 files changed

+97
-17
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: [ 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ 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: [ 243 ]
8686
# it's enough to verify plugin structure only once per platform version
8787
verify-plugin: [ false ]
8888
default-edition-for-tests: [ 2021 ]
8989
include:
9090
- os: ubuntu-latest
9191
rust-version: ${{ needs.get-rust-versions.outputs.old }}
9292
base-ide: IU
93-
platform-version: 241
93+
platform-version: 243
9494
verify-plugin: true
9595
default-edition-for-tests: 2021
9696

build.gradle.kts

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ val ideToRun = prop("ideToRun").ifEmpty { baseIDE }
2626
val ideaVersion = prop("ideaVersion")
2727
val baseVersion = versionForIde(baseIDE)
2828
val baseVersionForRun = versionForIde(ideToRun)
29+
val useInstaller = !baseVersion.contains("-EAP-")
2930

3031
val tomlPlugin: String by project
3132
val graziePlugin: String by project
@@ -34,6 +35,7 @@ val copyrightPlugin = "com.intellij.copyright"
3435
val javaPlugin = "com.intellij.java"
3536
val javaIdePlugin = "com.intellij.java.ide"
3637
val javaScriptPlugin = "JavaScript"
38+
val jsonPlugin = "com.intellij.modules.json"
3739
val mlCompletionPlugin = "com.intellij.completion.ml.ranking"
3840

3941
val compileNativeCodeTaskName = "compileNativeCode"
@@ -72,6 +74,9 @@ allprojects {
7274
mavenCentral()
7375
intellijPlatform {
7476
defaultRepositories()
77+
if (!useInstaller) {
78+
jetbrainsRuntime()
79+
}
7580
}
7681
}
7782

@@ -192,10 +197,18 @@ allprojects {
192197

193198
dependencies {
194199
intellijPlatform {
195-
create(baseIDE, baseVersion)
200+
create(baseIDE, baseVersion, useInstaller)
201+
if (!useInstaller) {
202+
jetbrainsRuntime()
203+
}
196204

197205
pluginVerifier()
198206
instrumentationTools()
207+
// BACKCOMPAT: 2024.2. Always include jsonPlugin.
208+
// Also move rust-toml.xml with explicit dependency on JSON plugin back to src.
209+
if (baseVersion.startsWith("243.") || baseVersion.startsWith("2024.3")) {
210+
bundledPlugin(jsonPlugin)
211+
}
199212

200213
// used in MacroExpansionManager.kt and ResolveCommonThreadPool.kt
201214
testFramework(TestFrameworkType.Platform, configurationName = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES)
@@ -304,7 +317,10 @@ project(":plugin") {
304317
javaPlugin,
305318
)
306319
}
307-
create(baseIDE, baseVersionForRun)
320+
create(baseIDE, baseVersionForRun, useInstaller)
321+
if (!useInstaller) {
322+
jetbrainsRuntime()
323+
}
308324
plugins(pluginList)
309325
bundledPlugins(bundledPluginList)
310326

@@ -474,7 +490,10 @@ project(":") {
474490
project(":idea") {
475491
dependencies {
476492
intellijPlatform {
477-
create(baseIDE, baseVersion)
493+
create(baseIDE, baseVersion, useInstaller)
494+
if (!useInstaller) {
495+
jetbrainsRuntime()
496+
}
478497

479498
bundledPlugins(listOf(
480499
javaPlugin,
@@ -491,7 +510,10 @@ project(":idea") {
491510
project(":copyright") {
492511
dependencies {
493512
intellijPlatform {
494-
create(baseIDE, baseVersion)
513+
create(baseIDE, baseVersion, useInstaller)
514+
if (!useInstaller) {
515+
jetbrainsRuntime()
516+
}
495517

496518
bundledPlugins(listOf(copyrightPlugin))
497519
}

gradle-243.properties

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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=2024.3.1
5+
6+
# https://plugins.jetbrains.com/plugin/8195-toml/versions
7+
tomlPlugin=org.toml.lang:243.21565.122
8+
# https://plugins.jetbrains.com/plugin/12175-grazie-lite/versions
9+
graziePlugin=tanvd.grazi:243.19420.33
10+
# https://plugins.jetbrains.com/plugin/227-psiviewer/versions
11+
psiViewerPlugin=PsiViewer:243.7768
12+
13+
# please see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description
14+
sinceBuild=243
15+
untilBuild=243.*

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
propertiesPluginEnvironmentNameProperty=platformVersion
2-
# Supported platforms: 241, 242
3-
platformVersion=242
2+
# Supported platforms: 241, 242, 243
3+
platformVersion=243
44
# Supported IDEs: IU
55
baseIDE=IU
66
ideToRun=

js/src/main/kotlin/org/rust/js/RsWasmBindgenLineMarkerProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import com.intellij.openapi.vfs.LocalFileSystem
2020
import com.intellij.psi.PsiElement
2121
import com.intellij.psi.PsiFile
2222
import com.intellij.psi.PsiManager
23-
import icons.JavaScriptPsiIcons
23+
import icons.JavaScriptCoreIcons
2424
import org.rust.RsBundle
2525
import org.rust.lang.core.psi.*
2626
import org.rust.lang.core.psi.ext.*
@@ -32,7 +32,7 @@ import javax.swing.Icon
3232
class RsWasmBindgenLineMarkerProvider : RelatedItemLineMarkerProvider() {
3333

3434
override fun getName(): String = RsBundle.message("gutter.rust.generated.typescript.declarations.name")
35-
override fun getIcon(): Icon = JavaScriptPsiIcons.FileTypes.TypeScriptFile
35+
override fun getIcon(): Icon = JavaScriptCoreIcons.FileTypes.TypeScriptFile
3636

3737
override fun getLineMarkerInfo(element: PsiElement): RelatedItemLineMarkerInfo<*>? {
3838
val element = element as? RsOuterAttributeOwner ?: return null
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/cargo/runconfig/buildtool/RsBuildTaskProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ abstract class RsBuildTaskProvider<T : RsBuildTaskProvider.BuildTask<T>> : Befor
2828

2929
val result = CompletableFuture<Boolean>()
3030
ProjectTaskManager.getInstance(environment.project).build(buildableElement).onProcessed {
31-
result.complete(!it.hasErrors() && !it.isAborted)
31+
result.complete(it != null && !it.hasErrors() && !it.isAborted)
3232
}
3333
return result.get()
3434
}

src/main/kotlin/org/rust/ide/module/RsModuleBuilder.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package org.rust.ide.module
77

8-
import com.intellij.ide.NewProjectWizardLegacy
98
import com.intellij.ide.util.projectWizard.ModuleBuilder
109
import com.intellij.ide.util.projectWizard.ModuleWizardStep
1110
import com.intellij.ide.util.projectWizard.WizardContext
@@ -32,9 +31,9 @@ class RsModuleBuilder : ModuleBuilder() {
3231

3332
override fun getModuleType(): ModuleType<*> = RsModuleType.INSTANCE
3433

35-
override fun isSuitableSdkType(sdkType: SdkTypeId?): Boolean = true
34+
override fun isSuitableSdkType(sdkType: SdkTypeId): Boolean = true
3635

37-
override fun isAvailable(): Boolean = NewProjectWizardLegacy.isAvailable()
36+
override fun isAvailable(): Boolean = false
3837

3938
override fun getCustomOptionsStep(context: WizardContext, parentDisposable: Disposable): ModuleWizardStep =
4039
CargoConfigurationWizardStep(context).apply {

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"/>

src/test/kotlin/org/rust/cargo/project/model/impl/CargoTomlWatcherTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class CargoTomlWatcherTest : RsTestBase() {
121121
private fun newCreateEvent(name: String, requestor: Any? = null): Pair<VirtualFile, VFileCreateEvent> {
122122
val vFile = myFixture.tempDirFixture.createFile("proj/$name")
123123
@Suppress("UnstableApiUsage")
124-
return vFile to VFileCreateEvent(requestor, vFile.parent, vFile.name, false, null, null, true, null)
124+
return vFile to VFileCreateEvent(requestor, vFile.parent, vFile.name, false, null, null, null)
125125
}
126126

127127
private fun newChangeEvent(vFile: VirtualFile, requestor: Any? = null): VFileContentChangeEvent =

src/test/kotlin/org/rust/ide/console/RsConsoleFoldingTestBase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ abstract class RsConsoleFoldingTestBase : RsTestBase() {
4242
console.print(input, ConsoleViewContentType.NORMAL_OUTPUT)
4343
console.flushDeferredText()
4444

45-
val editor = console.editor
45+
val editor = console.editor!!
4646
val regions = editor.foldingModel.allFoldRegions
4747

4848
val expectedText = renderTextWithFolds(input, expectedFolds)

0 commit comments

Comments
 (0)