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

Add support for context aware autocompletion #188

Merged
merged 19 commits into from
Aug 24, 2022
Merged

Add support for context aware autocompletion #188

merged 19 commits into from
Aug 24, 2022

Conversation

sunker
Copy link
Collaborator

@sunker sunker commented Aug 19, 2022

This PR switches from using the CodeEditor that was used in the query editor, variable editor and annotation editor with the SQL CodeEditor from grafana/experimental. This adds autocompletion including suggestions for macros, functions, keywords, logical operators, comparison operators etc. Like before, timestream uses standard SQL so no specific language components are being passed to the SQL CodeEditor. However, a custom completion item provider is used so that the plugin can resolve tables and columns used by the autocompletion engine.

Please note that the variable editor is now rendering the full QueryEditor, including the left form group with resource selector. This should be fine I think. Please add feedback here if any.

Fixes #126

@sunker sunker requested a review from a team as a code owner August 19, 2022 15:04
@sunker sunker requested review from iwysiu and sarahzinger and removed request for a team August 19, 2022 15:04
@CLAassistant
Copy link

CLAassistant commented Aug 19, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Backend code coverage report for PR #188
No changes

@github-actions
Copy link

github-actions bot commented Aug 19, 2022

Frontend code coverage report for PR #188

Plugin Main PR Difference
src 27.78% 27.77% -.01%

Copy link
Member

@sarahzinger sarahzinger left a comment

Choose a reason for hiding this comment

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

cool cool, i didn't do manual testing, but it looks cool :) lots of stylistic open questions, feel free to ignore if they are too time-intensive!

cypress/integration/smoke.spec.ts Outdated Show resolved Hide resolved
src/components/QueryEditor.test.tsx Show resolved Hide resolved
src/components/QueryEditor.tsx Show resolved Hide resolved
src/components/SQLEditor.tsx Show resolved Hide resolved
src/components/SQLEditor.tsx Show resolved Hide resolved
src/language/completionItemProvider.test.ts Show resolved Hide resolved
src/language/completionItemProvider.ts Outdated Show resolved Hide resolved
src/language/completionItemProvider.ts Outdated Show resolved Hide resolved
src/language/completionItemProvider.ts Outdated Show resolved Hide resolved
src/language/definition.ts Show resolved Hide resolved
@sunker sunker added effort/large type/feature-request New feature or request labels Aug 22, 2022
sunker and others added 2 commits August 22, 2022 16:20
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
src/components/SQLEditor.tsx Outdated Show resolved Hide resolved
src/components/SQLEditor.tsx Outdated Show resolved Hide resolved
@sunker sunker merged commit d98dbaa into main Aug 24, 2022
@sunker sunker deleted the autocomplete branch August 24, 2022 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use code editor autocomplete provider from grafana/experimental
4 participants