Skip to content

Commit

Permalink
1.6.7 (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
acharneski authored Oct 10, 2024
1 parent 901a105 commit 97af8d9
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 31 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repositories {
val kotlin_version = "2.0.20" // This is now defined in the plugins block
val jetty_version = "11.0.24"
val slf4j_version = "2.0.16"
val skyenet_version = "1.2.7"
val skyenet_version = "1.2.8"
val remoterobot_version = "0.11.23"
val jackson_version = "2.17.2"

Expand All @@ -45,7 +45,7 @@ dependencies {
implementation("com.googlecode.java-diff-utils:diffutils:1.3.0")
implementation(group = "org.apache.httpcomponents.client5", name = "httpclient5", version = "5.2.3")

implementation(group = "com.simiacryptus", name = "jo-penai", version = "1.1.6")
implementation(group = "com.simiacryptus", name = "jo-penai", version = "1.1.7")
implementation(group = "com.simiacryptus.skyenet", name = "kotlin", version = skyenet_version)
implementation(group = "com.simiacryptus.skyenet", name = "core", version = skyenet_version)
implementation(group = "com.simiacryptus.skyenet", name = "webui", version = skyenet_version)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pluginName=intellij-aicoder
pluginRepositoryUrl=https://github.com/SimiaCryptus/intellij-aicoder
pluginVersion=1.6.6
pluginVersion=1.6.7

jvmArgs=-Xmx12g
org.gradle.jvmargs=-Xmx12g -XX:MaxMetaspaceSize=1g
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ abstract class SelectionAction<T : Any>(
val editorState = editorState(editor)
val (start, end) = retarget(editorState, selectedText, selectionStart, selectionEnd) ?: return
val text = editorState.text
selectedText = text.substring(start.coerceIn(0, text.length), end.coerceIn(0, text.length))
selectionEnd = end.coerceIn(0, text.length)
selectionStart = start.coerceIn(0, text.length)
selectedText = text.substring(start.coerceIn(0, text.length-1), end.coerceIn(0, text.length-1))
selectionEnd = end.coerceIn(0, text.length-1)
selectionStart = start.coerceIn(0, text.length-1)

UITools.redoableTask(e) {
val document = e.getData(CommonDataKeys.EDITOR)?.document
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import com.github.simiacryptus.aicoder.util.BrowseUtil.browse
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.simiacryptus.jopenai.models.chatModel
import com.simiacryptus.skyenet.apps.parsers.DefaultParsingModel
import com.simiacryptus.skyenet.apps.parsers.CodeParsingModel
import com.simiacryptus.skyenet.apps.parsers.DocumentParsingModel
import com.simiacryptus.skyenet.apps.parsers.DocumentParserApp
import com.simiacryptus.skyenet.core.platform.StorageInterface
import com.simiacryptus.skyenet.core.platform.file.DataStorage
Expand Down Expand Up @@ -53,12 +54,17 @@ class DocumentDataExtractorAction : BaseAction() {
val pdfFile = selectedFile.toFile
DataStorage.sessionPaths[session] = pdfFile.parentFile

val parsingModel = when {
selectedFile.name.endsWith(".pdf", ignoreCase = true) -> DocumentParsingModel(AppSettingsState.instance.smartModel.chatModel(), 0.1)
selectedFile.name.endsWith(".txt", ignoreCase = true) -> DocumentParsingModel(AppSettingsState.instance.smartModel.chatModel(), 0.1)
else -> CodeParsingModel(AppSettingsState.instance.smartModel.chatModel(), 0.1)
}
val documentParserApp = object : DocumentParserApp(
applicationName = "Document Extractor",
path = path,
api = api,
fileInput = pdfFile.toPath(),
parsingModel = DefaultParsingModel(AppSettingsState.instance.smartModel.chatModel(), 0.1),
parsingModel = parsingModel,
) {
override fun <T : Any> initSettings(session: Session): T = settings as T
override val root: File get() = selectedFile.parent.toFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ class GenerateDocumentationAction : FileContextAction<GenerateDocumentationActio
val partitionedPaths = Files.walk(selectedFolder)
.filter { Files.isRegularFile(it) && !Files.isDirectory(it) }
.toList().groupBy { selectedPaths.contains(it) }
val pathList = partitionedPaths[true]!!
.toList().filterNotNull()
.map<Path, Future<Path>> { path ->
val pathList = partitionedPaths[true]
?.toList()?.filterNotNull()
?.map<Path, Future<Path>> { path ->
executorService.submit<Path?> {
var retries = 0
val maxRetries = 3
Expand Down Expand Up @@ -160,7 +160,7 @@ class GenerateDocumentationAction : FileContextAction<GenerateDocumentationActio
}
null
}
}.toTypedArray().map { future ->
}?.toTypedArray()?.map { future ->
try {
future.get(2, TimeUnit.MINUTES) // Set a timeout for each file processing
} catch (e: Exception) {
Expand All @@ -170,7 +170,7 @@ class GenerateDocumentationAction : FileContextAction<GenerateDocumentationActio
}
null
}
}.filterNotNull()
}?.filterNotNull() ?: listOf()
if (config?.settings?.singleOutputFile == true) {
Files.write(outputPath, markdownContent.toString().toByteArray())
open(config.project!!, outputPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,12 @@ class PlanAheadConfigDialog(
settings.commandAutoFixCommands = (0 until tableModel.rowCount)
.filter { tableModel.getValueAt(it, 0) as Boolean }
.map { tableModel.getValueAt(it, 1) as String }
// Update the global tool collection
AppSettingsState.instance.executables.clear()
AppSettingsState.instance.executables.addAll(settings.commandAutoFixCommands!!)
// Update the global tool collection without removing deselected commands
settings.commandAutoFixCommands!!.forEach { command ->
if (!AppSettingsState.instance.executables.contains(command)) {
AppSettingsState.instance.executables.add(command)
}
}
super.doOKAction()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.progress.Task
import com.intellij.openapi.vfs.VirtualFile
import com.simiacryptus.skyenet.apps.parsers.DefaultParsingModel
import com.simiacryptus.skyenet.apps.parsers.DocumentRecord.Companion.saveAsBinary
import org.slf4j.LoggerFactory
import java.io.File
Expand Down Expand Up @@ -45,7 +44,7 @@ class SaveAsQueryIndexAction : BaseAction() {
try {
indicator.isIndeterminate = false
indicator.fraction = 0.0
saveAsBinary(
saveAsBinary<Map<String,Any>>(
IdeaOpenAIClient.instance,
outputPath,
Executors.newFixedThreadPool(8),
Expand Down
25 changes: 12 additions & 13 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,14 @@
description="Smart paste functionality that automatically detects and converts clipboard content to match the current file's programming language">

<add-to-group group-id="com.github.simiacryptus.aicoder.ui.EditorMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="control shift V"/>
<keyboard-shortcut keymap="$default" first-keystroke="ctrl shift V"/>
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="meta shift V"/>
</action>
<action class="com.github.simiacryptus.aicoder.actions.code.FastPasteAction"
text="_Fast Paste"
description="Fast paste functionality using a less resource-intensive model for quick conversions.">
<add-to-group group-id="com.github.simiacryptus.aicoder.ui.EditorMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="control alt V"/>
<keyboard-shortcut keymap="$default" first-keystroke="ctrl alt V"/>
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="meta alt V"/>
</action>
<!-- Improved Shortcut for RedoLast Action -->
Expand All @@ -224,7 +224,7 @@
description="Quickly repeat the most recent intelligent coding operation in the current editor">

<add-to-group group-id="com.github.simiacryptus.aicoder.ui.EditorMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="control shift Z"/>
<keyboard-shortcut keymap="$default" first-keystroke="ctrl shift Z"/>
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="meta shift Z"/>
</action>
<!-- Improved Shortcut for DescribeAction -->
Expand All @@ -248,7 +248,7 @@
description="Add doc comments">

<add-to-group group-id="com.github.simiacryptus.aicoder.ui.EditorMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="control shift D"/>
<keyboard-shortcut keymap="$default" first-keystroke="ctrl shift D"/>
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="meta shift D"/>
</action>
<!-- Improved Shortcut for InsertImplementationAction -->
Expand All @@ -265,7 +265,7 @@

<add-to-group group-id="com.github.simiacryptus.aicoder.ui.EditorMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="control alt A"/>
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="meta option A"/>
<keyboard-shortcut keymap="Mac OS X" first-keystroke="meta alt A"/>
</action>
<!-- Improved Shortcut for RenameVariablesAction -->

Expand All @@ -275,16 +275,15 @@

<add-to-group group-id="com.github.simiacryptus.aicoder.ui.EditorMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="control alt R"/>
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="meta option R"/>
<keyboard-shortcut keymap="Mac OS X" first-keystroke="meta alt R"/>
</action>
<!-- Improved Shortcut for VoiceToTextAction -->
<action class="com.github.simiacryptus.aicoder.actions.legacy.VoiceToTextAction"
text="Voice to Text"
description="Convert spoken language into text using AI.">

<add-to-group group-id="com.github.simiacryptus.aicoder.ui.EditorMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="control alt V"/>
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="meta option V"/>
<keyboard-shortcut keymap="Mac OS X" first-keystroke="meta alt V"/>
</action>
<!-- Improved Shortcut for ReplaceWithSuggestionsAction -->
<action class="com.github.simiacryptus.aicoder.actions.legacy.ReplaceWithSuggestionsAction"
Expand All @@ -293,7 +292,7 @@

<add-to-group group-id="com.github.simiacryptus.aicoder.ui.EditorMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="control alt R"/>
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="meta option R"/>
<keyboard-shortcut keymap="Mac OS X" first-keystroke="meta alt R"/>
</action>
<!-- Improved Shortcut for AppendTextWithChatAction -->
<action class="com.github.simiacryptus.aicoder.actions.legacy.AppendTextWithChatAction"
Expand All @@ -308,7 +307,7 @@

<add-to-group group-id="com.github.simiacryptus.aicoder.ui.EditorMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="control alt I"/>
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="meta option I"/>
<keyboard-shortcut keymap="Mac OS X" first-keystroke="meta alt I"/>
</action>
<!-- Improved Shortcut for CommentsAction -->
<action class="com.github.simiacryptus.aicoder.actions.legacy.CommentsAction"
Expand All @@ -317,7 +316,7 @@

<add-to-group group-id="com.github.simiacryptus.aicoder.ui.EditorMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="control alt C"/>
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="meta option C"/>
<keyboard-shortcut keymap="Mac OS X" first-keystroke="meta alt C"/>
</action>
<!-- Improved Shortcut for DocAction -->
<action class="com.github.simiacryptus.aicoder.actions.legacy.DocAction"
Expand All @@ -326,7 +325,7 @@

<add-to-group group-id="com.github.simiacryptus.aicoder.ui.EditorMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="control alt D"/>
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="meta option D"/>
<keyboard-shortcut keymap="Mac OS X" first-keystroke="meta alt D"/>
</action>
<!-- Improved Shortcut for ImplementStubAction -->
<action class="com.github.simiacryptus.aicoder.actions.legacy.ImplementStubAction"
Expand All @@ -335,7 +334,7 @@

<add-to-group group-id="com.github.simiacryptus.aicoder.ui.EditorMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="control alt S"/>
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="meta option S"/>
<keyboard-shortcut keymap="Mac OS X" first-keystroke="meta alt S"/>
</action>

<action id="com.github.simiacryptus.aicoder.actions.git.ChatWithCommitAction"
Expand Down

0 comments on commit 97af8d9

Please sign in to comment.