From 65ac1133eb54437a57f6155d33187b53d7c62723 Mon Sep 17 00:00:00 2001 From: Ivan Migalev Date: Tue, 17 Dec 2024 18:45:09 +0100 Subject: [PATCH 1/2] (RIDER-121088) F#: move summarizer to the AIA GitOrigin-RevId: 46999892a91ddd5af543c21f15b4504ff7a75a38 --- rider-fsharp/build.gradle.kts | 1 - .../fsharp/llm/FSharpFileSummarizer.kt | 33 ------------------- .../src/main/resources/META-INF/plugin.xml | 1 - .../intellij.rider.plugins.fsharp.llm.xml | 11 ------- 4 files changed, 46 deletions(-) delete mode 100644 rider-fsharp/src/main/java/com/jetbrains/rider/plugins/fsharp/llm/FSharpFileSummarizer.kt delete mode 100644 rider-fsharp/src/main/resources/intellij.rider.plugins.fsharp.llm.xml diff --git a/rider-fsharp/build.gradle.kts b/rider-fsharp/build.gradle.kts index 491fb64928..85ee8f7f08 100644 --- a/rider-fsharp/build.gradle.kts +++ b/rider-fsharp/build.gradle.kts @@ -52,7 +52,6 @@ dependencies { bundledPlugin("JavaScript") bundledPlugin("com.intellij.css") bundledPlugin("com.intellij.database") - bundledPlugin("com.intellij.ml.llm") bundledPlugin("org.intellij.intelliLang") bundledPlugin("org.jetbrains.plugins.textmate") bundledPlugin("rider.intellij.plugin.appender") diff --git a/rider-fsharp/src/main/java/com/jetbrains/rider/plugins/fsharp/llm/FSharpFileSummarizer.kt b/rider-fsharp/src/main/java/com/jetbrains/rider/plugins/fsharp/llm/FSharpFileSummarizer.kt deleted file mode 100644 index 83b4114bcc..0000000000 --- a/rider-fsharp/src/main/java/com/jetbrains/rider/plugins/fsharp/llm/FSharpFileSummarizer.kt +++ /dev/null @@ -1,33 +0,0 @@ -package com.jetbrains.rider.plugins.fsharp.llm - -import com.intellij.ml.llm.privacy.PSString -import com.intellij.ml.llm.privacy.trustedStringBuilders.privacyUnsafeDoNotUse -import com.intellij.ml.llm.smartChat.psiSummarization.LanguageSummaryProvider -import com.intellij.psi.PsiDocumentManager -import com.intellij.psi.PsiElement -import com.intellij.util.concurrency.ThreadingAssertions -import com.jetbrains.rd.ide.model.RdDocumentId -import com.jetbrains.rdclient.document.getDocumentId -import com.jetbrains.rider.ideaInterop.fileTypes.fsharp.psi.FSharpFile -import com.jetbrains.rider.model.GetFileSummaryParameters -import com.jetbrains.rider.model.aIChatModel -import com.jetbrains.rider.projectView.solution -import kotlinx.coroutines.runBlocking - -class FSharpFileSummarizer: LanguageSummaryProvider { - override fun generateSummary(psiElement: PsiElement): PSString? { - val psiFile = psiElement.containingFile - if (psiFile is FSharpFile) { - val ids: RdDocumentId = PsiDocumentManager.getInstance(psiFile.project).getDocument(psiFile)?.getDocumentId(psiFile.project) - ?: return null - - ThreadingAssertions.assertBackgroundThread() - return runBlocking { - return@runBlocking psiFile.project.solution.aIChatModel.getFileSummary.startSuspending( - GetFileSummaryParameters(ids)).summary.privacyUnsafeDoNotUse - } - } - return null - } -} - diff --git a/rider-fsharp/src/main/resources/META-INF/plugin.xml b/rider-fsharp/src/main/resources/META-INF/plugin.xml index 74c9dc1a52..ae32d6b36a 100644 --- a/rider-fsharp/src/main/resources/META-INF/plugin.xml +++ b/rider-fsharp/src/main/resources/META-INF/plugin.xml @@ -9,7 +9,6 @@ rider.intellij.plugin.appender - diff --git a/rider-fsharp/src/main/resources/intellij.rider.plugins.fsharp.llm.xml b/rider-fsharp/src/main/resources/intellij.rider.plugins.fsharp.llm.xml deleted file mode 100644 index 472e617dda..0000000000 --- a/rider-fsharp/src/main/resources/intellij.rider.plugins.fsharp.llm.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - From 2d456db864b9faa5fbd1e3b6a41520855748590b Mon Sep 17 00:00:00 2001 From: Ivan Migalev Date: Wed, 18 Dec 2024 17:17:50 +0100 Subject: [PATCH 2/2] (RIDER-121088) F#: explicitly add intellij.rider module for successful compilation GitOrigin-RevId: 8358f5d7c4ff4b492ba454b4b171faa9878ad23b --- rider-fsharp/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/rider-fsharp/build.gradle.kts b/rider-fsharp/build.gradle.kts index 85ee8f7f08..e0cccfe7a8 100644 --- a/rider-fsharp/build.gradle.kts +++ b/rider-fsharp/build.gradle.kts @@ -49,6 +49,7 @@ dependencies { rider("$riderBaseVersion-SNAPSHOT", useInstaller = false) } jetbrainsRuntime() + bundledModule("intellij.rider") bundledPlugin("JavaScript") bundledPlugin("com.intellij.css") bundledPlugin("com.intellij.database")