Skip to content

Commit a9936ae

Browse files
authored
Merge pull request #291 from Checkmarx/other/benalvo/change-asca-problem-starting-index
Add Start Index For ASCA Problems (AST-69534)
2 parents 85cfdac + cdb2ee5 commit a9936ae

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Each line is a file pattern followed by one or more owners
33

44
# Specify the default owners for the entire repository
5-
* @OrShamirCM @AlvoBen @pedrompflopes
5+
* @AlvoBen @greensd4 @miryamfoiferCX

src/main/java/com/checkmarx/intellij/inspections/AscaInspection.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ private String escapeHtml(String text) {
144144
private TextRange getTextRangeForLine(Document document, int lineNumber) {
145145
int startOffset = document.getLineStartOffset(lineNumber - 1);
146146
int endOffset = Math.min(document.getLineEndOffset(lineNumber - 1), document.getTextLength());
147-
return new TextRange(startOffset, endOffset);
147+
148+
String lineText = document.getText(new TextRange(startOffset, endOffset));
149+
int trimmedStartOffset = startOffset + (lineText.length() - lineText.stripLeading().length());
150+
151+
return new TextRange(trimmedStartOffset, endOffset);
148152
}
149153

150154
/**

0 commit comments

Comments
 (0)