Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Auto Suggest] DQL autosuggest with ANTLR #7391

Merged
merged 47 commits into from
Jul 30, 2024

Conversation

paulstn
Copy link
Contributor

@paulstn paulstn commented Jul 23, 2024

Description

Implements ANTLR based autocomplete for DQL queries, currently within Discover.

Ignore files located in .generated and grammar/.antlr

Previously reviewed/approved in #7467 to be merged into the feature/discover-2.0-1 branch. Was then reverted to isolate test failures, and then moved to this pr to get merged into main directly.

Screenshot

Testing the changes

Changelog

  • feat: DQL Autocomplete

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

opensearch-changeset-bot bot added a commit to paulstn/OpenSearch-Dashboards that referenced this pull request Jul 23, 2024
Copy link

codecov bot commented Jul 23, 2024

Codecov Report

Attention: Patch coverage is 58.68794% with 233 lines in your changes missing coverage. Please review.

Project coverage is 63.64%. Comparing base (7a9e9ed) to head (d3db8da).
Report is 229 commits behind head on main.

Files with missing lines Patch % Lines
...gins/data/public/antlr/dql/.generated/DQLParser.ts 55.76% 174 Missing and 18 partials ⚠️
...c/plugins/data/public/antlr/dql/code_completion.ts 70.12% 9 Missing and 14 partials ⚠️
...ugins/data/public/antlr/dql/.generated/DQLLexer.ts 76.47% 8 Missing ⚠️
...ashboards_react/public/code_editor/code_editor.tsx 36.36% 3 Missing and 4 partials ⚠️
...s/data/public/autocomplete/autocomplete_service.ts 0.00% 2 Missing ⚠️
src/plugins/data/public/plugin.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7391      +/-   ##
==========================================
- Coverage   63.67%   63.64%   -0.04%     
==========================================
  Files        3630     3634       +4     
  Lines       79545    80099     +554     
  Branches    12609    12682      +73     
==========================================
+ Hits        50652    50977     +325     
- Misses      25819    26015     +196     
- Partials     3074     3107      +33     
Flag Coverage Δ
Linux_1 30.56% <11.31%> (-0.19%) ⬇️
Linux_2 55.58% <ø> (ø)
Linux_3 40.58% <59.13%> (+0.20%) ⬆️
Linux_4 31.32% <11.80%> (-0.24%) ⬇️
Windows_1 30.58% <11.31%> (-0.19%) ⬇️
Windows_2 55.53% <ø> (ø)
Windows_3 40.58% <59.13%> (+0.21%) ⬆️
Windows_4 31.32% <11.80%> (-0.24%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

sejli
sejli previously approved these changes Jul 23, 2024
Copy link
Member

@sejli sejli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, have some nits and one thing regarding http.

src/plugins/data/public/antlr/dql/code_completion.ts Outdated Show resolved Hide resolved
src/plugins/data/public/antlr/dql/code_completion.test.ts Outdated Show resolved Hide resolved
src/plugins/data/public/plugin.ts Show resolved Hide resolved
paulstn pushed a commit to paulstn/OpenSearch-Dashboards that referenced this pull request Jul 23, 2024
@@ -252,36 +258,64 @@ export default class QueryEditorUI extends Component<Props, State> {
}
};

private fetchIndexPatterns = debounce(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i believe index patterns service might be easier. it's ok can be fast follow

ashwin-pc
ashwin-pc previously approved these changes Jul 30, 2024
kavilla
kavilla previously approved these changes Jul 30, 2024
ashwin-pc
ashwin-pc previously approved these changes Jul 30, 2024
Signed-off-by: Paul Sebastian <[email protected]>
@kavilla kavilla merged commit 2b1d01f into opensearch-project:main Jul 30, 2024
66 of 67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 30, 2024
* Antlr autocomplete (#7159)

* dql grammar with rudamentary testing parser

Signed-off-by: Paul Sebastian <[email protected]>

* show suggestion of fields depending on current index pattern

Signed-off-by: Paul Sebastian <[email protected]>

* basic code completion with fields populated

Signed-off-by: Paul Sebastian <[email protected]>

* updated grammar and generated for better group handling

Signed-off-by: Paul Sebastian <[email protected]>

* add ignored tokens

Signed-off-by: Paul Sebastian <[email protected]>

* remove console logs

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>

* dql Antlr autocomplete (#7160)

* re-add provider for sql

Signed-off-by: Paul Sebastian <[email protected]>

* added temporary fix for language providor to appear for more than one language

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>

* remove EOF in parser to fix suggestions

Signed-off-by: Paul Sebastian <[email protected]>

* use custom version of cursor token index for dql

Signed-off-by: Paul Sebastian <[email protected]>

* implemented value suggestions based on field

Signed-off-by: Paul Sebastian <[email protected]>

* set param type

Signed-off-by: Paul Sebastian <[email protected]>

* update grouping grammar

Signed-off-by: Paul Sebastian <[email protected]>

* fix grammar for dots in field and value term search with spaces

Signed-off-by: Paul Sebastian <[email protected]>

* value suggestions match field to avoid failing api call and to find assc keyword field

Signed-off-by: Paul Sebastian <[email protected]>

* update value suggestions from partially formed value

Signed-off-by: Paul Sebastian <[email protected]>

* refactor value suggestions and change fieldval listener to visitor

Signed-off-by: Paul Sebastian <[email protected]>

* implement value suggestions within phrases

Signed-off-by: Paul Sebastian <[email protected]>

* make grammar more readable

Signed-off-by: Paul Sebastian <[email protected]>

* rename grammar parser rules

Signed-off-by: Paul Sebastian <[email protected]>

* bring back minimal autocomplete optimized grammar

Signed-off-by: Paul Sebastian <[email protected]>

* enable partially complete value suggestion for value groups

Signed-off-by: Paul Sebastian <[email protected]>

* remove number as lexer rule

Signed-off-by: Paul Sebastian <[email protected]>

* fix cursor import and clean up

Signed-off-by: Paul Sebastian <[email protected]>

* fix completion item range to be current word

Signed-off-by: Paul Sebastian <[email protected]>

* update cursor to use monaco position

Signed-off-by: Paul Sebastian <[email protected]>

* cursor index to use position directly

Signed-off-by: Paul Sebastian <[email protected]>

* move language registration into render function to handle new languages

Signed-off-by: Paul Sebastian <[email protected]>

* include auto closing quotes and parenthesis for dql

Signed-off-by: Paul Sebastian <[email protected]>

* rename generated file

Signed-off-by: Paul Sebastian <[email protected]>

* Changeset file for PR #7391 created/updated

* add license and fix linting

Signed-off-by: Paul Sebastian <[email protected]>

* modify grammar

Signed-off-by: Paul Sebastian <[email protected]>

* add tests for fields and keywords

Signed-off-by: Paul Sebastian <[email protected]>

* move dql test constants to separate file

Signed-off-by: Paul Sebastian <[email protected]>

* pass core setup from autocomplete constructor to query sugg provider and utilize selectionEnd if no position

Signed-off-by: Paul Sebastian <[email protected]>

* update an import

Signed-off-by: Paul Sebastian <[email protected]>

* use updated dataset for index pattern

Signed-off-by: Paul Sebastian <[email protected]>

* remove console log

Signed-off-by: Paul Sebastian <[email protected]>

* [Auto Suggest] DQL Updates (#7498)

* update code completion to not return for visualize

Signed-off-by: Paul Sebastian <[email protected]>

* update types to match completionitemkind

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>

* update saved object test flyout snap

Signed-off-by: Paul Sebastian <[email protected]>

* update tests to match changes

Signed-off-by: Paul Sebastian <[email protected]>

* updated editor

Signed-off-by: Paul Sebastian <[email protected]>

* insert colon and space after selecting suggested field

Signed-off-by: Paul Sebastian <[email protected]>

* fix suggestions after colon without space

Signed-off-by: Paul Sebastian <[email protected]>

* update test

Signed-off-by: Paul Sebastian <[email protected]>

* typing update

Signed-off-by: Paul Sebastian <[email protected]>

* updated dataset name

Signed-off-by: Paul Sebastian <[email protected]>

* remove connection service based lines and rely on service

Signed-off-by: Paul Sebastian <[email protected]>

* add debouncer for index pattern calls

Signed-off-by: Paul Sebastian <[email protected]>

* use index pattern service rather than debounce

Signed-off-by: Paul Sebastian <[email protected]>

* update mock index for test

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 2b1d01f)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.16 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.16 2.16
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.16
# Create a new branch
git switch --create backport/backport-7391-to-2.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 2b1d01f4aa87a91b0fe1ec2cfd0ee9653adb02c5
# Push it to GitHub
git push --set-upstream origin backport/backport-7391-to-2.16
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.16

Then, create a pull request where the base branch is 2.16 and the compare/head branch is backport/backport-7391-to-2.16.

LDrago27 pushed a commit that referenced this pull request Jul 30, 2024
* Antlr autocomplete (#7159)

* dql grammar with rudamentary testing parser



* show suggestion of fields depending on current index pattern



* basic code completion with fields populated



* updated grammar and generated for better group handling



* add ignored tokens



* remove console logs



---------



* dql Antlr autocomplete (#7160)

* re-add provider for sql



* added temporary fix for language providor to appear for more than one language



---------



* remove EOF in parser to fix suggestions



* use custom version of cursor token index for dql



* implemented value suggestions based on field



* set param type



* update grouping grammar



* fix grammar for dots in field and value term search with spaces



* value suggestions match field to avoid failing api call and to find assc keyword field



* update value suggestions from partially formed value



* refactor value suggestions and change fieldval listener to visitor



* implement value suggestions within phrases



* make grammar more readable



* rename grammar parser rules



* bring back minimal autocomplete optimized grammar



* enable partially complete value suggestion for value groups



* remove number as lexer rule



* fix cursor import and clean up



* fix completion item range to be current word



* update cursor to use monaco position



* cursor index to use position directly



* move language registration into render function to handle new languages



* include auto closing quotes and parenthesis for dql



* rename generated file



* Changeset file for PR #7391 created/updated

* add license and fix linting



* modify grammar



* add tests for fields and keywords



* move dql test constants to separate file



* pass core setup from autocomplete constructor to query sugg provider and utilize selectionEnd if no position



* update an import



* use updated dataset for index pattern



* remove console log



* [Auto Suggest] DQL Updates (#7498)

* update code completion to not return for visualize



* update types to match completionitemkind



---------



* update saved object test flyout snap



* update tests to match changes



* updated editor



* insert colon and space after selecting suggested field



* fix suggestions after colon without space



* update test



* typing update



* updated dataset name



* remove connection service based lines and rely on service



* add debouncer for index pattern calls



* use index pattern service rather than debounce



* update mock index for test



---------



(cherry picked from commit 2b1d01f)

Signed-off-by: Paul Sebastian <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
@paulstn paulstn mentioned this pull request Jul 31, 2024
19 tasks
Qxisylolo pushed a commit to Qxisylolo/OpenSearch-Dashboards that referenced this pull request Aug 1, 2024
…ensearch-project#7492)

* Revert "Revert "[Discover-next] data set picker (opensearch-project#7426)" (opensearch-project#7479)"

This reverts commit 2208df9.

* fix(query assist): update reading data source id from dataset manager (opensearch-project#7464)

* revert to read datasource id from index pattern

Signed-off-by: Joshua Li <[email protected]>

* add dataset mock to query mock

Signed-off-by: Joshua Li <[email protected]>

* update query assist to use dataset manager

Signed-off-by: Joshua Li <[email protected]>

* use selected dataset state instead of relying on rerender

Signed-off-by: Joshua Li <[email protected]>

* remove skip 1 in dataset observable

Signed-off-by: Joshua Li <[email protected]>

* update dataset_manager tests

Signed-off-by: Joshua Li <[email protected]>

---------

Signed-off-by: Joshua Li <[email protected]>

* [Auto Suggest] DQL autosuggest with ANTLR (opensearch-project#7467)

* Antlr autocomplete (opensearch-project#7159)

* dql grammar with rudamentary testing parser

Signed-off-by: Paul Sebastian <[email protected]>

* show suggestion of fields depending on current index pattern

Signed-off-by: Paul Sebastian <[email protected]>

* basic code completion with fields populated

Signed-off-by: Paul Sebastian <[email protected]>

* updated grammar and generated for better group handling

Signed-off-by: Paul Sebastian <[email protected]>

* add ignored tokens

Signed-off-by: Paul Sebastian <[email protected]>

* remove console logs

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>

* dql Antlr autocomplete (opensearch-project#7160)

* re-add provider for sql

Signed-off-by: Paul Sebastian <[email protected]>

* added temporary fix for language providor to appear for more than one language

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>

* remove EOF in parser to fix suggestions

Signed-off-by: Paul Sebastian <[email protected]>

* use custom version of cursor token index for dql

Signed-off-by: Paul Sebastian <[email protected]>

* implemented value suggestions based on field

Signed-off-by: Paul Sebastian <[email protected]>

* set param type

Signed-off-by: Paul Sebastian <[email protected]>

* update grouping grammar

Signed-off-by: Paul Sebastian <[email protected]>

* fix grammar for dots in field and value term search with spaces

Signed-off-by: Paul Sebastian <[email protected]>

* value suggestions match field to avoid failing api call and to find assc keyword field

Signed-off-by: Paul Sebastian <[email protected]>

* update value suggestions from partially formed value

Signed-off-by: Paul Sebastian <[email protected]>

* refactor value suggestions and change fieldval listener to visitor

Signed-off-by: Paul Sebastian <[email protected]>

* implement value suggestions within phrases

Signed-off-by: Paul Sebastian <[email protected]>

* make grammar more readable

Signed-off-by: Paul Sebastian <[email protected]>

* rename grammar parser rules

Signed-off-by: Paul Sebastian <[email protected]>

* bring back minimal autocomplete optimized grammar

Signed-off-by: Paul Sebastian <[email protected]>

* enable partially complete value suggestion for value groups

Signed-off-by: Paul Sebastian <[email protected]>

* remove number as lexer rule

Signed-off-by: Paul Sebastian <[email protected]>

* fix cursor import and clean up

Signed-off-by: Paul Sebastian <[email protected]>

* fix completion item range to be current word

Signed-off-by: Paul Sebastian <[email protected]>

* update cursor to use monaco position

Signed-off-by: Paul Sebastian <[email protected]>

* cursor index to use position directly

Signed-off-by: Paul Sebastian <[email protected]>

* move language registration into render function to handle new languages

Signed-off-by: Paul Sebastian <[email protected]>

* include auto closing quotes and parenthesis for dql

Signed-off-by: Paul Sebastian <[email protected]>

* rename generated file

Signed-off-by: Paul Sebastian <[email protected]>

* include single line editor closing pairs

Signed-off-by: Paul Sebastian <[email protected]>

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

* add license and fix linting

Signed-off-by: Paul Sebastian <[email protected]>

* modify grammar

Signed-off-by: Paul Sebastian <[email protected]>

* add tests for fields and keywords

Signed-off-by: Paul Sebastian <[email protected]>

* move dql test constants to separate file

Signed-off-by: Paul Sebastian <[email protected]>

* pass core setup from autocomplete constructor to query sugg provider and utilize selectionEnd if no position

Signed-off-by: Paul Sebastian <[email protected]>

* update an import

Signed-off-by: Paul Sebastian <[email protected]>

* use updated dataset for index pattern

Signed-off-by: Paul Sebastian <[email protected]>

* remove console log

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* [tests][discover-next] update the tests and async nature of the dataset navigator (opensearch-project#7489)

* [tests][discover-next] update the tests and async nature of the dataset manager

Address test failures related to the dataset navigator.

Signed-off-by: Kawika Avilla <[email protected]>

* bad fingers accidentally hit the x button

Signed-off-by: Kawika Avilla <[email protected]>

---------

Signed-off-by: Kawika Avilla <[email protected]>

* update snapshot

Signed-off-by: Kawika Avilla <[email protected]>

* [DataSet Navigator] Rewire S3 components (opensearch-project#7470)

* rewiring databases back into navigator

Signed-off-by: Sean Li <[email protected]>

* fixing async query support

Signed-off-by: Sean Li <[email protected]>

---------

Signed-off-by: Sean Li <[email protected]>

* Fix UI and detection of external data source in query assist (opensearch-project#7494)

* fix(queryEditorExtensions): use dataset manager to determine external datasource

Remove datasource and indexpattern since they are no longer the source
of truth after dataset manager is added, and they are not used in query
enhancement plugin.

Signed-off-by: Joshua Li <[email protected]>

* fix(queryAssist): enable click to change language in banner

Signed-off-by: Joshua Li <[email protected]>

* fix(queryAssist): hide query assist bar if editor is collapsed

Signed-off-by: Joshua Li <[email protected]>

---------

Signed-off-by: Joshua Li <[email protected]>

* pass in index patterns

Signed-off-by: Kawika Avilla <[email protected]>

* [Auto Suggest] Add MDS Support Along with A Few Cleanup and tests (opensearch-project#7463)

* add tests for sql autocomplete rule processing

Signed-off-by: Eric <[email protected]>

* refer to monaco type directly

Signed-off-by: Eric <[email protected]>

* remove unnecessary antlr auto generated files

Signed-off-by: Eric <[email protected]>

* inital adoption of dataSet manager

Signed-off-by: Eric <[email protected]>

* mds support

Signed-off-by: Eric <[email protected]>

* remove test that are failed due to adopting dataSet manager

Signed-off-by: Eric <[email protected]>

* add changelog

Signed-off-by: Eric <[email protected]>

* fix(query assist): update reading data source id from dataset manager (opensearch-project#7464)

* revert to read datasource id from index pattern

Signed-off-by: Joshua Li <[email protected]>

* add dataset mock to query mock

Signed-off-by: Joshua Li <[email protected]>

* update query assist to use dataset manager

Signed-off-by: Joshua Li <[email protected]>

* use selected dataset state instead of relying on rerender

Signed-off-by: Joshua Li <[email protected]>

* remove skip 1 in dataset observable

Signed-off-by: Joshua Li <[email protected]>

* update dataset_manager tests

Signed-off-by: Joshua Li <[email protected]>

---------

Signed-off-by: Joshua Li <[email protected]>

* update utils

Signed-off-by: Eric <[email protected]>

* keep with observable and remove values suggestion

Signed-off-by: Eric <[email protected]>

* update unit tests

Signed-off-by: Eric <[email protected]>

* [Auto Suggest] DQL autosuggest with ANTLR (opensearch-project#7467)

* Antlr autocomplete (opensearch-project#7159)

* dql grammar with rudamentary testing parser

Signed-off-by: Paul Sebastian <[email protected]>

* show suggestion of fields depending on current index pattern

Signed-off-by: Paul Sebastian <[email protected]>

* basic code completion with fields populated

Signed-off-by: Paul Sebastian <[email protected]>

* updated grammar and generated for better group handling

Signed-off-by: Paul Sebastian <[email protected]>

* add ignored tokens

Signed-off-by: Paul Sebastian <[email protected]>

* remove console logs

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>

* dql Antlr autocomplete (opensearch-project#7160)

* re-add provider for sql

Signed-off-by: Paul Sebastian <[email protected]>

* added temporary fix for language providor to appear for more than one language

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>

* remove EOF in parser to fix suggestions

Signed-off-by: Paul Sebastian <[email protected]>

* use custom version of cursor token index for dql

Signed-off-by: Paul Sebastian <[email protected]>

* implemented value suggestions based on field

Signed-off-by: Paul Sebastian <[email protected]>

* set param type

Signed-off-by: Paul Sebastian <[email protected]>

* update grouping grammar

Signed-off-by: Paul Sebastian <[email protected]>

* fix grammar for dots in field and value term search with spaces

Signed-off-by: Paul Sebastian <[email protected]>

* value suggestions match field to avoid failing api call and to find assc keyword field

Signed-off-by: Paul Sebastian <[email protected]>

* update value suggestions from partially formed value

Signed-off-by: Paul Sebastian <[email protected]>

* refactor value suggestions and change fieldval listener to visitor

Signed-off-by: Paul Sebastian <[email protected]>

* implement value suggestions within phrases

Signed-off-by: Paul Sebastian <[email protected]>

* make grammar more readable

Signed-off-by: Paul Sebastian <[email protected]>

* rename grammar parser rules

Signed-off-by: Paul Sebastian <[email protected]>

* bring back minimal autocomplete optimized grammar

Signed-off-by: Paul Sebastian <[email protected]>

* enable partially complete value suggestion for value groups

Signed-off-by: Paul Sebastian <[email protected]>

* remove number as lexer rule

Signed-off-by: Paul Sebastian <[email protected]>

* fix cursor import and clean up

Signed-off-by: Paul Sebastian <[email protected]>

* fix completion item range to be current word

Signed-off-by: Paul Sebastian <[email protected]>

* update cursor to use monaco position

Signed-off-by: Paul Sebastian <[email protected]>

* cursor index to use position directly

Signed-off-by: Paul Sebastian <[email protected]>

* move language registration into render function to handle new languages

Signed-off-by: Paul Sebastian <[email protected]>

* include auto closing quotes and parenthesis for dql

Signed-off-by: Paul Sebastian <[email protected]>

* rename generated file

Signed-off-by: Paul Sebastian <[email protected]>

* include single line editor closing pairs

Signed-off-by: Paul Sebastian <[email protected]>

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

* add license and fix linting

Signed-off-by: Paul Sebastian <[email protected]>

* modify grammar

Signed-off-by: Paul Sebastian <[email protected]>

* add tests for fields and keywords

Signed-off-by: Paul Sebastian <[email protected]>

* move dql test constants to separate file

Signed-off-by: Paul Sebastian <[email protected]>

* pass core setup from autocomplete constructor to query sugg provider and utilize selectionEnd if no position

Signed-off-by: Paul Sebastian <[email protected]>

* update an import

Signed-off-by: Paul Sebastian <[email protected]>

* use updated dataset for index pattern

Signed-off-by: Paul Sebastian <[email protected]>

* remove console log

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* [tests][discover-next] update the tests and async nature of the dataset navigator (opensearch-project#7489)

* [tests][discover-next] update the tests and async nature of the dataset manager

Address test failures related to the dataset navigator.

Signed-off-by: Kawika Avilla <[email protected]>

* bad fingers accidentally hit the x button

Signed-off-by: Kawika Avilla <[email protected]>

---------

Signed-off-by: Kawika Avilla <[email protected]>

* resolve conflicts

Signed-off-by: Eric <[email protected]>

* fix one minor linting

Signed-off-by: Eric <[email protected]>

---------

Signed-off-by: Eric <[email protected]>
Signed-off-by: Joshua Li <[email protected]>
Signed-off-by: Paul Sebastian <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Eric Wei <[email protected]>
Co-authored-by: Joshua Li <[email protected]>
Co-authored-by: Paul Sebastian <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Kawika Avilla <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>

* More styling on query enhancement UI  styling (opensearch-project#7496)

Signed-off-by: abbyhu2000 <[email protected]>

* [Auto Suggest] DQL Updates (opensearch-project#7498)

* update code completion to not return for visualize

Signed-off-by: Paul Sebastian <[email protected]>

* update types to match completionitemkind

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>

* fix some typing issues

Signed-off-by: Kawika Avilla <[email protected]>

* delete manual changelogs

Signed-off-by: Kawika Avilla <[email protected]>

* fixing sessionId support

Signed-off-by: Sean Li <[email protected]>

* remove height

Signed-off-by: abbyhu2000 <[email protected]>

* Revert "[Auto Suggest] DQL Updates (opensearch-project#7498)"

This reverts commit 27a74ab.

* Revert "[Auto Suggest] Add MDS Support Along with A Few Cleanup and tests (opensearch-project#7463)"

This reverts commit 9f68352.

* Revert "[Auto Suggest] DQL autosuggest with ANTLR (opensearch-project#7467)"

This reverts commit 74b03e9.

* fixing typing issue

Signed-off-by: Sean Li <[email protected]>

* remove unused export

Signed-off-by: Sean Li <[email protected]>

* fix texts and some state mgmt

Signed-off-by: Kawika Avilla <[email protected]>

* fix file

Signed-off-by: Kawika Avilla <[email protected]>

* update snapshot

Signed-off-by: Kawika Avilla <[email protected]>

* more clean up

Signed-off-by: Kawika Avilla <[email protected]>

* default to false

Signed-off-by: Kawika Avilla <[email protected]>

* only push the set with enhancements

Signed-off-by: Kawika Avilla <[email protected]>

* fix two tests

Signed-off-by: Kawika Avilla <[email protected]>

* render hell

Signed-off-by: Kawika Avilla <[email protected]>

* test update

Signed-off-by: Kawika Avilla <[email protected]>

* passing in settings

Signed-off-by: Kawika Avilla <[email protected]>

* add changelog

Signed-off-by: Kawika Avilla <[email protected]>

---------

Signed-off-by: Joshua Li <[email protected]>
Signed-off-by: Paul Sebastian <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Sean Li <[email protected]>
Signed-off-by: Eric <[email protected]>
Signed-off-by: Eric Wei <[email protected]>
Signed-off-by: abbyhu2000 <[email protected]>
Co-authored-by: Joshua Li <[email protected]>
Co-authored-by: Paul Sebastian <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Sean Li <[email protected]>
Co-authored-by: Eric Wei <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
Co-authored-by: Qingyang(Abby) Hu <[email protected]>
Qxisylolo pushed a commit to Qxisylolo/OpenSearch-Dashboards that referenced this pull request Aug 1, 2024
* Antlr autocomplete (opensearch-project#7159)

* dql grammar with rudamentary testing parser

Signed-off-by: Paul Sebastian <[email protected]>

* show suggestion of fields depending on current index pattern

Signed-off-by: Paul Sebastian <[email protected]>

* basic code completion with fields populated

Signed-off-by: Paul Sebastian <[email protected]>

* updated grammar and generated for better group handling

Signed-off-by: Paul Sebastian <[email protected]>

* add ignored tokens

Signed-off-by: Paul Sebastian <[email protected]>

* remove console logs

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>

* dql Antlr autocomplete (opensearch-project#7160)

* re-add provider for sql

Signed-off-by: Paul Sebastian <[email protected]>

* added temporary fix for language providor to appear for more than one language

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>

* remove EOF in parser to fix suggestions

Signed-off-by: Paul Sebastian <[email protected]>

* use custom version of cursor token index for dql

Signed-off-by: Paul Sebastian <[email protected]>

* implemented value suggestions based on field

Signed-off-by: Paul Sebastian <[email protected]>

* set param type

Signed-off-by: Paul Sebastian <[email protected]>

* update grouping grammar

Signed-off-by: Paul Sebastian <[email protected]>

* fix grammar for dots in field and value term search with spaces

Signed-off-by: Paul Sebastian <[email protected]>

* value suggestions match field to avoid failing api call and to find assc keyword field

Signed-off-by: Paul Sebastian <[email protected]>

* update value suggestions from partially formed value

Signed-off-by: Paul Sebastian <[email protected]>

* refactor value suggestions and change fieldval listener to visitor

Signed-off-by: Paul Sebastian <[email protected]>

* implement value suggestions within phrases

Signed-off-by: Paul Sebastian <[email protected]>

* make grammar more readable

Signed-off-by: Paul Sebastian <[email protected]>

* rename grammar parser rules

Signed-off-by: Paul Sebastian <[email protected]>

* bring back minimal autocomplete optimized grammar

Signed-off-by: Paul Sebastian <[email protected]>

* enable partially complete value suggestion for value groups

Signed-off-by: Paul Sebastian <[email protected]>

* remove number as lexer rule

Signed-off-by: Paul Sebastian <[email protected]>

* fix cursor import and clean up

Signed-off-by: Paul Sebastian <[email protected]>

* fix completion item range to be current word

Signed-off-by: Paul Sebastian <[email protected]>

* update cursor to use monaco position

Signed-off-by: Paul Sebastian <[email protected]>

* cursor index to use position directly

Signed-off-by: Paul Sebastian <[email protected]>

* move language registration into render function to handle new languages

Signed-off-by: Paul Sebastian <[email protected]>

* include auto closing quotes and parenthesis for dql

Signed-off-by: Paul Sebastian <[email protected]>

* rename generated file

Signed-off-by: Paul Sebastian <[email protected]>

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

* add license and fix linting

Signed-off-by: Paul Sebastian <[email protected]>

* modify grammar

Signed-off-by: Paul Sebastian <[email protected]>

* add tests for fields and keywords

Signed-off-by: Paul Sebastian <[email protected]>

* move dql test constants to separate file

Signed-off-by: Paul Sebastian <[email protected]>

* pass core setup from autocomplete constructor to query sugg provider and utilize selectionEnd if no position

Signed-off-by: Paul Sebastian <[email protected]>

* update an import

Signed-off-by: Paul Sebastian <[email protected]>

* use updated dataset for index pattern

Signed-off-by: Paul Sebastian <[email protected]>

* remove console log

Signed-off-by: Paul Sebastian <[email protected]>

* [Auto Suggest] DQL Updates (opensearch-project#7498)

* update code completion to not return for visualize

Signed-off-by: Paul Sebastian <[email protected]>

* update types to match completionitemkind

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>

* update saved object test flyout snap

Signed-off-by: Paul Sebastian <[email protected]>

* update tests to match changes

Signed-off-by: Paul Sebastian <[email protected]>

* updated editor

Signed-off-by: Paul Sebastian <[email protected]>

* insert colon and space after selecting suggested field

Signed-off-by: Paul Sebastian <[email protected]>

* fix suggestions after colon without space

Signed-off-by: Paul Sebastian <[email protected]>

* update test

Signed-off-by: Paul Sebastian <[email protected]>

* typing update

Signed-off-by: Paul Sebastian <[email protected]>

* updated dataset name

Signed-off-by: Paul Sebastian <[email protected]>

* remove connection service based lines and rely on service

Signed-off-by: Paul Sebastian <[email protected]>

* add debouncer for index pattern calls

Signed-off-by: Paul Sebastian <[email protected]>

* use index pattern service rather than debounce

Signed-off-by: Paul Sebastian <[email protected]>

* update mock index for test

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
joshuali925 pushed a commit that referenced this pull request Aug 27, 2024
Update to DQL Autocomplete: #7391

Every file removal under `grammar/.antlr` can be ignored.

- [x] use official value suggestion methods instead of direct api call
- [x] removed language specified configuration
- [ ]  ~~added memoization for value suggestion to reduce number of calls made~~
- [x] removed core start from query suggestion function
- [x] added tests for value suggestion
- [x] added more test coverage for other general cases
- [ ] ~~[[RFC] Monaco Code Editor provider registration #7594](#7594) made changes based on this RFC~~
- [x] remove grammar/.antlr auto generated files
- [x] updated types in code completion and related files
- [x] fixed many group value suggestion bugs and edge cases with more robust parser visitor
- [x] fix group value NOT suggestion bugs
- [ ] ~~added basic keyword syntax highlighting~~

---------

Signed-off-by: Paul Sebastian <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 27, 2024
Update to DQL Autocomplete: #7391

Every file removal under `grammar/.antlr` can be ignored.

- [x] use official value suggestion methods instead of direct api call
- [x] removed language specified configuration
- [ ]  ~~added memoization for value suggestion to reduce number of calls made~~
- [x] removed core start from query suggestion function
- [x] added tests for value suggestion
- [x] added more test coverage for other general cases
- [ ] ~~[[RFC] Monaco Code Editor provider registration #7594](#7594) made changes based on this RFC~~
- [x] remove grammar/.antlr auto generated files
- [x] updated types in code completion and related files
- [x] fixed many group value suggestion bugs and edge cases with more robust parser visitor
- [x] fix group value NOT suggestion bugs
- [ ] ~~added basic keyword syntax highlighting~~

---------

Signed-off-by: Paul Sebastian <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 741c0d6)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ashwin-pc pushed a commit that referenced this pull request Aug 28, 2024
Update to DQL Autocomplete: #7391

Every file removal under `grammar/.antlr` can be ignored.

- [x] use official value suggestion methods instead of direct api call
- [x] removed language specified configuration
- [ ]  ~~added memoization for value suggestion to reduce number of calls made~~
- [x] removed core start from query suggestion function
- [x] added tests for value suggestion
- [x] added more test coverage for other general cases
- [ ] ~~[[RFC] Monaco Code Editor provider registration #7594](#7594) made changes based on this RFC~~
- [x] remove grammar/.antlr auto generated files
- [x] updated types in code completion and related files
- [x] fixed many group value suggestion bugs and edge cases with more robust parser visitor
- [x] fix group value NOT suggestion bugs
- [ ] ~~added basic keyword syntax highlighting~~

---------



(cherry picked from commit 741c0d6)

Signed-off-by: Paul Sebastian <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants