From 693cd3035c5852e74a2d4ba006e734776bd643ae Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Mon, 7 Jul 2025 17:44:25 -0700 Subject: [PATCH 01/22] check for next edit option --- .../AutocompleteEditorListener.kt | 39 ++++++++++++++++--- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt index 19b0dfa3a..02e425ce9 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt @@ -1,5 +1,7 @@ package com.github.continuedev.continueintellijextension.autocomplete +import com.github.continuedev.continueintellijextension.services.ContinuePluginService +import com.github.continuedev.continueintellijextension.utils.castNestedOrNull import com.intellij.openapi.application.invokeLater import com.intellij.openapi.components.service import com.intellij.openapi.editor.Editor @@ -46,12 +48,39 @@ class AutocompleteDocumentListener(private val editorManager: FileEditorManager, return } - // Invoke later is important, otherwise the completion will be triggered before the document is updated - // causing the old caret offset to be used - // TODO: concurrency - invokeLater { - service.triggerCompletion(editor) + val nextEditService = editor.project?.serivce() ?: return + + // Check settings to see if next edit is enabled, and then trigger either autocomplete or next exit. + val continuePluginService = editor.project?.service() + if (continuePluginService == null) { + return } + + continuePluginService.coreMessenger?.request( + "config/getSerializedProfileInfo", + null, + null, + ({ response -> + val optInNextEditFeature = response.castNestedOrNull( + "content", + "result", + "config", + "experimental", + "optInNextEditFeature" + ) ?: return@request + + invokeLater { + if (optInNextEditFeature) { + nextEditService.triggerNextEdit(editor) + } else { + // Invoke later is important, otherwise the completion will be triggered before the document is updated + // causing the old caret offset to be used + // TODO: concurrency + service.triggerCompletion(editor) + } + } + }) + ) } } From 185b6998f004e455307ca387f22fd3e062aadd91 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Mon, 7 Jul 2025 18:36:57 -0700 Subject: [PATCH 02/22] lay a foundation for next edit service --- .../nextEdit/NextEditService.kt | 391 ++++++++++++++++++ 1 file changed, 391 insertions(+) create mode 100644 extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt new file mode 100644 index 000000000..9095a6dd6 --- /dev/null +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt @@ -0,0 +1,391 @@ +package com.github.continuedev.continueintellijextension.nextEdit + +import com.github.continuedev.continueintellijextension.autocomplete.AutocompleteLookupListener +import com.github.continuedev.continueintellijextension.autocomplete.AutocompleteSpinnerWidget +import com.github.continuedev.continueintellijextension.autocomplete.ContinueInlayRenderer +import com.github.continuedev.continueintellijextension.autocomplete.PendingCompletion +import com.github.continuedev.continueintellijextension.autocomplete.addInlayElement +import com.github.continuedev.continueintellijextension.autocomplete.isInjectedText +import com.github.continuedev.continueintellijextension.services.ContinueExtensionSettings +import com.github.continuedev.continueintellijextension.services.ContinuePluginService +import com.github.continuedev.continueintellijextension.utils.toUriOrNull +import com.github.continuedev.continueintellijextension.utils.uuid +import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.application.WriteAction +import com.intellij.openapi.application.invokeLater +import com.intellij.openapi.application.runReadAction +import com.intellij.openapi.components.Service +import com.intellij.openapi.components.service +import com.intellij.openapi.editor.Editor +import com.intellij.openapi.editor.InlayProperties +import com.intellij.openapi.fileEditor.FileDocumentManager +import com.intellij.openapi.project.Project +import com.intellij.openapi.util.TextRange +import com.intellij.openapi.wm.WindowManager +import com.intellij.psi.PsiDocumentManager + +@Service(Service.Level.PROJECT) +class NextEditService(private val project: Project) { + var pendingCompletion: PendingCompletion? = null + private val autocompleteLookupListener = project.service() + private val widget: AutocompleteSpinnerWidget? by lazy { + WindowManager.getInstance().getStatusBar(project) + ?.getWidget(AutocompleteSpinnerWidget.ID) as? AutocompleteSpinnerWidget + } + + // To avoid triggering another completion on partial acceptance, + // we need to keep track of whether the last change was a partial accept + var lastChangeWasPartialAccept = false + + fun triggerCompletion(editor: Editor) { + val settings = service() + if (!settings.continueState.enableTabAutocomplete) { + return + } + + if (pendingCompletion != null) { + clearCompletions(pendingCompletion!!.editor) + } + + // Set pending completion + val completionId = uuid() + val offset = editor.caretModel.primaryCaret.offset + pendingCompletion = PendingCompletion(editor, offset, completionId, null) + + // Request a completion from the core + val virtualFile = FileDocumentManager.getInstance().getFile(editor.document) + + val uri = virtualFile?.toUriOrNull() ?: return + + widget?.setLoading(true) + + val line = editor.caretModel.primaryCaret.logicalPosition.line + val column = editor.caretModel.primaryCaret.logicalPosition.column + val input = mapOf( + "completionId" to completionId, + "filepath" to uri, + "pos" to mapOf( + "line" to line, + "character" to column + ), + "clipboardText" to "", + "recentlyEditedRanges" to emptyList(), + "recentlyVisitedRanges" to emptyList(), + ) + + // TODO: Add message support for nextEdit/predict. + project.service().coreMessenger?.request( + "nextEdit/predict", + input, + null, + ({ response -> + if (pendingCompletion == null || pendingCompletion?.completionId == completionId) { + widget?.setLoading(false) + } + + val responseObject = response as Map<*, *> + val predictions = responseObject["content"] as List<*> + + if (predictions.isNotEmpty()) { + val prediction = predictions[0].toString() + // TODO: Check if the prediction is purely additive. + val result = checkFim( + editor.document.text, + prediction, + Pair(line, column) + ) + when (result) { + is FimResult.FimEdit -> { + // TODO: If so, render ghost text. + val finalTextToInsert = deduplicateCompletion(editor, offset, result.fimText) + if (shouldRenderCompletion(finalTextToInsert, offset, line, editor)) { + renderCompletion(editor, offset, finalTextToInsert) + pendingCompletion = PendingCompletion(editor, offset, completionId, finalTextToInsert) + } + } + is FimResult.NotFimEdit -> { + // TODO: Else, render a window. + } + } +// val finalTextToInsert = deduplicateCompletion(editor, offset, completion) +// +// if (shouldRenderCompletion(finalTextToInsert, offset, line, editor)) { +// renderCompletion(editor, offset, finalTextToInsert) +// pendingCompletion = PendingCompletion(editor, offset, completionId, finalTextToInsert) +// } + } + }) + ) + } + + sealed class FimResult { + data class FimEdit(val fimText: String) : FimResult() + object NotFimEdit : FimResult() + } + /** + * Check if the diff is indeed a FIM (Fill-In-Middle). + * @param oldEditRange Original string content. + * @param newEditRange New string content. + * @param cursorPosition The position of the cursor in the old string. + * @return A Pair where the first value is a boolean indicating if the change is purely additive (FIM) + * and the second value is the FIM text content or null if not a FIM. + */ + private fun checkFim( + oldEditRange: String, + newEditRange: String, + cursorPosition: Pair // line, character + ): FimResult { + // Find the common prefix + var prefixLength = 0 + while (prefixLength < oldEditRange.length && + prefixLength < newEditRange.length && + oldEditRange[prefixLength] == newEditRange[prefixLength]) { + prefixLength++ + } + + // Find the common suffix + var oldSuffixPos = oldEditRange.length - 1 + var newSuffixPos = newEditRange.length - 1 + + while (oldSuffixPos >= prefixLength && + newSuffixPos >= prefixLength && + oldEditRange[oldSuffixPos] == newEditRange[newSuffixPos]) { + oldSuffixPos-- + newSuffixPos-- + } + + // The old text is purely preserved if: + // 1. The prefix ends before or at the cursor. + // 2. The suffix starts after or at the cursor. + // 3. There's no gap between prefix and suffix in the old text. + + val suffixStartInOld = oldSuffixPos + 1 + val suffixStartInNew = newSuffixPos + 1 + + // Convert cursor position to an offset in the string. + // For simplicity, we need to calculate the cursor's position in the string. + // This requires knowledge of line endings in the oldEditRange. + val lines = oldEditRange.substring(0, prefixLength).split("\n") + val cursorOffset = if (lines.size > 1) { + lines.dropLast(1).sumOf { it.length + 1 } + cursorPosition.second + } else { + cursorPosition.second + } + + // Check if the cursor is positioned between the prefix and suffix. + val cursorBetweenPrefixAndSuffix = + prefixLength <= cursorOffset && cursorOffset <= suffixStartInOld + + // Check if the old text is completely preserved (no deletion). + val noTextDeleted = suffixStartInOld - prefixLength <= 0 + + val isFim = cursorBetweenPrefixAndSuffix && noTextDeleted + + return if (isFim) { + // Extract the content between prefix and suffix in the new string. + FimResult.FimEdit(newEditRange.substring(prefixLength, suffixStartInNew)) + } else { + FimResult.NotFimEdit + } + } + + private fun shouldRenderCompletion(completion: String, offset: Int, line: Int, editor: Editor): Boolean { + if (completion.isEmpty() || runReadAction { offset != editor.caretModel.offset }) { + return false + } + + if (completion.lines().size == 1) { + return true + } + + val endOffset = editor.document.getLineEndOffset(line) + + // Do not render if completion is multi-line and caret is in middle of line + return offset <= endOffset && editor.document.getText(TextRange(offset, endOffset)).isBlank() + } + + private fun deduplicateCompletion(editor: Editor, offset: Int, completion: String): String { + // Check if completion matches the first 10 characters after the cursor + return ApplicationManager.getApplication().runReadAction { + val document = editor.document + val caretOffset = editor.caretModel.offset + + // Don't care about it if it's at the end of the document + if (caretOffset == document.textLength) return@runReadAction completion + + val N = 10 + var textAfterCursor = if (caretOffset + N <= document.textLength) { + document.getText(TextRange(caretOffset, caretOffset + N)) + } else { + document.getText(TextRange(caretOffset, document.textLength)) + } + + // Avoid truncating the completion text when the text after the cursor is blank + if (textAfterCursor.isBlank()) return@runReadAction completion + + // Determine the index of a newline character within the text following the cursor. + val newlineIndex = textAfterCursor.indexOf("\r\n").takeIf { it >= 0 } ?: textAfterCursor.indexOf('\n') + // If a newline character is found and the current line is not empty, truncate the text at that point. + if (newlineIndex > 0) { + textAfterCursor = textAfterCursor.substring(0, newlineIndex) + } + + val indexOfTextAfterCursorInCompletion = completion.indexOf(textAfterCursor) + if (indexOfTextAfterCursorInCompletion > 0) { + return@runReadAction completion.slice(0..indexOfTextAfterCursorInCompletion - 1) + } else if (indexOfTextAfterCursorInCompletion == 0) { + return@runReadAction "" + } + + return@runReadAction completion + } + } + + private fun renderCompletion(editor: Editor, offset: Int, completion: String) { + if (completion.isEmpty()) { + return + } + if (isInjectedFile(editor)) return + // Skip rendering completions if the code completion dropdown is already visible and the IDE completion side-by-side setting is disabled + if (shouldSkipRender()) { + return + } + + ApplicationManager.getApplication().invokeLater { + WriteAction.run { + // Clear existing completions + hideCompletions(editor) + + val properties = InlayProperties() + properties.relatesToPrecedingText(true) + properties.disableSoftWrapping(true) + + val lines = completion.lines() + pendingCompletion = pendingCompletion?.copy(text = lines.joinToString("\n")) + editor.addInlayElement(lines, offset, properties) + +// val attributes = TextAttributes().apply { +// backgroundColor = JBColor.GREEN +// } +// val key = TextAttributesKey.createTextAttributesKey("CONTINUE_AUTOCOMPLETE") +// key.let { editor.colorsScheme.setAttributes(it, attributes) } +// editor.markupModel.addLineHighlighter(key, editor.caretModel.logicalPosition.line, HighlighterLayer.LAST) + } + } + } + + fun accept() { + val completion = pendingCompletion ?: return + val text = completion.text ?: return + val editor = completion.editor + val offset = completion.offset + editor.document.insertString(offset, text) + + editor.caretModel.moveToOffset(offset + text.length) + + project.service().coreMessenger?.request( + "autocomplete/accept", + hashMapOf("completionId" to completion.completionId), + null, + ({}) + ) + invokeLater { + clearCompletions(editor, completion) + } + } + + private fun shouldSkipRender(): Boolean { + val settings = service() + return !settings.continueState.showIDECompletionSideBySide && !autocompleteLookupListener.isLookupEmpty() + } + + private fun splitKeepingDelimiters(input: String, delimiterPattern: String = "\\s+"): List { + val initialSplit = input.split("(?<=$delimiterPattern)|(?=$delimiterPattern)".toRegex()) + .filter { it.isNotEmpty() } + + val result = mutableListOf() + var currentDelimiter = "" + + for (part in initialSplit) { + if (part.matches(delimiterPattern.toRegex())) { + currentDelimiter += part + } else { + if (currentDelimiter.isNotEmpty()) { + result.add(currentDelimiter) + currentDelimiter = "" + } + result.add(part) + } + } + + if (currentDelimiter.isNotEmpty()) { + result.add(currentDelimiter) + + } + + return result + } + + fun partialAccept() { + val completion = pendingCompletion ?: return + val text = completion.text ?: return + val editor = completion.editor + val offset = completion.offset + + lastChangeWasPartialAccept = true + + // Split the text into words, keeping delimiters + val words = splitKeepingDelimiters(text) + println(words) + val word = words[0] + editor.document.insertString(offset, word) + editor.caretModel.moveToOffset(offset + word.length) + + // Remove the completion and re-display it + hideCompletions(editor) + completion.text = text.substring(word.length) + completion.offset += word.length + renderCompletion(editor, completion.offset, completion.text!!) + } + + private fun cancelCompletion(completion: PendingCompletion) { + // Send cancellation message to core + widget?.setLoading(false) + project.service().coreMessenger?.request("autocomplete/cancel", null, null, ({})) + } + + fun clearCompletions(editor: Editor, completion: PendingCompletion? = pendingCompletion) { + if (isInjectedFile(editor)) return + + if (completion != null) { + cancelCompletion(completion) + if (completion.completionId == pendingCompletion?.completionId) pendingCompletion = null + } + disposeInlayRenderer(editor) + } + + private fun isInjectedFile(editor: Editor): Boolean { + return runReadAction { + PsiDocumentManager.getInstance(project).getPsiFile(editor.document)?.isInjectedText() ?: false + } + } + + fun hideCompletions(editor: Editor) { + if (isInjectedFile(editor)) return + + disposeInlayRenderer(editor) + } + + private fun disposeInlayRenderer(editor: Editor) { + editor.inlayModel.getInlineElementsInRange(0, editor.document.textLength).forEach { + if (it.renderer is ContinueInlayRenderer) { + it.dispose() + } + } + editor.inlayModel.getBlockElementsInRange(0, editor.document.textLength).forEach { + if (it.renderer is ContinueInlayRenderer) { + it.dispose() + } + } + } +} \ No newline at end of file From b2477f4799370136019209d0dd65663af336d196 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Tue, 8 Jul 2025 09:44:38 -0700 Subject: [PATCH 03/22] feat: support next edit in core --- core/core.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/core.ts b/core/core.ts index 72931c5e8..4f5dfef80 100644 --- a/core/core.ts +++ b/core/core.ts @@ -74,6 +74,7 @@ import type { FromCoreProtocol, ToCoreProtocol } from "./protocol"; import { OnboardingModes } from "./protocol/core"; import type { IMessenger, Message } from "./protocol/messenger"; import { getUriPathBasename } from "./util/uri"; +import { NextEditProvider } from "./nextEdit/NextEditProvider"; const hasRulesFiles = (uris: string[]): boolean => { for (const uri of uris) { @@ -89,6 +90,7 @@ export class Core { configHandler: ConfigHandler; codeBaseIndexer: CodebaseIndexer; completionProvider: CompletionProvider; + nextEditProvider: NextEditProvider; private docsService: DocsService; private globalContext = new GlobalContext(); llmLogger = new LLMLogger(); @@ -239,6 +241,15 @@ export class Core { (..._) => Promise.resolve([]), ); + this.nextEditProvider = NextEditProvider.initialize( + this.configHandler, + ide, + getLlm, + (e) => {}, + (..._) => Promise.resolve([]), + "fineTuned", + ); + this.registerMessageHandlers(ideSettingsPromise); } @@ -522,6 +533,15 @@ export class Core { this.completionProvider.cancel(); }); + // Next Edit + on("nextEdit/predict", async (msg) => { + const outcome = await this.nextEditProvider.provideInlineCompletionItems( + msg.data, + undefined, + ); + return outcome ? [outcome.completion] : []; + }); + on("streamDiffLines", async (msg) => { const { config } = await this.configHandler.loadConfig(); if (!config) { From 47eef525a281af308a0423d450541f8d8a549b3c Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Tue, 8 Jul 2025 09:45:19 -0700 Subject: [PATCH 04/22] feat: support new message type nextEdit/predict --- core/protocol/core.ts | 1 + core/protocol/passThrough.ts | 1 + .../continueintellijextension/constants/MessageTypes.kt | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/protocol/core.ts b/core/protocol/core.ts index f06d1db04..51aa9c522 100644 --- a/core/protocol/core.ts +++ b/core/protocol/core.ts @@ -145,6 +145,7 @@ export type ToCoreFromIdeOrWebviewProtocol = { "context/indexDocs": [{ reIndex: boolean }, void]; "autocomplete/cancel": [undefined, void]; "autocomplete/accept": [{ completionId: string }, void]; + "nextEdit/predict": [AutocompleteInput, string[]]; "llm/complete": [ { prompt: string; diff --git a/core/protocol/passThrough.ts b/core/protocol/passThrough.ts index 6b29ce472..589c191a3 100644 --- a/core/protocol/passThrough.ts +++ b/core/protocol/passThrough.ts @@ -37,6 +37,7 @@ export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] = "autocomplete/complete", "autocomplete/cancel", "autocomplete/accept", + "nextEdit/predict", "tts/kill", "llm/complete", "llm/streamChat", diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt index 0d8e071e4..e40cb6a7c 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt @@ -103,6 +103,7 @@ class MessageTypes { "autocomplete/complete", "autocomplete/cancel", "autocomplete/accept", + "nextEdit/predict", "tts/kill", "llm/complete", "llm/streamChat", @@ -134,4 +135,4 @@ class MessageTypes { "process/isBackgrounded", ) } -} \ No newline at end of file +} From b530f47b36f743153f0a290973c51a0db7ca4526 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Tue, 8 Jul 2025 14:00:32 -0700 Subject: [PATCH 05/22] feat: render a swing window --- .../AutocompleteEditorListener.kt | 5 +- .../nextEdit/NextEditService.kt | 10 +- .../nextEdit/NextEditWindowService.kt | 186 ++++++++++++++++++ 3 files changed, 198 insertions(+), 3 deletions(-) create mode 100644 extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditWindowService.kt diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt index 02e425ce9..8ab90e7de 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt @@ -1,5 +1,6 @@ package com.github.continuedev.continueintellijextension.autocomplete +import com.github.continuedev.continueintellijextension.nextEdit.NextEditService import com.github.continuedev.continueintellijextension.services.ContinuePluginService import com.github.continuedev.continueintellijextension.utils.castNestedOrNull import com.intellij.openapi.application.invokeLater @@ -48,7 +49,7 @@ class AutocompleteDocumentListener(private val editorManager: FileEditorManager, return } - val nextEditService = editor.project?.serivce() ?: return + val nextEditService = editor.project?.service() ?: return // Check settings to see if next edit is enabled, and then trigger either autocomplete or next exit. val continuePluginService = editor.project?.service() @@ -60,7 +61,7 @@ class AutocompleteDocumentListener(private val editorManager: FileEditorManager, "config/getSerializedProfileInfo", null, null, - ({ response -> + (request@ { response -> val optInNextEditFeature = response.castNestedOrNull( "content", "result", diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt index 9095a6dd6..0dc4bee9f 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt @@ -37,7 +37,7 @@ class NextEditService(private val project: Project) { // we need to keep track of whether the last change was a partial accept var lastChangeWasPartialAccept = false - fun triggerCompletion(editor: Editor) { + fun triggerNextEdit(editor: Editor) { val settings = service() if (!settings.continueState.enableTabAutocomplete) { return @@ -105,6 +105,14 @@ class NextEditService(private val project: Project) { } is FimResult.NotFimEdit -> { // TODO: Else, render a window. + // val nextEditWindowService = project.service() + val nextEditWindowService = NextEditWindowService.getInstance(project) +// val codeViewer = nextEditWindowService.createCodeViewer(prediction, "ts") + nextEditWindowService.showCodePreview(prediction, "ts", editor) +// editor.contentComponent.removeAll() +// editor.contentComponent.add(codeViewer) +// editor.contentComponent.revalidate() +// editor.contentComponent.repaint() } } // val finalTextToInsert = deduplicateCompletion(editor, offset, completion) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditWindowService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditWindowService.kt new file mode 100644 index 000000000..09493c9ef --- /dev/null +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditWindowService.kt @@ -0,0 +1,186 @@ +package com.github.continuedev.continueintellijextension.nextEdit + +import com.intellij.openapi.components.Service +import com.intellij.openapi.components.service +import com.intellij.openapi.editor.Editor +import com.intellij.openapi.editor.EditorSettings +import com.intellij.openapi.editor.colors.EditorColorsManager +import com.intellij.openapi.editor.ex.EditorEx +import com.intellij.openapi.editor.ex.EditorSettingsExternalizable +import com.intellij.openapi.editor.highlighter.EditorHighlighterFactory +import com.intellij.openapi.fileTypes.FileTypeManager +import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory +import com.intellij.openapi.project.Project +import com.intellij.openapi.ui.popup.JBPopupFactory +import com.intellij.ui.EditorTextField +import com.intellij.ui.components.JBScrollPane +import java.awt.BorderLayout +import java.awt.Color +import java.awt.Dimension +import java.awt.FlowLayout +import java.awt.Point +import javax.swing.JButton +import javax.swing.JComponent +import javax.swing.JPanel +import javax.swing.JScrollPane + +@Service(Service.Level.PROJECT) +class NextEditWindowService(private val project: Project) { + /** + * Creates a Swing component that displays syntax-highlighted code + * + * @param code The code to display + * @param language The language/file extension of the code (e.g. "java", "kotlin", "py") + * @param isEditable Whether the code should be editable (default: false) + * @return A JComponent that can be added to the UI + */ + fun createCodeViewer(code: String, language: String, isEditable: Boolean = false): JComponent { + // Get file type based on extension + val fileType = FileTypeManager.getInstance().getFileTypeByExtension(language) + + // Create an EditorTextField with the specified code and file type + val editorTextField = object : EditorTextField(code, project, fileType) { + override fun createEditor(): EditorEx { + val editor = super.createEditor() + + // Configure editor settings + val settings: EditorSettings = editor.settings + settings.isLineNumbersShown = true + settings.isLineMarkerAreaShown = true + settings.isIndentGuidesShown = true + settings.isVirtualSpace = false + settings.isRightMarginShown = false + settings.additionalLinesCount = 0 + settings.isShowingSpecialChars = false + settings.isCaretRowShown = true + + // Set read-only if not editable + editor.isViewer = !isEditable + + // Syntax highlighter + val syntaxHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, project, null) + editor.highlighter = EditorHighlighterFactory.getInstance().createEditorHighlighter( + syntaxHighlighter, + EditorColorsManager.getInstance().globalScheme + ) + + return editor + } + } + + // Wrap in a scroll pane for larger code blocks + val panel = JPanel(BorderLayout()) + panel.add(JBScrollPane(editorTextField), BorderLayout.CENTER) + + return panel + } + + /** + * Shows a popup dialog with the code preview + */ + fun showCodePreview(code: String, language: String, parentEditor: Editor) { + // Use invokeAndWait or invokeLater to ensure we're on the EDT + com.intellij.openapi.application.ApplicationManager.getApplication().invokeLater { + val codeViewer = createCodeViewer(code, language) + // Create a panel to hold the code viewer and buttons + val panel = JPanel(BorderLayout()) + panel.add(codeViewer, BorderLayout.CENTER) + // Create a button panel + val buttonPanel = JPanel(FlowLayout(FlowLayout.RIGHT)) + + val acceptButton = JButton("Accept") + acceptButton.addActionListener { + // TODO: Implement code acceptance logic + // This should apply the prediction to the actual editor + } + + val dismissButton = JButton("Dismiss") + + buttonPanel.add(acceptButton) + buttonPanel.add(dismissButton) + panel.add(buttonPanel, BorderLayout.SOUTH) + + // Create a popup + val popup = JBPopupFactory.getInstance() + .createComponentPopupBuilder(panel, codeViewer) + .setTitle("Next Edit Preview") + .setMovable(true) + .setResizable(true) + .setRequestFocus(true) + .setCancelOnClickOutside(true) // Allow clicking outside to close + .setCancelOnOtherWindowOpen(true) // Close when another window opens + .setFocusable(true) + .createPopup() + + // Add dismiss action + dismissButton.addActionListener { + popup.cancel() + } + // Get the exact position of the cursor + val visualPosition = parentEditor.caretModel.visualPosition + val cursorPoint = parentEditor.visualPositionToXY(visualPosition) + + // Convert to screen coordinates + val editorComponent = parentEditor.component + val locationOnScreen = editorComponent.locationOnScreen + val screenPoint = Point( + locationOnScreen.x + cursorPoint.x, + locationOnScreen.y + cursorPoint.y + ) + + // Show the popup at the cursor position + popup.showInScreenCoordinates(editorComponent, screenPoint) + } + } + + // Move editorConfig to a proper instance property that gets actual editor settings + private val editorConfig: EditorConfig by lazy { + val settings = EditorSettingsExternalizable.getInstance() + val editorFontSize = EditorColorsManager.getInstance().globalScheme.editorFontSize + val editorFontFamily = EditorColorsManager.getInstance().globalScheme.editorFontName + + EditorConfig( + fontSize = editorFontSize.toDouble(), + fontFamily = editorFontFamily + ) + } + + // Data class to hold editor configuration + private data class EditorConfig( + val fontSize: Double = 14.0, + val fontFamily: String = "JetBrains Mono" + ) + + /** + * Convenience method to map common programming languages to their file extensions + */ + fun mapLanguageToExtension(language: String): String { + return when (language.lowercase()) { + "javascript" -> "js" + "typescript" -> "ts" + "python" -> "py" + "java" -> "java" + "kotlin" -> "kt" + "c++" -> "cpp" + "c#" -> "cs" + "go" -> "go" + "rust" -> "rs" + "ruby" -> "rb" + "php" -> "php" + "swift" -> "swift" + "shell", "bash" -> "sh" + "html" -> "html" + "css" -> "css" + "json" -> "json" + "xml" -> "xml" + "yaml", "yml" -> "yaml" + "markdown", "md" -> "md" + // Add more mappings as needed + else -> language + } + } + + companion object { + fun getInstance(project: Project): NextEditWindowService = project.service() + } +} \ No newline at end of file From adfacf30836af58695614d1d835ac5d887ed82b9 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Tue, 8 Jul 2025 15:36:44 -0700 Subject: [PATCH 06/22] feat: add syntax highlighting --- .../nextEdit/NextEditService.kt | 2 +- .../nextEdit/NextEditWindowService.kt | 178 ++++++++++++++---- 2 files changed, 138 insertions(+), 42 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt index 0dc4bee9f..85b3ec59d 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt @@ -108,7 +108,7 @@ class NextEditService(private val project: Project) { // val nextEditWindowService = project.service() val nextEditWindowService = NextEditWindowService.getInstance(project) // val codeViewer = nextEditWindowService.createCodeViewer(prediction, "ts") - nextEditWindowService.showCodePreview(prediction, "ts", editor) + nextEditWindowService.showCodePreview(prediction, editor) // editor.contentComponent.removeAll() // editor.contentComponent.add(codeViewer) // editor.contentComponent.revalidate() diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditWindowService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditWindowService.kt index 09493c9ef..b31afb4d0 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditWindowService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditWindowService.kt @@ -1,17 +1,24 @@ package com.github.continuedev.continueintellijextension.nextEdit +import com.intellij.openapi.actionSystem.AnAction +import com.intellij.openapi.actionSystem.AnActionEvent +import com.intellij.openapi.actionSystem.CustomShortcutSet +import com.intellij.openapi.command.WriteCommandAction import com.intellij.openapi.components.Service import com.intellij.openapi.components.service +import com.intellij.openapi.editor.Document import com.intellij.openapi.editor.Editor import com.intellij.openapi.editor.EditorSettings import com.intellij.openapi.editor.colors.EditorColorsManager import com.intellij.openapi.editor.ex.EditorEx import com.intellij.openapi.editor.ex.EditorSettingsExternalizable import com.intellij.openapi.editor.highlighter.EditorHighlighterFactory +import com.intellij.openapi.fileEditor.FileDocumentManager import com.intellij.openapi.fileTypes.FileTypeManager import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory import com.intellij.openapi.project.Project import com.intellij.openapi.ui.popup.JBPopupFactory +import com.intellij.psi.PsiDocumentManager import com.intellij.ui.EditorTextField import com.intellij.ui.components.JBScrollPane import java.awt.BorderLayout @@ -19,31 +26,37 @@ import java.awt.Color import java.awt.Dimension import java.awt.FlowLayout import java.awt.Point +import java.awt.event.ActionEvent +import java.awt.event.KeyAdapter +import java.awt.event.KeyEvent +import javax.swing.AbstractAction import javax.swing.JButton import javax.swing.JComponent import javax.swing.JPanel import javax.swing.JScrollPane +import javax.swing.KeyStroke @Service(Service.Level.PROJECT) class NextEditWindowService(private val project: Project) { /** - * Creates a Swing component that displays syntax-highlighted code + * Creates a Swing component that displays syntax-highlighted code. * * @param code The code to display * @param language The language/file extension of the code (e.g. "java", "kotlin", "py") * @param isEditable Whether the code should be editable (default: false) * @return A JComponent that can be added to the UI */ - fun createCodeViewer(code: String, language: String, isEditable: Boolean = false): JComponent { - // Get file type based on extension + fun createCodeViewer(code: String, language: String, document: Document, isEditable: Boolean = false): JComponent { + // Get file type based on extension. + // NOTE: This is actually IDE and tier-dependent. For example, TypeScript won't work on IntelliJ CE. val fileType = FileTypeManager.getInstance().getFileTypeByExtension(language) - // Create an EditorTextField with the specified code and file type + // Create an EditorTextField with the specified code and file type. val editorTextField = object : EditorTextField(code, project, fileType) { override fun createEditor(): EditorEx { val editor = super.createEditor() - // Configure editor settings + // Configure editor settings. val settings: EditorSettings = editor.settings settings.isLineNumbersShown = true settings.isLineMarkerAreaShown = true @@ -54,21 +67,58 @@ class NextEditWindowService(private val project: Project) { settings.isShowingSpecialChars = false settings.isCaretRowShown = true - // Set read-only if not editable + // Set read-only if not editable. editor.isViewer = !isEditable - // Syntax highlighter - val syntaxHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, project, null) - editor.highlighter = EditorHighlighterFactory.getInstance().createEditorHighlighter( - syntaxHighlighter, - EditorColorsManager.getInstance().globalScheme - ) + // Syntax highlighter. + // Get current editor color scheme. + val currentScheme = EditorColorsManager.getInstance().globalScheme + + // Apply syntax highlighting with current theme. + val virtualFile = FileDocumentManager.getInstance().getFile(document) + var syntaxHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, project, virtualFile) + + // If we couldn't get a syntax highlighter from the file, try to get one just from the file type. + if (syntaxHighlighter == null) { + syntaxHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, project, null) + } + + // If we have a highlighter, apply it. + if (syntaxHighlighter != null) { + editor.highlighter = EditorHighlighterFactory.getInstance().createEditorHighlighter( + syntaxHighlighter, + currentScheme + ) + } else { + // Fallback to plain text highlighting if all attempts fail. + val plainTextFileType = FileTypeManager.getInstance().getFileTypeByExtension("txt") + editor.highlighter = EditorHighlighterFactory.getInstance().createEditorHighlighter( + project, + plainTextFileType + ) + } + + // Apply the theme's background color. + editor.backgroundColor = currentScheme.defaultBackground return editor } + + // Override to ensure multi-line support. + override fun getPreferredSize(): Dimension { + val lineCount = code.lines().size + // Adjust height based on line count (with some minimum). + val preferredSize = super.getPreferredSize() + val lineHeight = preferredSize.height / (if (lineCount > 0) lineCount else 1) + val newHeight = lineHeight * (if (lineCount > 0) lineCount else 1) + 10 // Add padding + return Dimension(preferredSize.width, newHeight) + } } - // Wrap in a scroll pane for larger code blocks + // Enable multi-line mode. + editorTextField.setOneLineMode(false) + + // Wrap in a scroll pane for larger code blocks. val panel = JPanel(BorderLayout()) panel.add(JBScrollPane(editorTextField), BorderLayout.CENTER) @@ -76,51 +126,89 @@ class NextEditWindowService(private val project: Project) { } /** - * Shows a popup dialog with the code preview + * Shows a popup dialog with the code preview. */ - fun showCodePreview(code: String, language: String, parentEditor: Editor) { - // Use invokeAndWait or invokeLater to ensure we're on the EDT + fun showCodePreview(code: String, parentEditor: Editor) { + // Use invokeAndWait or invokeLater to ensure we're on the EDT. com.intellij.openapi.application.ApplicationManager.getApplication().invokeLater { - val codeViewer = createCodeViewer(code, language) - // Create a panel to hold the code viewer and buttons - val panel = JPanel(BorderLayout()) - panel.add(codeViewer, BorderLayout.CENTER) - // Create a button panel + val codeViewer = createCodeViewer(code, getFileLanguage(parentEditor.document), parentEditor.document) + + // Create a button panel. val buttonPanel = JPanel(FlowLayout(FlowLayout.RIGHT)) - - val acceptButton = JButton("Accept") - acceptButton.addActionListener { - // TODO: Implement code acceptance logic - // This should apply the prediction to the actual editor - } - - val dismissButton = JButton("Dismiss") - + val acceptButton = JButton("Accept (Tab)") + val dismissButton = JButton("Dismiss (Esc)") buttonPanel.add(acceptButton) buttonPanel.add(dismissButton) + + // Create a panel to hold the code viewer and buttons. + val panel = JPanel(BorderLayout()) + panel.add(codeViewer, BorderLayout.CENTER) panel.add(buttonPanel, BorderLayout.SOUTH) - // Create a popup + + // Create the popup. val popup = JBPopupFactory.getInstance() .createComponentPopupBuilder(panel, codeViewer) - .setTitle("Next Edit Preview") .setMovable(true) .setResizable(true) .setRequestFocus(true) - .setCancelOnClickOutside(true) // Allow clicking outside to close - .setCancelOnOtherWindowOpen(true) // Close when another window opens + .setCancelOnClickOutside(true) + .setCancelOnOtherWindowOpen(true) .setFocusable(true) .createPopup() - // Add dismiss action + // Helper function to accept the code and apply it to the editor. + fun acceptCode() { + val document = parentEditor.document + val caretModel = parentEditor.caretModel + val caretOffset = caretModel.offset + val caretPosition = document.getLineNumber(caretOffset) + + // Calculate start and end lines. + val totalLines = document.lineCount + val startLine = maxOf(0, caretPosition - 5) + val endLine = minOf(totalLines - 1, caretPosition + 5) + + // Get start and end offsets. + val startOffset = document.getLineStartOffset(startLine) + val endOffset = document.getLineEndOffset(endLine) + + // Write command to replace the text. + WriteCommandAction.runWriteCommandAction(project) { + document.replaceString(startOffset, endOffset, code) + } + } + + // Use ActionManager to handle Tab key globally during popup display. + val acceptAction = object : AnAction() { + override fun actionPerformed(e: AnActionEvent) { + acceptCode() + popup.closeOk(null) + } + } + + // Create a custom shortcut set for the Tab key. + val customShortcutSet = CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0)) + + + // Register action with shortcut. + acceptAction.registerCustomShortcutSet(customShortcutSet, panel) + + // Add button actions. + acceptButton.addActionListener { + acceptCode() + popup.closeOk(null) + } + dismissButton.addActionListener { popup.cancel() } - // Get the exact position of the cursor + + // Get the exact position of the cursor. val visualPosition = parentEditor.caretModel.visualPosition val cursorPoint = parentEditor.visualPositionToXY(visualPosition) - // Convert to screen coordinates + // Convert to screen coordinates. val editorComponent = parentEditor.component val locationOnScreen = editorComponent.locationOnScreen val screenPoint = Point( @@ -128,12 +216,15 @@ class NextEditWindowService(private val project: Project) { locationOnScreen.y + cursorPoint.y ) - // Show the popup at the cursor position + // Show the popup at the cursor position. popup.showInScreenCoordinates(editorComponent, screenPoint) + + // Ensure proper focus for keyboard shortcuts. + codeViewer.requestFocusInWindow() } } - // Move editorConfig to a proper instance property that gets actual editor settings + // Move editorConfig to a proper instance property that gets actual editor settings. private val editorConfig: EditorConfig by lazy { val settings = EditorSettingsExternalizable.getInstance() val editorFontSize = EditorColorsManager.getInstance().globalScheme.editorFontSize @@ -145,14 +236,14 @@ class NextEditWindowService(private val project: Project) { ) } - // Data class to hold editor configuration + // Data class to hold editor configuration. private data class EditorConfig( val fontSize: Double = 14.0, val fontFamily: String = "JetBrains Mono" ) /** - * Convenience method to map common programming languages to their file extensions + * Convenience method to map common programming languages to their file extensions. */ fun mapLanguageToExtension(language: String): String { return when (language.lowercase()) { @@ -180,6 +271,11 @@ class NextEditWindowService(private val project: Project) { } } + private fun getFileLanguage(document: Document): String { + val virtualFile = FileDocumentManager.getInstance().getFile(document) + return virtualFile?.extension?.lowercase() ?: "text" + } + companion object { fun getInstance(project: Project): NextEditWindowService = project.service() } From d7145b83b11b13958f0ec92a0e220e3c20db7f4a Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Tue, 8 Jul 2025 15:55:22 -0700 Subject: [PATCH 07/22] bug: fix a bug where fim-ness was not being calculated properly --- .../continueintellijextension/nextEdit/NextEditService.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt index 85b3ec59d..2d94cfdfe 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt @@ -88,9 +88,10 @@ class NextEditService(private val project: Project) { if (predictions.isNotEmpty()) { val prediction = predictions[0].toString() + val oldEditRange = predictions[1].toString() // TODO: Check if the prediction is purely additive. val result = checkFim( - editor.document.text, + oldEditRange, prediction, Pair(line, column) ) From 7b23b10950aa4279a58c09d03e89672200602470 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Tue, 8 Jul 2025 15:55:41 -0700 Subject: [PATCH 08/22] pass original edit range as well --- core/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core.ts b/core/core.ts index 4f5dfef80..75dc023ef 100644 --- a/core/core.ts +++ b/core/core.ts @@ -539,7 +539,7 @@ export class Core { msg.data, undefined, ); - return outcome ? [outcome.completion] : []; + return outcome ? [outcome.completion, outcome.originalEditableRange] : []; }); on("streamDiffLines", async (msg) => { From 75a6ff2ccc55734cd9ed0b36b2909ccb92f9e4f7 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Wed, 9 Jul 2025 09:08:59 -0700 Subject: [PATCH 09/22] feat: support accepts and reject logging --- core/core.ts | 6 +++++ core/nextEdit/NextEditProvider.ts | 38 +++++++++++++++++-------------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/core/core.ts b/core/core.ts index 75dc023ef..7257913c0 100644 --- a/core/core.ts +++ b/core/core.ts @@ -541,6 +541,12 @@ export class Core { ); return outcome ? [outcome.completion, outcome.originalEditableRange] : []; }); + on("nextEdit/accept", async (msg) => { + this.nextEditProvider.accept(msg.data.completionId); + }); + on("nextEdit/reject", async (msg) => { + this.nextEditProvider.reject(msg.data.completionId); + }); on("streamDiffLines", async (msg) => { const { config } = await this.configHandler.loadConfig(); diff --git a/core/nextEdit/NextEditProvider.ts b/core/nextEdit/NextEditProvider.ts index fba86df33..1a56817cb 100644 --- a/core/nextEdit/NextEditProvider.ts +++ b/core/nextEdit/NextEditProvider.ts @@ -158,19 +158,19 @@ export class NextEditProvider { this.loggingService.cancel(); } - // public accept(completionId: string) { - // const outcome = this.loggingService.accept(completionId); - // if (!outcome) { - // return; - // } - // } + public accept(completionId: string) { + const outcome = this.loggingService.accept(completionId); + if (!outcome) { + return; + } + } - // public reject(completionId: string) { - // const outcome = this.loggingService.reject(completionId); - // if (!outcome) { - // return; - // } - // } + public reject(completionId: string) { + const outcome = this.loggingService.reject(completionId); + if (!outcome) { + return; + } + } public markDisplayed(completionId: string, outcome: NextEditOutcome) { this.loggingService.markDisplayed(completionId, outcome); @@ -237,7 +237,6 @@ export class NextEditProvider { // TODO: Toggle between the default endpoint and the finetuned endpoint. const prompts: Prompt[] = []; - if (this.endpointType === "default") { prompts.push(renderDefaultSystemPrompt()); prompts.push(renderDefaultUserPrompt(snippetPayload, helper)); @@ -278,11 +277,16 @@ export class NextEditProvider { } } else { const msg: ChatMessage = await llm.chat(prompts, token); + if (typeof msg.content === "string") { - // TODO: There are cases where msg.conetnt.split("<|start|>")[1] is undefined - const nextCompletion = replaceEscapedCharacters( - msg.content.split("<|editable_region_start|>\n")[1], - ).replace(/\n$/, ""); + // NOTE: There are cases where msg.conetnt.split("<|start|>")[1] is undefined + const nextCompletion = msg.content.split( + "<|editable_region_start|>\n", + )[1] + ? replaceEscapedCharacters( + msg.content.split("<|editable_region_start|>\n")[1], + ).replace(/\n$/, "") + : ""; const currCursorPos = helper.pos; const editableRegionStartLine = Math.max( From 994fd105f4d65ea0e73fc7db470860ae6669c455 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Wed, 9 Jul 2025 09:10:03 -0700 Subject: [PATCH 10/22] feat: support accepts and reject logging --- core/protocol/core.ts | 2 ++ core/protocol/passThrough.ts | 2 ++ .../continueintellijextension/constants/MessageTypes.kt | 2 ++ 3 files changed, 6 insertions(+) diff --git a/core/protocol/core.ts b/core/protocol/core.ts index 51aa9c522..11ec74a82 100644 --- a/core/protocol/core.ts +++ b/core/protocol/core.ts @@ -146,6 +146,8 @@ export type ToCoreFromIdeOrWebviewProtocol = { "autocomplete/cancel": [undefined, void]; "autocomplete/accept": [{ completionId: string }, void]; "nextEdit/predict": [AutocompleteInput, string[]]; + "nextEdit/reject": [{ completionId: string }, void]; + "nextEdit/accept": [{ completionId: string }, void]; "llm/complete": [ { prompt: string; diff --git a/core/protocol/passThrough.ts b/core/protocol/passThrough.ts index 589c191a3..fb561b857 100644 --- a/core/protocol/passThrough.ts +++ b/core/protocol/passThrough.ts @@ -38,6 +38,8 @@ export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] = "autocomplete/cancel", "autocomplete/accept", "nextEdit/predict", + "nextEdit/reject", + "nextEdit/accept", "tts/kill", "llm/complete", "llm/streamChat", diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt index e40cb6a7c..0941454a6 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt @@ -104,6 +104,8 @@ class MessageTypes { "autocomplete/cancel", "autocomplete/accept", "nextEdit/predict", + "nextEdit/reject", + "nextEdit/accept", "tts/kill", "llm/complete", "llm/streamChat", From 9c21c059e2788605837d2344a1fbccf1327b8109 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Wed, 9 Jul 2025 09:10:35 -0700 Subject: [PATCH 11/22] feat: log accept or reject based on user actions --- .../nextEdit/NextEditWindowService.kt | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditWindowService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditWindowService.kt index b31afb4d0..846db780e 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditWindowService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditWindowService.kt @@ -1,5 +1,6 @@ package com.github.continuedev.continueintellijextension.nextEdit +import com.github.continuedev.continueintellijextension.services.ContinuePluginService import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CustomShortcutSet @@ -18,6 +19,8 @@ import com.intellij.openapi.fileTypes.FileTypeManager import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory import com.intellij.openapi.project.Project import com.intellij.openapi.ui.popup.JBPopupFactory +import com.intellij.openapi.ui.popup.JBPopupListener +import com.intellij.openapi.ui.popup.LightweightWindowEvent import com.intellij.psi.PsiDocumentManager import com.intellij.ui.EditorTextField import com.intellij.ui.components.JBScrollPane @@ -128,7 +131,7 @@ class NextEditWindowService(private val project: Project) { /** * Shows a popup dialog with the code preview. */ - fun showCodePreview(code: String, parentEditor: Editor) { + fun showCodePreview(code: String, parentEditor: Editor, completionId: String) { // Use invokeAndWait or invokeLater to ensure we're on the EDT. com.intellij.openapi.application.ApplicationManager.getApplication().invokeLater { val codeViewer = createCodeViewer(code, getFileLanguage(parentEditor.document), parentEditor.document) @@ -155,6 +158,19 @@ class NextEditWindowService(private val project: Project) { .setCancelOnClickOutside(true) .setCancelOnOtherWindowOpen(true) .setFocusable(true) + .addListener(object : JBPopupListener { + override fun onClosed(event: LightweightWindowEvent) { + if (!event.isOk) { + // This only triggers when dismissed, not when accepted. + println("Dismissing code preview popup") + project.service().coreMessenger?.request( + "nextEdit/reject", + hashMapOf("completionId" to completionId), + null, ({}) + ) + } + } + }) .createPopup() // Helper function to accept the code and apply it to the editor. @@ -177,6 +193,12 @@ class NextEditWindowService(private val project: Project) { WriteCommandAction.runWriteCommandAction(project) { document.replaceString(startOffset, endOffset, code) } + + project.service().coreMessenger?.request( + "nextEdit/accept", + hashMapOf("completionId" to completionId), + null, ({}) + ) } // Use ActionManager to handle Tab key globally during popup display. From daf69ae50478bb20fe06d4297ede015ddfe9389a Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Wed, 9 Jul 2025 09:11:29 -0700 Subject: [PATCH 12/22] feat: allow tab to accept --- .../actions/ContinueActionPromote.kt | 8 ++++++ .../nextEdit/AcceptNextEditAction.kt | 25 +++++++++++++++++++ .../nextEdit/NextEditService.kt | 12 ++++----- .../src/main/resources/META-INF/plugin.xml | 7 ++++++ 4 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/AcceptNextEditAction.kt diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/actions/ContinueActionPromote.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/actions/ContinueActionPromote.kt index 43ae74881..747fefd03 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/actions/ContinueActionPromote.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/actions/ContinueActionPromote.kt @@ -1,6 +1,7 @@ package com.github.continuedev.continueintellijextension.actions import com.github.continuedev.continueintellijextension.autocomplete.AcceptAutocompleteAction +import com.github.continuedev.continueintellijextension.nextEdit.AcceptNextEditAction import com.github.continuedev.continueintellijextension.services.ContinueExtensionSettings import com.intellij.openapi.actionSystem.ActionPromoter import com.intellij.openapi.actionSystem.AnAction @@ -19,6 +20,13 @@ class ContinueActionPromote : ActionPromoter { } } + if (actions.any { it is AcceptNextEditAction }) { + val settings = service() + if (settings.continueState.showIDECompletionSideBySide) { + return actions.filterIsInstance() + } + } + val rejectDiffActions = actions.filterIsInstance() if (rejectDiffActions.isNotEmpty()) { return rejectDiffActions diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/AcceptNextEditAction.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/AcceptNextEditAction.kt new file mode 100644 index 000000000..88d43bdb8 --- /dev/null +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/AcceptNextEditAction.kt @@ -0,0 +1,25 @@ +package com.github.continuedev.continueintellijextension.nextEdit + +import com.intellij.openapi.actionSystem.DataContext +import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.components.service +import com.intellij.openapi.editor.Caret +import com.intellij.openapi.editor.Editor +import com.intellij.openapi.editor.actionSystem.EditorAction +import com.intellij.openapi.editor.actionSystem.EditorActionHandler + +class AcceptNextEditAction : EditorAction(object : EditorActionHandler() { + override fun doExecute(editor: Editor, caret: Caret?, dataContext: DataContext?) { + ApplicationManager.getApplication().runWriteAction { + editor.project?.service()?.accept() + } + } + + override fun isEnabledForCaret(editor: Editor, caret: Caret, dataContext: DataContext?): Boolean { + val nextEditService = editor.project?.service(); + val enabled = editor == nextEditService?.pendingCompletion?.editor +// && caret.offset == autocompleteService.pendingCompletion?.offset + && nextEditService.pendingCompletion?.text != null + return enabled + } +}) \ No newline at end of file diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt index 2d94cfdfe..51264db93 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt @@ -109,7 +109,7 @@ class NextEditService(private val project: Project) { // val nextEditWindowService = project.service() val nextEditWindowService = NextEditWindowService.getInstance(project) // val codeViewer = nextEditWindowService.createCodeViewer(prediction, "ts") - nextEditWindowService.showCodePreview(prediction, editor) + nextEditWindowService.showCodePreview(prediction, editor, completionId) // editor.contentComponent.removeAll() // editor.contentComponent.add(codeViewer) // editor.contentComponent.revalidate() @@ -293,7 +293,7 @@ class NextEditService(private val project: Project) { editor.caretModel.moveToOffset(offset + text.length) project.service().coreMessenger?.request( - "autocomplete/accept", + "nextEdit/accept", hashMapOf("completionId" to completion.completionId), null, ({}) @@ -357,17 +357,17 @@ class NextEditService(private val project: Project) { renderCompletion(editor, completion.offset, completion.text!!) } - private fun cancelCompletion(completion: PendingCompletion) { - // Send cancellation message to core + private fun rejectCompletion(completion: PendingCompletion) { + // Send rejection message to core widget?.setLoading(false) - project.service().coreMessenger?.request("autocomplete/cancel", null, null, ({})) + project.service().coreMessenger?.request("nextEdit/reject", null, null, ({})) } fun clearCompletions(editor: Editor, completion: PendingCompletion? = pendingCompletion) { if (isInjectedFile(editor)) return if (completion != null) { - cancelCompletion(completion) +// cancelCompletion(completion) if (completion.completionId == pendingCompletion?.completionId) pendingCompletion = null } disposeInlayRenderer(editor) diff --git a/extensions/intellij/src/main/resources/META-INF/plugin.xml b/extensions/intellij/src/main/resources/META-INF/plugin.xml index aa9a81989..bbc184a50 100644 --- a/extensions/intellij/src/main/resources/META-INF/plugin.xml +++ b/extensions/intellij/src/main/resources/META-INF/plugin.xml @@ -169,6 +169,13 @@ + + + + + From f695cbc4d8fe3aed734c9de6125af4a3bfb7dbff Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Wed, 9 Jul 2025 09:53:56 -0700 Subject: [PATCH 13/22] bug: fix next edit outcome not logging for jetbrains --- core/nextEdit/NextEditProvider.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/nextEdit/NextEditProvider.ts b/core/nextEdit/NextEditProvider.ts index 1a56817cb..0f0d6ff48 100644 --- a/core/nextEdit/NextEditProvider.ts +++ b/core/nextEdit/NextEditProvider.ts @@ -271,6 +271,14 @@ export class NextEditProvider { cursorPosition: helper.pos, ...helper.options, }; + + // When using the JetBrains extension, mark as displayed. + // This helps us not need to make additional network calls just to mark as displayed. + const ideType = (await this.ide.getIdeInfo()).ideType; + if (ideType === "jetbrains") { + this.markDisplayed(input.completionId, outcomeNext); + } + return outcomeNext; } else { return undefined; @@ -323,6 +331,14 @@ export class NextEditProvider { cursorPosition: helper.pos, ...helper.options, }; + + // When using the JetBrains extension, mark as displayed. + // This helps us not need to make additional network calls just to mark as displayed. + const ideType = (await this.ide.getIdeInfo()).ideType; + if (ideType === "jetbrains") { + this.markDisplayed(input.completionId, outcomeNext); + } + return outcomeNext; } else { return undefined; From 217ad94aad26eef40c394f58a526218699849308 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Wed, 9 Jul 2025 09:55:45 -0700 Subject: [PATCH 14/22] bump version --- binary/package-lock.json | 2 ++ extensions/vscode/package-lock.json | 6 ++++-- gui/package-lock.json | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/binary/package-lock.json b/binary/package-lock.json index 51e6f5cf9..11dd6505b 100644 --- a/binary/package-lock.json +++ b/binary/package-lock.json @@ -121,6 +121,8 @@ "@babel/preset-env": "^7.24.7", "@biomejs/biome": "1.6.4", "@google/generative-ai": "^0.11.4", + "@shikijs/colorized-brackets": "^3.7.0", + "@shikijs/transformers": "^3.7.0", "@types/diff": "^7.0.1", "@types/follow-redirects": "^1.14.4", "@types/jest": "^29.5.12", diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 0f87e013c..b1f582aac 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.55", + "version": "1.1.57", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.55", + "version": "1.1.57", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.14", @@ -173,6 +173,8 @@ "@babel/preset-env": "^7.24.7", "@biomejs/biome": "1.6.4", "@google/generative-ai": "^0.11.4", + "@shikijs/colorized-brackets": "^3.7.0", + "@shikijs/transformers": "^3.7.0", "@types/diff": "^7.0.1", "@types/follow-redirects": "^1.14.4", "@types/jest": "^29.5.12", diff --git a/gui/package-lock.json b/gui/package-lock.json index 8c53ca7ce..eb948d185 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -182,6 +182,8 @@ "@babel/preset-env": "^7.24.7", "@biomejs/biome": "1.6.4", "@google/generative-ai": "^0.11.4", + "@shikijs/colorized-brackets": "^3.7.0", + "@shikijs/transformers": "^3.7.0", "@types/diff": "^7.0.1", "@types/follow-redirects": "^1.14.4", "@types/jest": "^29.5.12", From ca9b44b3b3ec8959be2da065f77bf593129c4191 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 9 Jul 2025 11:16:53 -0700 Subject: [PATCH 15/22] Suppress stderr output from Windows registry queries --- core/control-plane/mdm/mdm.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/control-plane/mdm/mdm.ts b/core/control-plane/mdm/mdm.ts index c782105ed..6971a9882 100644 --- a/core/control-plane/mdm/mdm.ts +++ b/core/control-plane/mdm/mdm.ts @@ -132,7 +132,10 @@ function readMdmKeysWindows(): MdmKeys | undefined { try { // Use REG QUERY command to read registry values const licenseKeyCmd = `reg query "${regPath}" /v licenseKey`; - const licenseKeyOutput = execSync(licenseKeyCmd, { encoding: "utf8" }); + const licenseKeyOutput = execSync(licenseKeyCmd, { + encoding: "utf8", + stdio: ["pipe", "pipe", "pipe"], + }); // Extract values from command output const licenseKey = extractRegValue(licenseKeyOutput); if (licenseKey) { @@ -145,7 +148,10 @@ function readMdmKeysWindows(): MdmKeys | undefined { // Try HKEY_CURRENT_USER if not found in HKEY_LOCAL_MACHINE try { const licenseKeyCmd = `reg query "${userRegPath}" /v licenseKey`; - const licenseKeyOutput = execSync(licenseKeyCmd, { encoding: "utf8" }); + const licenseKeyOutput = execSync(licenseKeyCmd, { + encoding: "utf8", + stdio: ["pipe", "pipe", "pipe"], + }); // Extract values from command output const licenseKey = extractRegValue(licenseKeyOutput); if (licenseKey) { From 5cd9d16d0c1288c8c9316edfb98b38f874d88abb Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Wed, 9 Jul 2025 14:46:50 -0700 Subject: [PATCH 16/22] bug: fix duplicate autocomplete requests from passing --- .../AutocompleteEditorListener.kt | 10 +++++++ .../nextEdit/NextEditService.kt | 30 +++++++------------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt index 8ab90e7de..0c1bbcac5 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt @@ -40,6 +40,16 @@ class AutocompleteCaretListener : CaretListener { class AutocompleteDocumentListener(private val editorManager: FileEditorManager, private val editor: Editor) : DocumentListener { override fun documentChanged(event: DocumentEvent) { + // Ignore empty changes or changes where content didn't actually change. + if (event.newFragment.isEmpty() && event.oldFragment.isEmpty()) { + return + } + + // Make sure this is an actual text modification event. + if (!event.isWholeTextReplaced && event.offset == 0 && event.oldLength == 0 && event.newLength == 0) { + return + } + if (editor != editorManager.selectedTextEditor) { return } diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt index 51264db93..ca2a7d312 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt @@ -34,7 +34,7 @@ class NextEditService(private val project: Project) { } // To avoid triggering another completion on partial acceptance, - // we need to keep track of whether the last change was a partial accept + // we need to keep track of whether the last change was a partial accept. var lastChangeWasPartialAccept = false fun triggerNextEdit(editor: Editor) { @@ -47,12 +47,12 @@ class NextEditService(private val project: Project) { clearCompletions(pendingCompletion!!.editor) } - // Set pending completion + // Set pending completion. val completionId = uuid() val offset = editor.caretModel.primaryCaret.offset pendingCompletion = PendingCompletion(editor, offset, completionId, null) - // Request a completion from the core + // Request a completion from the core. val virtualFile = FileDocumentManager.getInstance().getFile(editor.document) val uri = virtualFile?.toUriOrNull() ?: return @@ -89,7 +89,7 @@ class NextEditService(private val project: Project) { if (predictions.isNotEmpty()) { val prediction = predictions[0].toString() val oldEditRange = predictions[1].toString() - // TODO: Check if the prediction is purely additive. + // Check if the prediction is purely additive. val result = checkFim( oldEditRange, prediction, @@ -97,7 +97,7 @@ class NextEditService(private val project: Project) { ) when (result) { is FimResult.FimEdit -> { - // TODO: If so, render ghost text. + // If so, render ghost text. val finalTextToInsert = deduplicateCompletion(editor, offset, result.fimText) if (shouldRenderCompletion(finalTextToInsert, offset, line, editor)) { renderCompletion(editor, offset, finalTextToInsert) @@ -105,23 +105,13 @@ class NextEditService(private val project: Project) { } } is FimResult.NotFimEdit -> { - // TODO: Else, render a window. - // val nextEditWindowService = project.service() - val nextEditWindowService = NextEditWindowService.getInstance(project) -// val codeViewer = nextEditWindowService.createCodeViewer(prediction, "ts") - nextEditWindowService.showCodePreview(prediction, editor, completionId) -// editor.contentComponent.removeAll() -// editor.contentComponent.add(codeViewer) -// editor.contentComponent.revalidate() -// editor.contentComponent.repaint() + // Else, render a window. + if (shouldRenderCompletion(prediction, offset, line, editor)) { + val nextEditWindowService = NextEditWindowService.getInstance(project) + nextEditWindowService.showCodePreview(prediction, editor, completionId) + } } } -// val finalTextToInsert = deduplicateCompletion(editor, offset, completion) -// -// if (shouldRenderCompletion(finalTextToInsert, offset, line, editor)) { -// renderCompletion(editor, offset, finalTextToInsert) -// pendingCompletion = PendingCompletion(editor, offset, completionId, finalTextToInsert) -// } } }) ) From 1290d9a851c5928920f7155327a237143a3aec7a Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Thu, 10 Jul 2025 15:37:43 -0700 Subject: [PATCH 17/22] fix failing autocomplete test --- .../AutocompleteEditorListener.kt | 20 +++++++++++++++++-- .../e2e/Autocomplete.kt | 6 +++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt index 0c1bbcac5..9fca20413 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt @@ -61,6 +61,22 @@ class AutocompleteDocumentListener(private val editorManager: FileEditorManager, val nextEditService = editor.project?.service() ?: return + // Check if we're in a test environment based on some property or condition + val isAutocompleteTestEnvironment = System.getProperty("continue.autocomplete.test.environment") == "true" + val isNextEditTestEnvironment = System.getProperty("continue.nextEdit.test.environment") == "true" + + if (isAutocompleteTestEnvironment) { + invokeLater { + service.triggerCompletion(editor) + } + return + } else if (isNextEditTestEnvironment) { + invokeLater { + nextEditService.triggerNextEdit(editor) + } + return + } + // Check settings to see if next edit is enabled, and then trigger either autocomplete or next exit. val continuePluginService = editor.project?.service() if (continuePluginService == null) { @@ -71,14 +87,14 @@ class AutocompleteDocumentListener(private val editorManager: FileEditorManager, "config/getSerializedProfileInfo", null, null, - (request@ { response -> + ({ response -> val optInNextEditFeature = response.castNestedOrNull( "content", "result", "config", "experimental", "optInNextEditFeature" - ) ?: return@request + ) ?: false invokeLater { if (optInNextEditFeature) { diff --git a/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/e2e/Autocomplete.kt b/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/e2e/Autocomplete.kt index 694ce526f..a8bdab796 100644 --- a/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/e2e/Autocomplete.kt +++ b/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/e2e/Autocomplete.kt @@ -28,11 +28,15 @@ class Autocomplete { @BeforeEach fun waitForIde(remoteRobot: RemoteRobot) { + System.setProperty("continue.autocomplete.test.environment", "true") waitForIgnoringError(ofMinutes(3)) { remoteRobot.callJs("true") } } @AfterEach - fun closeProject(remoteRobot: RemoteRobot) = CommonSteps(remoteRobot).closeProject() + fun closeProject(remoteRobot: RemoteRobot) { + System.clearProperty("continue.autocomplete.test.environment") + CommonSteps(remoteRobot).closeProject() + } @Test @Video From e352ff1a7daec67f53270582c253ab2b0614f282 Mon Sep 17 00:00:00 2001 From: HQ1363 <46860462+HQ1363@users.noreply.github.com> Date: Mon, 14 Jul 2025 16:45:54 +0800 Subject: [PATCH 18/22] Update ContinuePluginToolWindowFactory.kt fix JCEF. NullPointerException: Cannot read field "objId" because "robj" is null --- .../toolWindow/ContinuePluginToolWindowFactory.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinuePluginToolWindowFactory.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinuePluginToolWindowFactory.kt index 492356ed3..4afa1cb45 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinuePluginToolWindowFactory.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinuePluginToolWindowFactory.kt @@ -46,6 +46,7 @@ class ContinuePluginToolWindowFactory : ToolWindowFactory, DumbAware { init { System.setProperty("ide.browser.jcef.jsQueryPoolSize", JS_QUERY_POOL_SIZE) System.setProperty("ide.browser.jcef.contextMenu.devTools.enabled", "true") + System.setProperty("ide.browser.jcef.out-of-process.enabled", "false") } val browser: ContinueBrowser by lazy { From b24e8c5c4bb4dd4a915b0fc67af558fb66ce1608 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Mon, 14 Jul 2025 11:11:25 -0700 Subject: [PATCH 19/22] test: add unit tests for checkFim --- .../unit/CheckFimTest.kt | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/CheckFimTest.kt diff --git a/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/CheckFimTest.kt b/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/CheckFimTest.kt new file mode 100644 index 000000000..b23bcf7ec --- /dev/null +++ b/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/CheckFimTest.kt @@ -0,0 +1,51 @@ +package com.github.continuedev.continueintellijextension.unit + +import com.github.continuedev.continueintellijextension.FimResult +import com.github.continuedev.continueintellijextension.`continue`.UriUtils +import com.github.continuedev.continueintellijextension.utils.checkFim +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test +import java.io.File +import kotlin.test.assertEquals + +class CheckFimTest { + @Test + fun testFim() { + val oldEditRange = "hello world" + val newEditRange = "hello this world" + val cursorPosition = Pair(0, 6) + assertEquals(checkFim(oldEditRange, newEditRange, cursorPosition), FimResult.FimEdit("this ")) + } + + @Test + fun testMultilineFim() { + val oldEditRange = "hello {\n world\n}" + val newEditRange = "hello {\n print()\n world\n}" + val cursorPosition = Pair(1, 2) + assertEquals(checkFim(oldEditRange, newEditRange, cursorPosition), FimResult.FimEdit("print()\n ")) + } + + @Test + fun testNotFim() { + val oldEditRange = "hello world" + val newEditRange = "hello this world" + val cursorPosition = Pair(0, 8) + assertEquals(checkFim(oldEditRange, newEditRange, cursorPosition), FimResult.NotFimEdit) + } + + @Test + fun testMultilineNotFim() { + val oldEditRange = "hello {\n world\n}" + val newEditRange = "hello {\n world\n}\nprint()" + val cursorPosition = Pair(1, 2) + assertEquals(checkFim(oldEditRange, newEditRange, cursorPosition), FimResult.NotFimEdit) + } + + @Test + fun testFimEdge() { + val oldEditRange = "" + val newEditRange = "" + val cursorPosition = Pair(0, 0) + assertEquals(checkFim(oldEditRange, newEditRange, cursorPosition), FimResult.FimEdit("")) + } +} From cab30737b87783f381ec371fb7d1b5edce2e1325 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Mon, 14 Jul 2025 11:13:22 -0700 Subject: [PATCH 20/22] refactor: move checkFim and FimResult to utils for easier testing --- .../nextEdit/NextEditService.kt | 73 +------------------ .../continueintellijextension/types.kt | 7 +- .../continueintellijextension/utils/Utils.kt | 68 +++++++++++++++++ 3 files changed, 76 insertions(+), 72 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt index ca2a7d312..f9279b9b9 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/nextEdit/NextEditService.kt @@ -1,5 +1,6 @@ package com.github.continuedev.continueintellijextension.nextEdit +import com.github.continuedev.continueintellijextension.FimResult import com.github.continuedev.continueintellijextension.autocomplete.AutocompleteLookupListener import com.github.continuedev.continueintellijextension.autocomplete.AutocompleteSpinnerWidget import com.github.continuedev.continueintellijextension.autocomplete.ContinueInlayRenderer @@ -8,6 +9,7 @@ import com.github.continuedev.continueintellijextension.autocomplete.addInlayEle import com.github.continuedev.continueintellijextension.autocomplete.isInjectedText import com.github.continuedev.continueintellijextension.services.ContinueExtensionSettings import com.github.continuedev.continueintellijextension.services.ContinuePluginService +import com.github.continuedev.continueintellijextension.utils.checkFim import com.github.continuedev.continueintellijextension.utils.toUriOrNull import com.github.continuedev.continueintellijextension.utils.uuid import com.intellij.openapi.application.ApplicationManager @@ -117,77 +119,6 @@ class NextEditService(private val project: Project) { ) } - sealed class FimResult { - data class FimEdit(val fimText: String) : FimResult() - object NotFimEdit : FimResult() - } - /** - * Check if the diff is indeed a FIM (Fill-In-Middle). - * @param oldEditRange Original string content. - * @param newEditRange New string content. - * @param cursorPosition The position of the cursor in the old string. - * @return A Pair where the first value is a boolean indicating if the change is purely additive (FIM) - * and the second value is the FIM text content or null if not a FIM. - */ - private fun checkFim( - oldEditRange: String, - newEditRange: String, - cursorPosition: Pair // line, character - ): FimResult { - // Find the common prefix - var prefixLength = 0 - while (prefixLength < oldEditRange.length && - prefixLength < newEditRange.length && - oldEditRange[prefixLength] == newEditRange[prefixLength]) { - prefixLength++ - } - - // Find the common suffix - var oldSuffixPos = oldEditRange.length - 1 - var newSuffixPos = newEditRange.length - 1 - - while (oldSuffixPos >= prefixLength && - newSuffixPos >= prefixLength && - oldEditRange[oldSuffixPos] == newEditRange[newSuffixPos]) { - oldSuffixPos-- - newSuffixPos-- - } - - // The old text is purely preserved if: - // 1. The prefix ends before or at the cursor. - // 2. The suffix starts after or at the cursor. - // 3. There's no gap between prefix and suffix in the old text. - - val suffixStartInOld = oldSuffixPos + 1 - val suffixStartInNew = newSuffixPos + 1 - - // Convert cursor position to an offset in the string. - // For simplicity, we need to calculate the cursor's position in the string. - // This requires knowledge of line endings in the oldEditRange. - val lines = oldEditRange.substring(0, prefixLength).split("\n") - val cursorOffset = if (lines.size > 1) { - lines.dropLast(1).sumOf { it.length + 1 } + cursorPosition.second - } else { - cursorPosition.second - } - - // Check if the cursor is positioned between the prefix and suffix. - val cursorBetweenPrefixAndSuffix = - prefixLength <= cursorOffset && cursorOffset <= suffixStartInOld - - // Check if the old text is completely preserved (no deletion). - val noTextDeleted = suffixStartInOld - prefixLength <= 0 - - val isFim = cursorBetweenPrefixAndSuffix && noTextDeleted - - return if (isFim) { - // Extract the content between prefix and suffix in the new string. - FimResult.FimEdit(newEditRange.substring(prefixLength, suffixStartInNew)) - } else { - FimResult.NotFimEdit - } - } - private fun shouldRenderCompletion(completion: String, offset: Int, line: Int, editor: Editor): Boolean { if (completion.isEmpty() || runReadAction { offset != editor.caretModel.offset }) { return false diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/types.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/types.kt index 5ff9e9454..dae734881 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/types.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/types.kt @@ -247,4 +247,9 @@ data class AcceptOrRejectDiffPayload( data class ShowFilePayload( val filepath: String -) \ No newline at end of file +) + +sealed class FimResult { + data class FimEdit(val fimText: String) : FimResult() + object NotFimEdit : FimResult() +} \ No newline at end of file diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/utils/Utils.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/utils/Utils.kt index 52a4884f0..888b59359 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/utils/Utils.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/utils/Utils.kt @@ -1,5 +1,6 @@ package com.github.continuedev.continueintellijextension.utils +import com.github.continuedev.continueintellijextension.FimResult import com.intellij.openapi.vfs.VirtualFile import java.net.NetworkInterface import java.util.* @@ -117,4 +118,71 @@ fun getOsAndArchTarget(): String { } return "$osStr-$arch" +} + +/** + * Check if the diff is indeed a FIM (Fill-In-Middle). + * @param oldEditRange Original string content. + * @param newEditRange New string content. + * @param cursorPosition The position of the cursor in the old string. + * @return A Pair where the first value is a boolean indicating if the change is purely additive (FIM) + * and the second value is the FIM text content or null if not a FIM. + */ +fun checkFim( + oldEditRange: String, + newEditRange: String, + cursorPosition: Pair // line, character +): FimResult { + // Find the common prefix + var prefixLength = 0 + while (prefixLength < oldEditRange.length && + prefixLength < newEditRange.length && + oldEditRange[prefixLength] == newEditRange[prefixLength]) { + prefixLength++ + } + + // Find the common suffix + var oldSuffixPos = oldEditRange.length - 1 + var newSuffixPos = newEditRange.length - 1 + + while (oldSuffixPos >= prefixLength && + newSuffixPos >= prefixLength && + oldEditRange[oldSuffixPos] == newEditRange[newSuffixPos]) { + oldSuffixPos-- + newSuffixPos-- + } + + // The old text is purely preserved if: + // 1. The prefix ends before or at the cursor. + // 2. The suffix starts after or at the cursor. + // 3. There's no gap between prefix and suffix in the old text. + + val suffixStartInOld = oldSuffixPos + 1 + val suffixStartInNew = newSuffixPos + 1 + + // Convert cursor position to an offset in the string. + // For simplicity, we need to calculate the cursor's position in the string. + // This requires knowledge of line endings in the oldEditRange. + val lines = oldEditRange.substring(0, prefixLength).split("\n") + val cursorOffset = if (lines.size > 1) { + lines.dropLast(1).sumOf { it.length + 1 } + cursorPosition.second + } else { + cursorPosition.second + } + + // Check if the cursor is positioned between the prefix and suffix. + val cursorBetweenPrefixAndSuffix = + prefixLength <= cursorOffset && cursorOffset <= suffixStartInOld + + // Check if the old text is completely preserved (no deletion). + val noTextDeleted = suffixStartInOld - prefixLength <= 0 + + val isFim = cursorBetweenPrefixAndSuffix && noTextDeleted + + return if (isFim) { + // Extract the content between prefix and suffix in the new string. + FimResult.FimEdit(newEditRange.substring(prefixLength, suffixStartInNew)) + } else { + FimResult.NotFimEdit + } } \ No newline at end of file From 252c60a76e59bc5066edc18294f97eb0e1ffffa7 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Wed, 16 Jul 2025 02:26:46 -0700 Subject: [PATCH 21/22] docs: Update MCP documentation and add CLA - Update MCP documentation in docs/reference/continue-mcp.mdx - Simplify MCP deep dive documentation - Add CLA.md file - Update CLA workflow - Remove continue-docs-mcp.yaml - Add mintlify CLI selection tree image - Update docs.json configuration Co-Authored-By: Brian Douglas --- .continue/mcpServers/continue-docs-mcp.yaml | 11 ----- .github/workflows/cla.yaml | 2 +- CLA.md | 48 ++++++++++++++++++++ docs/customize/deep-dives/mcp.mdx | 36 +-------------- docs/docs.json | 3 +- docs/images/mintlify-cli-selection-tree.png | Bin 0 -> 35119 bytes docs/reference/continue-mcp.mdx | 31 ++++++++----- 7 files changed, 71 insertions(+), 60 deletions(-) delete mode 100644 .continue/mcpServers/continue-docs-mcp.yaml create mode 100644 CLA.md create mode 100644 docs/images/mintlify-cli-selection-tree.png diff --git a/.continue/mcpServers/continue-docs-mcp.yaml b/.continue/mcpServers/continue-docs-mcp.yaml deleted file mode 100644 index a295b5546..000000000 --- a/.continue/mcpServers/continue-docs-mcp.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: Continue Documentation MCP -version: 0.0.1 -schema: v1 -mcpServers: - - name: Continue Docs Search - type: stdio - command: npx - args: - - mint-mcp - - add - - continue-docs diff --git a/.github/workflows/cla.yaml b/.github/workflows/cla.yaml index 5d5ce3933..225439ced 100644 --- a/.github/workflows/cla.yaml +++ b/.github/workflows/cla.yaml @@ -24,7 +24,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: path-to-signatures: "signatures/version1/cla.json" - path-to-document: "https://github.com/continuedev/continue/blob/main/docs/docs/CLA.md" + path-to-document: "https://github.com/continuedev/continue/blob/main/CLA.md" branch: cla-signatures # Bots and CLAs signed outside of GitHub allowlist: dependabot[bot],fbricon,panyamkeerthana,Jazzcort,owtaylor,halfline diff --git a/CLA.md b/CLA.md new file mode 100644 index 000000000..a23e12a1e --- /dev/null +++ b/CLA.md @@ -0,0 +1,48 @@ +# Individual Contributor License Agreement (v1.0, Continue) + +_Based on the Apache Software Foundation Individual CLA v 2.2._ + +By commenting **“I have read the CLA Document and I hereby sign the CLA”** +on a Pull Request, **you (“Contributor”) agree to the following terms** for any +past and future “Contributions” submitted to **Continue (the “Project”)**. + +--- + +## 1. Definitions + +- **“Contribution”** – any original work of authorship submitted to the Project + (code, documentation, designs, etc.). +- **“You” / “Your”** – the individual (or legal entity) posting the acceptance + comment. + +## 2. Copyright License + +You grant **Continue Dev, Inc.** and all recipients of software distributed by the +Project a perpetual, worldwide, non‑exclusive, royalty‑free, irrevocable +license to reproduce, prepare derivative works of, publicly display, publicly +perform, sublicense, and distribute Your Contributions and derivative works. + +## 3. Patent License + +You grant **Continue Dev, Inc.** and all recipients of the Project a perpetual, +worldwide, non‑exclusive, royalty‑free, irrevocable (except as below) patent +license to make, have made, use, sell, offer to sell, import, and otherwise +transfer Your Contributions alone or in combination with the Project. + +If any entity brings patent litigation alleging that the Project or a +Contribution infringes a patent, the patent licenses granted by You to that +entity under this CLA terminate. + +## 4. Representations + +1. You are legally entitled to grant the licenses above. +2. Each Contribution is either Your original creation or You have authority to + submit it under this CLA. +3. Your Contributions are provided **“AS IS”** without warranties of any kind. +4. You will notify the Project if any statement above becomes inaccurate. + +## 5. Miscellany + +This Agreement is governed by the laws of the **State of California**, USA, +excluding its conflict‑of‑laws rules. If any provision is held unenforceable, +the remaining provisions remain in force. diff --git a/docs/customize/deep-dives/mcp.mdx b/docs/customize/deep-dives/mcp.mdx index c71d8c021..dcbff566e 100644 --- a/docs/customize/deep-dives/mcp.mdx +++ b/docs/customize/deep-dives/mcp.mdx @@ -57,41 +57,7 @@ The result will be a generated file called `hn.txt` in the current working direc You can set up an MCP server to search the Continue documentation directly from your agent. This is particularly useful for getting help with Continue configuration and features. -1. Create a folder called `.continue/mcpServers` at the top level of your workspace -2. Add a file called `continue-docs-mcp.yaml` to this folder -3. Write the following contents and save: - -```yaml title=".continue/mcpServers/continue-docs-mcp.yaml" -name: Continue Documentation MCP -version: 0.0.1 -schema: v1 -mcpServers: - - name: Continue Docs Search - type: stdio - command: npx - args: - - mint-mcp - - add - - continue-docs -``` - -Now you can search the Continue documentation by asking questions like: - -``` -Search for model setup instructions in the Continue docs -``` - -``` -Find documentation about context providers -``` - -``` -How do I configure autocomplete in Continue? -``` - -The MCP server will search the Continue documentation and provide relevant information to help with your questions. - -For detailed setup instructions and troubleshooting, see the [Continue MCP Reference](/reference/continue-mcp). +For complete setup instructions, troubleshooting, and usage examples, see the [Continue MCP Reference](/reference/continue-mcp). ## Using MCP Servers diff --git a/docs/docs.json b/docs/docs.json index 1cea55860..86657b4b8 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -258,7 +258,8 @@ "pages": [ "reference", "reference/json-reference", - "reference/yaml-migration" + "reference/yaml-migration", + "reference/continue-mcp" ] } ] diff --git a/docs/images/mintlify-cli-selection-tree.png b/docs/images/mintlify-cli-selection-tree.png new file mode 100644 index 0000000000000000000000000000000000000000..0c81517e191cc46c61c891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p.mdx +++ b/docs/reference/continue-mcp.mdx @@ -4,45 +4,52 @@ description: Set up an MCP server to search Continue documentation keywords: [mcp, documentation, search, mintlify, reference] --- -# Continue Documentation MCP Server - -The Continue Documentation MCP Server allows you to search and retrieve information from the Continue documentation directly within your agent conversations. This is powered by Mintlify's MCP server generation. +The continue-docs MCP Server allows you to search and retrieve information from the Continue documentation directly within your agent conversations. This is powered by Mintlify's MCP server generation. ## Installation ### Step 1: Install the MCP Server -Run the following command to install the Continue documentation MCP server: +Run the following command to install the continue-docs MCP server: ```bash -npx mint-mcp add continue-docs +npx mint-mcp add docs.continue.dev ``` -This will: +When prompted, select "All" from the selection menu: + +![mintlify cli selection tree](/images/mintlify-cli-selection-tree.png) + +This command will: - Download and install the MCP server locally - Set up the search tool for Continue documentation - Create the necessary configuration files + +Take note of the installation path displayed after running the command above. You'll need to replace in the configuration below with your actual installation path. + +It will look like this: `/path/to/user/.mcp/docs.continue.dev/src/index.js` + + + ### Step 2: Configure Continue 1. Create a folder called `.continue/mcpServers` at the top level of your workspace 2. Add a file called `continue-docs-mcp.yaml` to this folder 3. Write the following contents and save: +````yaml title=".continue/mcpServers/continue-docs-mcp.yaml" ```yaml title=".continue/mcpServers/continue-docs-mcp.yaml" name: Continue Documentation MCP version: 0.0.1 schema: v1 mcpServers: - name: Continue Docs Search - type: stdio - command: npx + command: node args: - - mint-mcp - - add - - continue-docs -``` + - "/path/to/user/.mcp/docs.continue.dev/src/index.js" +```` ### Step 3: Enable Agent Mode From f59863ba70793a98460056d967f982ca457a6315 Mon Sep 17 00:00:00 2001 From: Jazzcort Date: Tue, 8 Jul 2025 09:35:16 -0400 Subject: [PATCH 22/22] Fix: add sanitizing process to strip off the trailing slash of the doc URL In this patch, we add a sanitizing process to strip off the trailing forward slash (if any) in the given URL before generating the file path for S3 bucket. Therefore, both variants (url with / and without /) in the config file can be treated the same. https://github.com/continuedev/continue/issues/6454 --- core/indexing/docs/DocsCache.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/indexing/docs/DocsCache.ts b/core/indexing/docs/DocsCache.ts index f250b797c..caa30139b 100644 --- a/core/indexing/docs/DocsCache.ts +++ b/core/indexing/docs/DocsCache.ts @@ -7,6 +7,15 @@ export interface SiteIndexingResults { title: string; } +/** + * Strip off the trailing forward slash from the given URL + * @param url The URL of the document + * @returns A sanitized URL without trailing forward slash + */ +const stripTrailingSlash = (url: string): string => { + return url.replace(/\/+$/, ""); +}; + export class DocsCache { static readonly AWS_REGION: string = "us-west-1"; static readonly BUCKET_NAME: string = "continue-preindexed-docs"; @@ -33,7 +42,8 @@ export class DocsCache { url: string, ): string { const normalizedEmbeddingId = DocsCache.normalizeEmbeddingId(embeddingId); - const normalizedUrl = encodeURIComponent(url.replace(/\//g, "_")); + const sanitizedUrl = stripTrailingSlash(url); + const normalizedUrl = encodeURIComponent(sanitizedUrl.replace(/\//g, "_")); return normalizedEmbeddingId + "/" + normalizedUrl; }