File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
src/main/kotlin/com/github/blarc/ai/commits/intellij/plugin Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 6
6
7
7
- Option to choose prompt per project.
8
8
9
+ ### Fixed
10
+
11
+ - Prompt does not contain diff for new files.
12
+
9
13
## [ 2.3.1] - 2024-09-11
10
14
11
15
### Fixed
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ package com.github.blarc.ai.commits.intellij.plugin
2
2
3
3
import com.github.blarc.ai.commits.intellij.plugin.AICommitsBundle.message
4
4
import com.intellij.openapi.ui.ValidationInfo
5
+ import com.intellij.openapi.vcs.FilePath
6
+ import com.intellij.openapi.vcs.changes.Change
5
7
import com.intellij.ui.dsl.builder.Cell
6
8
import com.intellij.ui.layout.ValidationInfoBuilder
7
9
import com.intellij.util.ui.ColumnInfo
@@ -71,3 +73,7 @@ fun String.wrap(length: Int): String {
71
73
72
74
return wrapped.toString()
73
75
}
76
+
77
+ fun Change.filePath (): FilePath ? {
78
+ return afterRevision?.file ? : beforeRevision?.file
79
+ }
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import java.nio.file.FileSystems
22
22
object AICommitsUtils {
23
23
24
24
fun isPathExcluded (path : String , project : Project ): Boolean {
25
- return ! AppSettings2 .instance.isPathExcluded(path) && ! project.service<ProjectSettings >().isPathExcluded(path)
25
+ return AppSettings2 .instance.isPathExcluded(path) || project.service<ProjectSettings >().isPathExcluded(path)
26
26
}
27
27
28
28
fun matchesGlobs (text : String , globs : Set <String >): Boolean {
@@ -98,14 +98,14 @@ object AICommitsUtils {
98
98
// go through included changes, create a map of repository to changes and discard nulls
99
99
val changesByRepository = includedChanges
100
100
.filter {
101
- it.virtualFile ?.path?.let { path ->
102
- isPathExcluded(path, project)
101
+ it.filePath() ?.path?.let { path ->
102
+ ! isPathExcluded(path, project)
103
103
} ? : false
104
104
}
105
105
.mapNotNull { change ->
106
- change.virtualFile ?.let { file ->
106
+ change.filePath() ?.let { filePath ->
107
107
gitRepositoryManager.getRepositoryForFileQuick(
108
- file
108
+ filePath
109
109
) to change
110
110
}
111
111
}
You can’t perform that action at this time.
0 commit comments