Skip to content

Commit dad4d75

Browse files
committed
Groups PostGIS operators together
1 parent e920b72 commit dad4d75

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/languages/postgresql/postgresql.formatter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ export const postgresql: DialectOptions = {
319319
'##',
320320
'<->',
321321
'&&',
322-
'&&&',
323322
'&<',
324323
'&>',
325324
'<<|',
@@ -337,8 +336,6 @@ export const postgresql: DialectOptions = {
337336
'<@',
338337
'<@>',
339338
'~=',
340-
// PostGIS
341-
'|=|',
342339
// JSON
343340
'?',
344341
'@?',
@@ -394,6 +391,9 @@ export const postgresql: DialectOptions = {
394391
'<+>',
395392
'<~>',
396393
'<%>',
394+
// Custom operators: from PostGIS extension
395+
'&&&', // https://postgis.net/docs/geometry_overlaps_nd.html
396+
'|=|', // https://postgis.net/docs/geometry_distance_cpa.html
397397
],
398398
operatorKeyword: true,
399399
},

test/postgresql.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ describe('PostgreSqlFormatter', () => {
6666
'##',
6767
'<->',
6868
'&&',
69-
'&&&',
7069
'&<',
7170
'&>',
7271
'<<|',
@@ -84,8 +83,6 @@ describe('PostgreSqlFormatter', () => {
8483
'<@',
8584
'<@>',
8685
'~=',
87-
// PostGIS
88-
'|=|',
8986
// JSON
9087
'?',
9188
'@?',
@@ -137,6 +134,9 @@ describe('PostgreSqlFormatter', () => {
137134
'<+>',
138135
'<~>',
139136
'<%>',
137+
// Custom operators: from PostGIS extension
138+
'&&&',
139+
'|=|',
140140
],
141141
{ any: true }
142142
);

0 commit comments

Comments
 (0)