-
Notifications
You must be signed in to change notification settings - Fork 17
feat: add YQL autocomplete #755
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
Conversation
db72939 to
feed63e
Compare
|
Test stand: https://nda.ya.ru/t/8dR2DKuN74wsF6 |
| let completionProvider: monaco.IDisposable | undefined; | ||
|
|
||
| function disableCodeSuggestions(): void { | ||
| if (completionProvider) { | ||
| completionProvider.dispose(); | ||
| } | ||
| } | ||
|
|
||
| export function registerYQLCompletionItemProvider(database: string) { | ||
| disableCodeSuggestions(); | ||
| completionProvider = monaco.languages.registerCompletionItemProvider('sql', { | ||
| triggerCharacters: [' ', '\n', '', ',', '.', '`', '('], | ||
| provideCompletionItems: createProvideSuggestionsFunction(), | ||
| provideCompletionItems: createProvideSuggestionsFunction(database), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it's here, but not in QueryEditor component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to do it in the closest place to tenantName emergence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, Tenant component seems to be a better place, since it's parent for all Tenant page content
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should be originally addressed to ObjectGeneral file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you suggest to lift query string parsing from ObjectGeneral to Tenant? As for me it make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There is already query parsing in Tenant, tenantName could be passed in props
fd479cd to
a593d16
Compare
a593d16 to
8fd2bb7
Compare
Closes #611