DavidFeldhoff / al-codeactions

MIT License
17 stars 8 forks source link

Extract to procedure > After OnInsert, ignores the protected var region #126

Closed fvet closed 2 years ago

fvet commented 2 years ago

When I extract code from the OnInsert trigger to a procedure, and choose as location 'After Current (OnInsert)', the procedure is added after the 'var' section = ok, but before the protected var section. Ideally, the new procedures should be located after the var and after the protected var section.

image

DavidFeldhoff commented 2 years ago

Thanks for the issue. You're right that makes sense. Currently I'm on vacation, so I'll develop it in probably two weeks earliest. I think I'll look if after the triggers are one or more global variable sections and select the last one of these. If there is for example a third global variable section after some procedures (which is not best practice, but possible) then I would not consider these sections.

DavidFeldhoff commented 2 years ago

I fixed it a little bit different in v1.0.8. then stated above. I simply use the last global variable section as anchor. I hope that's fine that way? Best regards, David