Skip to content

Commit 1a8c609

Browse files
committed
Correcting the chnages for FeatureDevSessionContext
1 parent 89545c2 commit 1a8c609

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/FeatureDevSessionContext.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class FeatureDevSessionContext(val project: Project, val maxProjectSizeBytes: Lo
9797
addAll(additionalGitIgnoreRules.map { convertGitIgnorePatternToRegex(it) })
9898
addAll(parseGitIgnore())
9999
}.mapNotNull { pattern ->
100-
runCatching { pattern?.let { Regex(it) } }.getOrNull()
100+
runCatching { Regex(pattern) }.getOrNull()
101101
}
102102
} catch (e: Exception) {
103103
emptyList()
@@ -252,7 +252,8 @@ class FeatureDevSessionContext(val project: Project, val maxProjectSizeBytes: Lo
252252
}
253253

254254
// gitignore patterns are not regex, method update needed.
255-
fun convertGitIgnorePatternToRegex(pattern: String): String = pattern.replace(".", "\\.")
255+
private fun convertGitIgnorePatternToRegex(pattern: String): String = pattern
256+
.replace(".", "\\.")
256257
.replace("*", ".*")
257258
.let { if (it.endsWith("/")) "$it.*" else "$it/.*" } // Add a trailing /* to all patterns. (we add a trailing / to all files when matching)
258259
var selectedSourceFolder: VirtualFile

0 commit comments

Comments
 (0)