manticore-projects/jsqlformatter

BadLocationException: Wrong (offset+length)

Closed this issue · 3 comments

Hi, I've installed .nbm from here. 0.1.6 I've added a .sql file with a query:

select * from customer c where date_added >= '2021-04-26 00:00' order by date_added desc limit 3;

2021-05-01_17-03

When I try to format, I'm getting "BadLocationException: Wrong (offset+length)" exception without formatting query.

Screenshot_2021-05-01_17-06-20

Product Version: Apache NetBeans IDE 12.3
Java: 11.0.11; Java HotSpot(TM) 64-Bit Server VM 11.0.11+9-LTS-194
Runtime: Java(TM) SE Runtime Environment 11.0.11+9-LTS-194
System: Linux version 4.19.0-0.bpo.9-amd64 running on amd64; UTF-8; en_US (nb)

Thanks, if I add a new line to file like this ...

2021-05-01_17-15

... now formatter works like a charm. 🤗

2021-05-01_17-15_1

Fixed via funfried/externalcodeformatter_for_netbeans/#147

In the meantime, you can download a snapshot NBM from here: https://github.com/manticore-projects/jsqlformatter/releases/download/0.1.6/externalcodeformatter-sql.nbm