You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/FeatureDevSessionContext.kt
+22-20Lines changed: 22 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -264,8 +264,9 @@ class FeatureDevSessionContext(val project: Project, val maxProjectSizeBytes: Lo
264
264
if (pattern.length >MAX_PATTERN_LENGTH) {
265
265
returnnull
266
266
}
267
-
return pattern
268
-
// Escape special regex characters except * and ?
267
+
268
+
// Escape special regex characters except * and ?
269
+
var result = pattern
269
270
.replace(".", "\\.")
270
271
.replace("+", "\\+")
271
272
.replace("(", "\\(")
@@ -278,28 +279,29 @@ class FeatureDevSessionContext(val project: Project, val maxProjectSizeBytes: Lo
278
279
.replace("^", "\\^")
279
280
.replace("$", "\\$")
280
281
.replace("|", "\\|")
281
-
// Convert gitignore glob patterns to regex
282
+
283
+
// Convert gitignore glob patterns to regex
284
+
result = result
282
285
.replace("**", ".*?") // Match any directory depth
283
286
.replace("*", "[^/]*?") // Match any character except path separator
284
287
.replace("?", "[^/]") // Match single character except path separator
285
-
.let { pattern ->
286
-
when {
287
-
// If pattern starts with '/', anchor it to the start of the path
0 commit comments