Open pflugs30 opened 11 months ago
Thanks for the report. I think I have an idea why there is an exception in the resolution. However, if that code is the culprit, I think something imight be already wrong when parsing the code. The resolver seems to fail on a single line if statement with empty then statement.
I will have a look later and see what I can do.
Please let me know if you'd like me to send a broader log file. I think what I sent covers the parsing, but I could be mistaken.
If anyone else has this issue then the workaround for now is to remove the empty line e.g. If utc_NegativeOffset Then utc_Offset = -utc_Offset
instead of If utc_NegativeOffset Then: utc_Offset = -utc_Offset
I am also having this issue, but my code base is massive and I can't really fix it with workarounds. I am trying to find a usable version of Rubberduck. Due to #6152 I also can't use v2.5.9.6291. I tried v2.5.2.6260-pre, but I am having some performance issues with that release.
I've submitted a pull request with a fix. For reference here, a simplified error case is shown below with explanation of how the parse went wrong in the comments:
Sub test()
If True Then: A = 1 'matches an ifStmt incorrectly but only when have an ifStmt later
If False Then 'when above goes wrong, this is matched as singleLineIfStmt with empty THEN clause which is wrong. If that didn't happen, the above would not match ifStmt and then try to match singleLineIfStmt as it should
A = 5
End If
End Sub
Rubberduck version information The info below can be copy-paste-completed from the first lines of Rubberduck's log or the About box:
Version 2.5.9.6314 OS: Microsoft Windows NT 10.0.22631.0, x64 Host Product: Microsoft Office x64 Host Version: 16.0.16130.20846 Host Executable: EXCEL.EXE
Description After updating to the recent public release of Rubberduck, I started seeing a Resolver Error on compilable code which used to be just fine. Using the log files, I isolated the issue to a single method.
To Reproduce Steps to reproduce the behavior:
Expected behavior Rubberduck should be able to parse and resolve this code just fine.
Screenshots N/A
Logfile RubberduckLog.txt
Additional context Specifically, I've discovered these lines to be the problem:
When these lines are commented, then RD can parse and resolve all day. All these variables are defined and found in the function.