Skip to content

Commit 97af8d9

Browse files
authored
1.6.7 (#190)
1 parent 901a105 commit 97af8d9

File tree

8 files changed

+38
-31
lines changed

8 files changed

+38
-31
lines changed

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repositories {
2828
val kotlin_version = "2.0.20" // This is now defined in the plugins block
2929
val jetty_version = "11.0.24"
3030
val slf4j_version = "2.0.16"
31-
val skyenet_version = "1.2.7"
31+
val skyenet_version = "1.2.8"
3232
val remoterobot_version = "0.11.23"
3333
val jackson_version = "2.17.2"
3434

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

48-
implementation(group = "com.simiacryptus", name = "jo-penai", version = "1.1.6")
48+
implementation(group = "com.simiacryptus", name = "jo-penai", version = "1.1.7")
4949
implementation(group = "com.simiacryptus.skyenet", name = "kotlin", version = skyenet_version)
5050
implementation(group = "com.simiacryptus.skyenet", name = "core", version = skyenet_version)
5151
implementation(group = "com.simiacryptus.skyenet", name = "webui", version = skyenet_version)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pluginName=intellij-aicoder
22
pluginRepositoryUrl=https://github.com/SimiaCryptus/intellij-aicoder
3-
pluginVersion=1.6.6
3+
pluginVersion=1.6.7
44

55
jvmArgs=-Xmx12g
66
org.gradle.jvmargs=-Xmx12g -XX:MaxMetaspaceSize=1g

src/main/kotlin/com/github/simiacryptus/aicoder/actions/SelectionAction.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ abstract class SelectionAction<T : Any>(
5555
val editorState = editorState(editor)
5656
val (start, end) = retarget(editorState, selectedText, selectionStart, selectionEnd) ?: return
5757
val text = editorState.text
58-
selectedText = text.substring(start.coerceIn(0, text.length), end.coerceIn(0, text.length))
59-
selectionEnd = end.coerceIn(0, text.length)
60-
selectionStart = start.coerceIn(0, text.length)
58+
selectedText = text.substring(start.coerceIn(0, text.length-1), end.coerceIn(0, text.length-1))
59+
selectionEnd = end.coerceIn(0, text.length-1)
60+
selectionStart = start.coerceIn(0, text.length-1)
6161

6262
UITools.redoableTask(e) {
6363
val document = e.getData(CommonDataKeys.EDITOR)?.document

src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DocumentDataExtractorAction.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import com.github.simiacryptus.aicoder.util.BrowseUtil.browse
88
import com.intellij.openapi.actionSystem.ActionUpdateThread
99
import com.intellij.openapi.actionSystem.AnActionEvent
1010
import com.simiacryptus.jopenai.models.chatModel
11-
import com.simiacryptus.skyenet.apps.parsers.DefaultParsingModel
11+
import com.simiacryptus.skyenet.apps.parsers.CodeParsingModel
12+
import com.simiacryptus.skyenet.apps.parsers.DocumentParsingModel
1213
import com.simiacryptus.skyenet.apps.parsers.DocumentParserApp
1314
import com.simiacryptus.skyenet.core.platform.StorageInterface
1415
import com.simiacryptus.skyenet.core.platform.file.DataStorage
@@ -53,12 +54,17 @@ class DocumentDataExtractorAction : BaseAction() {
5354
val pdfFile = selectedFile.toFile
5455
DataStorage.sessionPaths[session] = pdfFile.parentFile
5556

57+
val parsingModel = when {
58+
selectedFile.name.endsWith(".pdf", ignoreCase = true) -> DocumentParsingModel(AppSettingsState.instance.smartModel.chatModel(), 0.1)
59+
selectedFile.name.endsWith(".txt", ignoreCase = true) -> DocumentParsingModel(AppSettingsState.instance.smartModel.chatModel(), 0.1)
60+
else -> CodeParsingModel(AppSettingsState.instance.smartModel.chatModel(), 0.1)
61+
}
5662
val documentParserApp = object : DocumentParserApp(
5763
applicationName = "Document Extractor",
5864
path = path,
5965
api = api,
6066
fileInput = pdfFile.toPath(),
61-
parsingModel = DefaultParsingModel(AppSettingsState.instance.smartModel.chatModel(), 0.1),
67+
parsingModel = parsingModel,
6268
) {
6369
override fun <T : Any> initSettings(session: Session): T = settings as T
6470
override val root: File get() = selectedFile.parent.toFile

src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/GenerateDocumentationAction.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ class GenerateDocumentationAction : FileContextAction<GenerateDocumentationActio
126126
val partitionedPaths = Files.walk(selectedFolder)
127127
.filter { Files.isRegularFile(it) && !Files.isDirectory(it) }
128128
.toList().groupBy { selectedPaths.contains(it) }
129-
val pathList = partitionedPaths[true]!!
130-
.toList().filterNotNull()
131-
.map<Path, Future<Path>> { path ->
129+
val pathList = partitionedPaths[true]
130+
?.toList()?.filterNotNull()
131+
?.map<Path, Future<Path>> { path ->
132132
executorService.submit<Path?> {
133133
var retries = 0
134134
val maxRetries = 3
@@ -160,7 +160,7 @@ class GenerateDocumentationAction : FileContextAction<GenerateDocumentationActio
160160
}
161161
null
162162
}
163-
}.toTypedArray().map { future ->
163+
}?.toTypedArray()?.map { future ->
164164
try {
165165
future.get(2, TimeUnit.MINUTES) // Set a timeout for each file processing
166166
} catch (e: Exception) {
@@ -170,7 +170,7 @@ class GenerateDocumentationAction : FileContextAction<GenerateDocumentationActio
170170
}
171171
null
172172
}
173-
}.filterNotNull()
173+
}?.filterNotNull() ?: listOf()
174174
if (config?.settings?.singleOutputFile == true) {
175175
Files.write(outputPath, markdownContent.toString().toByteArray())
176176
open(config.project!!, outputPath)

src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/PlanAheadConfigDialog.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,12 @@ class PlanAheadConfigDialog(
232232
settings.commandAutoFixCommands = (0 until tableModel.rowCount)
233233
.filter { tableModel.getValueAt(it, 0) as Boolean }
234234
.map { tableModel.getValueAt(it, 1) as String }
235-
// Update the global tool collection
236-
AppSettingsState.instance.executables.clear()
237-
AppSettingsState.instance.executables.addAll(settings.commandAutoFixCommands!!)
235+
// Update the global tool collection without removing deselected commands
236+
settings.commandAutoFixCommands!!.forEach { command ->
237+
if (!AppSettingsState.instance.executables.contains(command)) {
238+
AppSettingsState.instance.executables.add(command)
239+
}
240+
}
238241
super.doOKAction()
239242
}
240243

src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/SaveAsQueryIndexAction.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import com.intellij.openapi.progress.ProgressIndicator
1111
import com.intellij.openapi.progress.ProgressManager
1212
import com.intellij.openapi.progress.Task
1313
import com.intellij.openapi.vfs.VirtualFile
14-
import com.simiacryptus.skyenet.apps.parsers.DefaultParsingModel
1514
import com.simiacryptus.skyenet.apps.parsers.DocumentRecord.Companion.saveAsBinary
1615
import org.slf4j.LoggerFactory
1716
import java.io.File
@@ -45,7 +44,7 @@ class SaveAsQueryIndexAction : BaseAction() {
4544
try {
4645
indicator.isIndeterminate = false
4746
indicator.fraction = 0.0
48-
saveAsBinary(
47+
saveAsBinary<Map<String,Any>>(
4948
IdeaOpenAIClient.instance,
5049
outputPath,
5150
Executors.newFixedThreadPool(8),

src/main/resources/META-INF/plugin.xml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,14 @@
208208
description="Smart paste functionality that automatically detects and converts clipboard content to match the current file's programming language">
209209

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

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

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

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

@@ -275,16 +275,15 @@
275275

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)