New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OnErrorResumeNext Inspection can fail while walking ParseTrees #4002
Comments
The problem here is that the listener populates two dictionaries with additional information to be passed to the inspection results. These do not get cleared in To be honest, I have not been able to determine the actual use of the two dictionaries. The first one actually does not save any information one could not get from the context via an existing extension method. |
The dictionaries are assigned to the |
What is a bit of a concern for me is that the inspection does work for one quickfix while finding the results. The second dictionary actually dictates what labels the quickfix uses. In an ideal world the inspections would determine the offending contexts and the quickfixes would determine how to fix the results. Regarding my comment about the first context, in the quickfix |
I agree completely on the second point, this needs to be simplified using the extension method. I also understand that the separation of concerns is violated here, but I can't think of a good alternative at the moment. I suppose I could find all existing labels inside the issue's body element and then deduce the new label name, but what if there are multiple issues in one procedure? If I understand the code in |
You are right that the quickfixes might fix all instances at the same time, in case of fix all in module or all in projects. That is a problem for this quickfix indeed. One alternative thing to provide together instead of the labels came to my mind. How about passing along all result contexts for the same module body element in a list attached to the property bag? Then the relative position of the statement could be inferred from that. In addition, the declaration finder on the state could be used to determine the maximally indexed already existing label with the intended name, which could be used to determine the offset for the error handler label indexes. However, that is just a thought. |
Alternatively, the quickfix could be made unavailable at project and module levels, "forcing" the user to review each "issue" individually at a procedure scope. If making the quickfix operate at procedure level makes our lives easier and the quickfix more reliable, I'm all for it. |
Stacktrace obtained from #3986:
Seems like we do something wrong in
ExitModuleBodyElement
in the OERNListenerThe text was updated successfully, but these errors were encountered: