oops forgor

This commit is contained in:
bigguy345 committed 2026-01-02 21:55:18 +02:00
1 parent 9a575919b4
commit e3228632a3
1 file changed
+34
@@ -295,6 +295,21 @@ public class ScriptDocument {
return false;
}
/**
* Check if a position is within a comment range (not string).
* Used to skip comment text when scanning for identifiers.
*/
private boolean isInCommentRange(int position) {
// Check if position is in a comment by checking against COMMENT_PATTERN
Matcher m = COMMENT_PATTERN.matcher(text);
while (m.find()) {
if (position >= m.start() && position < m.end()) {
return true;
}
}
return false;
}
// ==================== PHASE 2: IMPORTS ====================
private void parseImports() {
@@ -4618,6 +4633,25 @@ public class ScriptDocument {
return false;
}
/** Check if position is followed by '(' (method call) */
boolean isFollowedByParen(int pos) {
int check = skipWhitespace(pos);
return check < text.length() && text.charAt(check) == '(';
}
/** Check if position is followed by '.' */
boolean isFollowedByDot(int pos) {
int check = skipWhitespace(pos);
return check < text.length() && text.charAt(check) == '.';
}
/** Skip whitespace and return new position */
int skipWhitespace(int pos) {
while (pos < text.length() && Character.isWhitespace(text.charAt(pos)))
pos++;
return pos;
}
private MethodInfo findMethodAtPosition(int position) {
for (MethodInfo method : getAllMethods()) {
if (method.containsPosition(position)) {