in plugin/src/software/aws/toolkits/eclipse/amazonq/util/IQInlineSuggestionSegmentFactory.java [96:111]
private static boolean isCloseBracket(final String input, final int idx,
final Stack<QInlineSuggestionOpenBracketSegment> unresolvedBrackets) {
char c = input.charAt(idx);
boolean isBracket = c == ')' || c == ']' || c == '}' || c == '>' || c == '"' || c == '\'';
if (!isBracket) {
return false;
}
if (c == '"' || c == '\'') {
return !unresolvedBrackets.isEmpty() && unresolvedBrackets.peek().getSymbol() == c;
}
// TODO: enrich this check to eliminate false positives
if (idx > 0 && Character.isWhitespace(input.charAt(idx - 1)) && c == '>') {
return false;
}
return true;
}