Skip to content

Commit e37a40a

Browse files
Remove onType PPL Formatter (#10902)
* Remove onType PPL Formatter Signed-off-by: Suchit Sahoo <[email protected]> * Changeset file for PR #10902 created/updated --------- Signed-off-by: Suchit Sahoo <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
1 parent 500198b commit e37a40a

File tree

4 files changed

+4
-19
lines changed

4 files changed

+4
-19
lines changed

changelogs/fragments/10902.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fix:
2+
- Remove onType PPL Formatter ([#10902](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/10902))

packages/osd-monaco/src/ppl/formatter.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { formatPPLQuery, pplRangeFormatProvider, pplOnTypeFormatProvider } from './formatter';
6+
import { formatPPLQuery, pplRangeFormatProvider } from './formatter';
77

88
describe('formatPPLQuery', () => {
99
it('should format single pipe separated query', () => {

packages/osd-monaco/src/ppl/formatter.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,3 @@ export const pplRangeFormatProvider = {
2323
];
2424
},
2525
};
26-
27-
export const pplOnTypeFormatProvider = {
28-
autoFormatTriggerCharacters: ['|'],
29-
provideOnTypeFormattingEdits(model: any) {
30-
const fullRange = model.getFullModelRange();
31-
const text = model.getValue();
32-
const formatted = formatPPLQuery(text);
33-
34-
return [
35-
{
36-
range: fullRange,
37-
text: formatted,
38-
},
39-
];
40-
},
41-
};

packages/osd-monaco/src/ppl/language.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ID, PPL_TOKEN_SETS } from './constants';
88
import { PPLWorkerProxyService } from './worker_proxy_service';
99
import { getPPLLanguageAnalyzer, PPLValidationResult } from './ppl_language_analyzer';
1010
import { getPPLDocumentationLink } from './ppl_documentation';
11-
import { pplOnTypeFormatProvider, pplRangeFormatProvider } from './formatter';
11+
import { pplRangeFormatProvider } from './formatter';
1212

1313
const PPL_LANGUAGE_ID = ID;
1414
const OWNER = 'PPL_WORKER';
@@ -180,7 +180,6 @@ const setupPPLFormatter = () => {
180180
PPL_LANGUAGE_ID,
181181
pplRangeFormatProvider
182182
);
183-
monaco.languages.registerOnTypeFormattingEditProvider(PPL_LANGUAGE_ID, pplOnTypeFormatProvider);
184183
};
185184

186185
/**

0 commit comments

Comments
 (0)