Skip to content
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

Code Inspection to fix by changing function to sub error #4503

Closed
SmileyFtW opened this issue Nov 7, 2018 · 2 comments
Closed

Code Inspection to fix by changing function to sub error #4503

SmileyFtW opened this issue Nov 7, 2018 · 2 comments
Labels
bug Identifies work items for known bugs difficulty-03-duck Involves more challenging problems and/or developing within and revising the internals API feature-inspection-quickfixes feature-inspections status-norepro The issue could not be reproduced. If there is a stable repro, please add that as a new comment. up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky

Comments

@SmileyFtW
Copy link

SmileyFtW commented Nov 7, 2018

Fixing left the (supposed to be removed End Function) and put the End Sub before the (not removed) End Function causing a compile error.
Before Fix

Private Function Foo(arglist)
End Function

After Fix

Private Sub Foo(arglist)
   End Sub
End Function

Don't know if it matters, but the Function that was to be fixed is the last one in the module.

@Vogel612 Vogel612 added bug Identifies work items for known bugs feature-inspections up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky difficulty-02-ducky Resolving these involves the internal API, but with relatively easy problems to solve. feature-inspection-quickfixes labels Nov 8, 2018
@Vogel612 Vogel612 added this to ToDo in Semi-automatic bug tracker via automation Nov 8, 2018
@retailcoder retailcoder added difficulty-03-duck Involves more challenging problems and/or developing within and revising the internals API and removed difficulty-02-ducky Resolving these involves the internal API, but with relatively easy problems to solve. labels Nov 12, 2018
@retailcoder
Copy link
Member

The ConvertToProcedureQuickFix is correctly replacing the FUNCTION and END_FUNCTION tokens of the FunctionStmtContext with SUB and END_SUB tokens, respectively; this isn't as trivial as it seems - it would have been, had this quickfix not been leveraging the rewriter API.

@MDoerner
Copy link
Contributor

MDoerner commented Nov 12, 2018

I cannot reproduce this error applying the quickfix immediately after the inspection result got created.

Did you do anything between generating the inspection result and applying the quickfix? Here a setting might play a role: do you have running the inspections after parsing disabled in the settings?

With this disabled I can reproduce the issue by running the inspections, then adding a new line with some whitespace, parsing and then choosing to apply the fix to the inspection.

@Vogel612 Vogel612 added the status-norepro The issue could not be reproduced. If there is a stable repro, please add that as a new comment. label Nov 12, 2018
@retailcoder retailcoder moved this from ToDo to NoRepro in Semi-automatic bug tracker Nov 13, 2018
Semi-automatic bug tracker automation moved this from NoRepro to Done Nov 13, 2018
@Vogel612 Vogel612 moved this from Done to NoRepro in Semi-automatic bug tracker Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies work items for known bugs difficulty-03-duck Involves more challenging problems and/or developing within and revising the internals API feature-inspection-quickfixes feature-inspections status-norepro The issue could not be reproduced. If there is a stable repro, please add that as a new comment. up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky
Projects
Development

No branches or pull requests

4 participants