qorelanguage / astyle

0 stars 0 forks source link

multiline string results in incresed indeting #1

Open pvanek opened 6 years ago

pvanek commented 6 years ago

example:

         sql = "
-select count(*)
-  from ap_suppliers aps,
-       ap_supplier_sites_all assa
-       --ap_invoices_all aia
- where aps.vendor_id = assa.vendor_id
-   and aps.segment1 = %v --<p_csv_Supplier_id, column1>
-   and assa.vendor_site_code = %v --<p_csv_Supplier_side, column2>
-   and nvl (aps.end_date_active, sysdate) >= sysdate
-   and nvl (assa.inactive_date, sysdate+1) > sysdate
-   --and aia.vendor_site_id = assa.vendor_site_id
-";
-        row = ds.selectRow (sql, rec."Supplier ID", rec."Supplier Site");
+              select count(*)
+              from ap_suppliers aps,
+              ap_supplier_sites_all assa
+              --ap_invoices_all aia
+              where aps.vendor_id = assa.vendor_id
+                                    and aps.segment1 = % v --<p_csv_Supplier_id, column1>
+                                            and assa.vendor_site_code = % v --<p_csv_Supplier_side, column2>
+                                                    and nvl(aps.end_date_active, sysdate) >= sysdate
+                                                    and nvl(assa.inactive_date, sysdate + 1) > sysdate
+                                                    -- and aia.vendor_site_id = assa.vendor_site_id
+                                                            ";
+                                                            row = ds.selectRow(sql, rec."Supplier ID", rec."Supplier Site");
+
koudy-cz commented 6 years ago

Now (new commit e8f2db7b51291973d42b71a65aed04f730de0c4e) it format string into "column":

sql = "
          select count(*)
          from ap_suppliers aps,
          ap_supplier_sites_all assa
          --ap_invoices_all aia
          where aps.vendor_id = assa.vendor_id
          and aps.segment1 = %v --<p_csv_Supplier_id, column1>
          and assa.vendor_site_code = %v --<p_csv_Supplier_side, column2>
          and nvl (aps.end_date_active, sysdate) >= sysdate
          and nvl (assa.inactive_date, sysdate+1) > sysdate
          --and aia.vendor_site_id = assa.vendor_site_id
          ";
    row = ds.selectRow (sql, rec."Supplier ID", rec."Supplier Site");
pvanek commented 6 years ago

still not perfect. Strings must be left untouched.

                 res.receipt.gl_currency_code = ds.selectRow("
-                    SELECT GSOB.CURRENCY_CODE
-                    FROM HR_ORGANIZATION_INFORMATION HOI,
-                         GL_SETS_OF_BOOKS GSOB
-                    WHERE HOI.ORG_INFORMATION_CONTEXT = 'Accounting Information'
-                    AND TO_NUMBER(HOI.ORG_INFORMATION1) = GSOB.SET_OF_BOOKS_ID
-                    AND HOI.ORGANIZATION_ID = %v
-                ", res.po.org_id).currency_code;
+                                               SELECT GSOB.CURRENCY_CODE
+                                               FROM HR_ORGANIZATION_INFORMATION HOI,
+                                               GL_SETS_OF_BOOKS GSOB
+                                               WHERE HOI.ORG_INFORMATION_CONTEXT = 'Accounting Information'
+                                               AND TO_NUMBER(HOI.ORG_INFORMATION1) = GSOB.SET_OF_BOOKS_ID
+                                               AND HOI.ORGANIZATION_ID = % v
+                                               ", res.po.org_id).currency_code;
             }
+
koudy-cz commented 6 years ago

Yes, eventually I will get there, just to let you know I am working on it. ;)

koudy-cz commented 6 years ago

Now it format badly next line after multi-line string (string should be ok), and sometimes puts part of previous line on next line! (do not use 2a1a642f508cb9d39ffc399f2bc23e3909ad121a for normal usage - it might add some code!)