Skip to content

Commit

Permalink
[Autocomplete] PPL Autocomplete (opensearch-project#7810)
Browse files Browse the repository at this point in the history
* add initial ppl autocomplete

Signed-off-by: Eric <menwe@amazon.com>

* untrack .antlr files

Signed-off-by: Eric <menwe@amazon.com>

* ignore intermediate grammar auto-gen files

Signed-off-by: Eric <menwe@amazon.com>

* add rules and related functionalities

Signed-off-by: Eric <menwe@amazon.com>

* Changeset file for PR opensearch-project#7810 created/updated

* Changeset file for PR opensearch-project#7810 created/updated

* minor comment cleanning

Signed-off-by: Eric <menwe@amazon.com>

* add ppl generation command

Signed-off-by: Eric <menwe@amazon.com>

* add rules

Signed-off-by: Eric <menwe@amazon.com>

* correct typo

Signed-off-by: Eric <menwe@amazon.com>

* fix inserting text issue

Signed-off-by: Eric <menwe@amazon.com>

* remove colon for PPL field

Signed-off-by: Eric <menwe@amazon.com>

---------

Signed-off-by: Eric <menwe@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and paulstn committed Aug 30, 2024
1 parent 98f5f7b commit f4058e9
Show file tree
Hide file tree
Showing 22 changed files with 21,046 additions and 79 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,4 @@ snapshots.js
.yarn-local-mirror

# Ignore the generated antlr files
/src/plugins/data/public/antlr/opensearch_sql/grammar/.antlr
/src/plugins/data/public/antlr/dql/grammar/.antlr
/src/plugins/data/public/antlr/**/grammar/.antlr/
2 changes: 2 additions & 0 deletions changelogs/fragments/7810.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Add OpenSearch PPL autocomplete to discover 2.0 with query enhancements ([#7810](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7810))
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
"cypress:run-with-security": "env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=true,openSearchUrl=https://localhost:9200,WAIT_FOR_LOADER_BUFFER_MS=500",
"osd:ciGroup10": "echo \"dashboard_sanity_test_spec.js\"",
"osd:ciGroup11": "echo \"apps/vis_builder/*.js\"",
"generate:opensearchsqlantlr": "./node_modules/antlr4ng-cli/index.js -Dlanguage=TypeScript -o ./src/plugins/data/public/antlr/opensearch_sql/.generated -visitor -no-listener -Xexact-output-dir ./src/plugins/data/public/antlr/opensearch_sql/grammar/OpenSearchSQLLexer.g4 ./src/plugins/data/public/antlr/opensearch_sql/grammar/OpenSearchSQLParser.g4"
"generate:opensearchsqlantlr": "./node_modules/antlr4ng-cli/index.js -Dlanguage=TypeScript -o ./src/plugins/data/public/antlr/opensearch_sql/.generated -visitor -no-listener -Xexact-output-dir ./src/plugins/data/public/antlr/opensearch_sql/grammar/OpenSearchSQLLexer.g4 ./src/plugins/data/public/antlr/opensearch_sql/grammar/OpenSearchSQLParser.g4",
"generate:opensearchpplantlr": "./node_modules/antlr4ng-cli/index.js -Dlanguage=TypeScript -o ./src/plugins/data/public/antlr/opensearch_ppl/.generated -visitor -no-listener -Xexact-output-dir ./src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLLexer.g4 ./src/plugins/data/public/antlr/opensearch_ppl/grammar/OpenSearchPPLParser.g4"
},
"repository": {
"type": "git",
Expand Down
3 changes: 3 additions & 0 deletions packages/osd-monaco/src/xjson/lexer_rules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import * as xJson from './xjson';
import * as opensearchql from './opensearchql';
import * as painless from './painless';
import * as opensearchsql from './opensearchsql';
import * as opensearchppl from './opensearchppl';

export const registerLexerRules = (m: typeof monaco) => {
m.languages.register({ id: xJson.ID });
Expand All @@ -44,4 +45,6 @@ export const registerLexerRules = (m: typeof monaco) => {
m.languages.setMonarchTokensProvider(opensearchql.ID, opensearchql.lexerRules);
m.languages.register({ id: opensearchsql.ID });
m.languages.setMonarchTokensProvider(opensearchsql.ID, opensearchsql.lexerRules);
m.languages.register({ id: opensearchppl.ID });
m.languages.setMonarchTokensProvider(opensearchppl.ID, opensearchppl.lexerRules);
};
Loading

0 comments on commit f4058e9

Please sign in to comment.