DavidFeldhoff / al-codeactions

MIT License
17 stars 8 forks source link

Extract to procedure - Preceding Comments are missing #158

Closed pri-kise closed 10 months ago

pri-kise commented 1 year ago

If I mark some code including preceding comment lines, then the comment lines are missing. I don't know if this is done on purpose or not, but I personally would prefer the comment to be included if I have it in my selection.

local procedure DoMagicSpaghettiCode(SalesHeader: Record "Sales Header"; var GenJournalLine: Record "Gen. Journal Line")
begin  
    //NOTE: Do some magic, that should be included in the new procedure
   if SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice then
        exit;
    if not SalesHeader."PTE Custom Field" then
        exit;
DavidFeldhoff commented 1 year ago

Hey, actually it's currently done on purpose. If there would be two comment lines above the code, but you only mark the second one, then you probably would expect that the second line only would be extracted, right?

pri-kise commented 1 year ago

Yeah exactly.

DavidFeldhoff commented 10 months ago

This is released now as well in v1.0.30. Would be happy if you could confirm that it's working as expected :)

pri-kise commented 10 months ago

I checked it and now it works as expected 👍