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 66
77- Option to choose prompt per project.
88
9+ ### Fixed
10+
11+ - Prompt does not contain diff for new files.
12+
913## [ 2.3.1] - 2024-09-11
1014
1115### Fixed
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ package com.github.blarc.ai.commits.intellij.plugin
22
33import com.github.blarc.ai.commits.intellij.plugin.AICommitsBundle.message
44import com.intellij.openapi.ui.ValidationInfo
5+ import com.intellij.openapi.vcs.FilePath
6+ import com.intellij.openapi.vcs.changes.Change
57import com.intellij.ui.dsl.builder.Cell
68import com.intellij.ui.layout.ValidationInfoBuilder
79import com.intellij.util.ui.ColumnInfo
@@ -71,3 +73,7 @@ fun String.wrap(length: Int): String {
7173
7274 return wrapped.toString()
7375}
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
2222object AICommitsUtils {
2323
2424 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)
2626 }
2727
2828 fun matchesGlobs (text : String , globs : Set <String >): Boolean {
@@ -98,14 +98,14 @@ object AICommitsUtils {
9898 // go through included changes, create a map of repository to changes and discard nulls
9999 val changesByRepository = includedChanges
100100 .filter {
101- it.virtualFile ?.path?.let { path ->
102- isPathExcluded(path, project)
101+ it.filePath() ?.path?.let { path ->
102+ ! isPathExcluded(path, project)
103103 } ? : false
104104 }
105105 .mapNotNull { change ->
106- change.virtualFile ?.let { file ->
106+ change.filePath() ?.let { filePath ->
107107 gitRepositoryManager.getRepositoryForFileQuick(
108- file
108+ filePath
109109 ) to change
110110 }
111111 }
You can’t perform that action at this time.
0 commit comments