Skip to content

Commit a64e365

Browse files
committed
docs(docs): add documentation for configuring new language support
This commit adds documentation for configuring new language support in JetBrains' IDE. It explains how to configure the plugin in Gradle script and provides examples for Rust configuration. It also includes information on different versions of the Rust IDE plugin and their corresponding plugin versions.
1 parent 3e0c992 commit a64e365

File tree

1 file changed

+126
-0
lines changed

1 file changed

+126
-0
lines changed

docs/development/dev-new-language.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
layout: default
3+
title: Dev New Language
4+
nav_order: 20
5+
parent: Development
6+
---
7+
8+
In JetBrains' IDE, some language support is not good enough, and some language support is not available at all.
9+
10+
- Good enough language will have IDE support, like golang with GoLand.
11+
- Not good enough language will have no IDE support, like Rust with CLion (before RustRover)
12+
13+
So, we need to configure plugin for the language
14+
15+
## Debug Config
16+
17+
for Debug, We already run configs under `.idea/runConfigurations`, so we can just copy and modify them.
18+
19+
Here are some examples [RustRust.xml] :
20+
21+
```xml
22+
<component name="ProjectRunConfigurationManager">
23+
<configuration default="false" name="Run Rust" type="GradleRunConfiguration" factoryName="Gradle">
24+
<ExternalSystemSettings>
25+
<option name="executionName" />
26+
<option name="externalProjectPath" value="$PROJECT_DIR$" />
27+
<option name="externalSystemIdString" value="GRADLE" />
28+
<option name="scriptParameters" value="-PbaseIDE=idea -Plang=rust" />
29+
<option name="taskDescriptions">
30+
<list />
31+
</option>
32+
<option name="taskNames">
33+
<list>
34+
<option value=":plugin:runIde" />
35+
</list>
36+
</option>
37+
<option name="vmOptions" value="" />
38+
</ExternalSystemSettings>
39+
<GradleScriptDebugEnabled>false</GradleScriptDebugEnabled>
40+
<method v="2" />
41+
</configuration>
42+
</component>
43+
```
44+
45+
We configure the `scriptParameters` to pass the `baseIDE` and `lang` to the gradle script.
46+
47+
```bash
48+
./gradlew :plugin:runIde -PbaseIDE=idea -Plang=rust
49+
```
50+
51+
## Configure in Gradle
52+
53+
We can configure the plugin in Gradle script, like build.gradle.kts :
54+
55+
```kotlin
56+
project(":plugin") {
57+
apply {
58+
plugin("org.jetbrains.changelog")
59+
}
60+
61+
version = prop("pluginVersion") + "-$platformVersion"
62+
63+
intellij {
64+
pluginName.set(basePluginArchiveName)
65+
val pluginList: MutableList<String> = mutableListOf("Git4Idea")
66+
when (lang) {
67+
"idea" -> {
68+
pluginList += javaPlugins
69+
}
70+
"python" -> {
71+
pluginList += pycharmPlugins
72+
}
73+
"go" -> {
74+
pluginList += listOf("org.jetbrains.plugins.go")
75+
}
76+
"rust" -> {
77+
pluginList += rustPlugins
78+
}
79+
}
80+
81+
plugins.set(pluginList)
82+
}
83+
84+
...
85+
}
86+
```
87+
88+
In `rustPlugins`, we can see the plugin list for Rust:
89+
90+
```kotlin
91+
val rustPlugins = listOf(
92+
prop("rustPlugin"),
93+
"org.toml.lang"
94+
)
95+
```
96+
97+
The `prop("rustPlugin")` is defined in `gradle.properties`, which will also load different version of plugin for different IDE version.
98+
99+
- gradle-222.properties
100+
- gradle-233.properties
101+
102+
In `gradle-222.properties`, we can see the plugin version for Rust:
103+
104+
```properties
105+
rustPlugin=org.rust.lang:0.4.185.5086-222
106+
```
107+
108+
In `gradle-233.properties`, we can see the plugin version for Rust:
109+
110+
```properties
111+
rustPlugin=com.jetbrains.rust:233.21799.284
112+
```
113+
114+
115+
## Debug Config for Rust
116+
117+
Tricks for Rust development.
118+
119+
Due to JetBrains' crafty move, there are two different versions of the Rust IDE plugin.
120+
121+
- **Under 233: Deprecated Rust**
122+
- check latest available version here https://plugins.jetbrains.com/plugin/8182--deprecated-rust
123+
- rustPlugin=org.rust.lang:0.4.185.5086-222
124+
- **Above 233: Official Rust
125+
- check latest available version here https://plugins.jetbrains.com/plugin/22407-rust/versions
126+
- rustPlugin=com.jetbrains.rust:233.21799.284

0 commit comments

Comments
 (0)