IJPL-161819 introduce InlinePromptManager in intellij.platform.analysis

GitOrigin-RevId: 7b5d5315ac6a2961fa8d2dc7193e4b20010b17c9
This commit is contained in:
Max Medvedev
2024-09-07 12:44:01 +02:00
committed by intellij-monorepo-bot
parent 948f07932b
commit ae087838b1
4 changed files with 44 additions and 0 deletions

View File

@@ -1,3 +1,8 @@
*:com.intellij.ai.InlinePromptManager
- *sf:Companion:com.intellij.ai.InlinePromptManager$Companion
- a:isInlinePromptShown(com.intellij.openapi.editor.Editor):Z
*f:com.intellij.ai.InlinePromptManager$Companion
- f:getInstance(com.intellij.openapi.project.Project):com.intellij.ai.InlinePromptManager
f:com.intellij.analysis.AnalysisBundle
- sf:BUNDLE:java.lang.String
- s:message(java.lang.String,java.lang.Object[]):java.lang.String
@@ -168,6 +173,7 @@ com.intellij.codeInsight.completion.BatchConsumer
- startBatch():V
a:com.intellij.codeInsight.completion.CompletionConfidence
- <init>():V
- shouldSkipAutopopup(com.intellij.openapi.editor.Editor,com.intellij.psi.PsiElement,com.intellij.psi.PsiFile,I):com.intellij.util.ThreeState
- shouldSkipAutopopup(com.intellij.psi.PsiElement,com.intellij.psi.PsiFile,I):com.intellij.util.ThreeState
f:com.intellij.codeInsight.completion.CompletionConfidenceEP
- com.intellij.lang.LanguageExtensionPoint

View File

@@ -0,0 +1,27 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ai
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.ApiStatus.Experimental
/**
* Manages the inline prompts shown in editors.
* An inline prompt is a piece of natural language text written right in the editor itself.
* When we detect it, we start an inline prompt editing mode.
* When we edit inline prompt, programming language features should not interfere with the prompt
*/
@Experimental
interface InlinePromptManager {
companion object {
fun getInstance(project: Project): InlinePromptManager = project.getService(InlinePromptManager::class.java)
}
/**
* Checks if the inline prompt is currently shown in the specified editor.
*
* @param editor the editor in which the inline prompt visibility is to be checked
* @return true if the inline prompt is shown, false otherwise
*/
fun isInlinePromptShown(editor: Editor): Boolean
}

View File

@@ -0,0 +1,8 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ai
import com.intellij.openapi.editor.Editor
internal class EmptyInlinePromptManager : InlinePromptManager {
override fun isInlinePromptShown(editor: Editor): Boolean = false
}

View File

@@ -363,6 +363,9 @@
<applicationService serviceInterface="com.intellij.openapi.module.ModuleTypeManager"
serviceImplementation="com.intellij.openapi.module.impl.ModuleTypeManagerImpl"/>
<projectService serviceInterface="com.intellij.ai.InlinePromptManager"
serviceImplementation="com.intellij.ai.EmptyInlinePromptManager"/>
<applicationService
serviceImplementation="com.intellij.openapi.roots.ui.configuration.actions.ModuleDeleteProvider"/>