diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt index 2dfc3e3e1..782a878d6 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt @@ -592,6 +592,14 @@ class IntelliJIDE( throw NotImplementedError("gotoDefinition not implemented yet") } + override suspend fun gotoTypeDefinition(location: Location): List { + throw NotImplementedError("gotoTypeDefinition not implemented yet") + } + + override suspend fun getSignatureHelp(location: Location): SignatureHelp? { + throw NotImplementedError("getSignatureHelp not implemented yet") + } + override fun onDidChangeActiveTextEditor(callback: (filepath: String) -> Unit) { throw NotImplementedError("onDidChangeActiveTextEditor not implemented yet") } 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..dd898eca2 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 @@ -63,6 +63,68 @@ data class RangeInFileWithContents( val contents: String ) +/** + * Signature help represents the signature of something + * callable. There can be multiple signatures but only one + * active and only one active parameter. + */ +data class SignatureHelp( + /** + * One or more signatures. + */ + val signatures: List, + + /** + * The active signature. + */ + val activeSignature: Int, + + /** + * The active parameter of the active signature. + */ + val activeParameter: Int +) + +/** + * Represents the signature of something callable. A signature + * can have a label, like a function-name, a doc-comment, and + * a set of parameters. + */ +data class SignatureInformation( + /** + * The label of this signature. Will be shown in + * the UI. + */ + val label: String, + + /** + * The parameters of this signature. + */ + val parameters: List, + + /** + * The index of the active parameter. + * + * If provided, this is used in place of [SignatureHelp.activeParameter]. + */ + val activeParameter: Int? = null +) + +/** + * Represents a parameter of a callable-signature. A parameter can + * have a label and a doc-comment. + */ +data class ParameterInformation( + /** + * The label of this signature. + * + * Either a string or inclusive start and exclusive end offsets within its containing + * [SignatureInformation.label] signature label. *Note*: A label of type string must be + * a substring of its containing signature information's [SignatureInformation.label] label. + */ + val label: String // Note: Kotlin doesn't have union types, so this represents the string case +) + data class ControlPlaneSessionInfo( val accessToken: String, val account: Account @@ -191,6 +253,8 @@ interface IDE { // LSP suspend fun gotoDefinition(location: Location): List + suspend fun gotoTypeDefinition(location: Location): List + suspend fun getSignatureHelp(location: Location): SignatureHelp? // Callbacks fun onDidChangeActiveTextEditor(callback: (filepath: String) -> Unit)