Skip to content

Commit 53d3f78

Browse files
hszSpace Team
authored andcommitted
LSP Example: use loadBundledPlugins("com.intellij.platform.lsp")
1 parent 3a59f82 commit 53d3f78

File tree

1 file changed

+39
-24
lines changed

1 file changed

+39
-24
lines changed

examples/lsp.ipynb

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"metadata": {
2626
"collapsed": true,
2727
"ExecuteTime": {
28-
"end_time": "2025-08-07T10:12:50.251411Z",
29-
"start_time": "2025-08-07T10:12:49.710953Z"
28+
"end_time": "2025-08-07T11:30:51.291051Z",
29+
"start_time": "2025-08-07T11:30:50.984417Z"
3030
}
3131
},
3232
"cell_type": "code",
@@ -59,12 +59,12 @@
5959
{
6060
"metadata": {
6161
"ExecuteTime": {
62-
"end_time": "2025-08-07T10:12:53.789969Z",
63-
"start_time": "2025-08-07T10:12:50.278977Z"
62+
"end_time": "2025-08-07T11:30:53.999294Z",
63+
"start_time": "2025-08-07T11:30:51.312917Z"
6464
}
6565
},
6666
"cell_type": "code",
67-
"source": "loadBundledPlugins(\"com.intellij.modules.ultimate\")",
67+
"source": "loadBundledPlugins(\"com.intellij.platform.lsp\")",
6868
"outputs": [],
6969
"execution_count": 2
7070
},
@@ -88,8 +88,8 @@
8888
{
8989
"metadata": {
9090
"ExecuteTime": {
91-
"end_time": "2025-08-07T10:12:54.024997Z",
92-
"start_time": "2025-08-07T10:12:53.811874Z"
91+
"end_time": "2025-08-07T11:30:54.072521Z",
92+
"start_time": "2025-08-07T11:30:54.010960Z"
9393
}
9494
},
9595
"cell_type": "code",
@@ -120,8 +120,8 @@
120120
{
121121
"metadata": {
122122
"ExecuteTime": {
123-
"end_time": "2025-08-07T10:12:54.152886Z",
124-
"start_time": "2025-08-07T10:12:54.074487Z"
123+
"end_time": "2025-08-07T11:30:54.104781Z",
124+
"start_time": "2025-08-07T11:30:54.075763Z"
125125
}
126126
},
127127
"cell_type": "code",
@@ -163,20 +163,31 @@
163163
{
164164
"metadata": {
165165
"ExecuteTime": {
166-
"end_time": "2025-08-07T10:12:54.382252Z",
167-
"start_time": "2025-08-07T10:12:54.225026Z"
166+
"end_time": "2025-08-07T11:30:54.135358Z",
167+
"start_time": "2025-08-07T11:30:54.108830Z"
168168
}
169169
},
170170
"cell_type": "code",
171171
"source": [
172172
"import com.intellij.platform.lsp.api.LspServerManager\n",
173173
"import com.intellij.platform.lsp.api.LspServerSupportProvider\n",
174174
"\n",
175-
"runInEdt {\n",
176-
" registerExtension(LspServerSupportProvider.EP_NAME, KotlinLspServerSupportProvider())\n",
177-
"}"
175+
"registerExtension(LspServerSupportProvider.EP_NAME, KotlinLspServerSupportProvider())"
176+
],
177+
"outputs": [
178+
{
179+
"data": {
180+
"text/plain": [
181+
"IntelliJ Platform integration is disposed"
182+
]
183+
},
184+
"metadata": {},
185+
"output_type": "display_data",
186+
"jetTransient": {
187+
"display_id": null
188+
}
189+
}
178190
],
179-
"outputs": [],
180191
"execution_count": 5
181192
},
182193
{
@@ -185,17 +196,21 @@
185196
"source": [
186197
"## Testing the Integration\n",
187198
"\n",
188-
"To test the integration, create a Kotlin file with some unnecessary constructs.\n",
199+
"To test the integration:\n",
200+
"1. Install [Kotlin LSP CLI tool](https://github.com/Kotlin/kotlin-lsp?tab=readme-ov-file#install-kotlin-lsp-cli).\n",
201+
"2. Run this Kotlin Notebook.\n",
202+
"3. Create a Kotlin file with some unnecessary constructs.\n",
189203
"\n",
190-
"```kotlin\n",
191-
"import java.util.List\n",
192-
"\n",
193-
"class Hello {\n",
194-
" fun sayHello() = \"Hello, world!\"\n",
195-
"}\n",
196-
"```\n",
204+
" ```kotlin\n",
205+
" import java.util.List\n",
197206
"\n",
198-
"Observe two warnings: an unnecessary import and an implicit return type for the `sayHello` function.\n",
207+
" class Hello {\n",
208+
" fun sayHello() = \"Hello, world!\"\n",
209+
" }\n",
210+
" ```\n",
211+
"4. Observe two warnings:\n",
212+
" - an unnecessary import,\n",
213+
" - an implicit return type for the `sayHello` function.\n",
199214
"\n",
200215
"Use [Intention Actions](https://www.jetbrains.com/help/idea/intention-actions.html) and note two actions provided by the LSP server:\n",
201216
"\n",

0 commit comments

Comments
 (0)