Skip to content

Conversation

@Raubzeug
Copy link
Contributor

@Raubzeug Raubzeug commented Mar 12, 2024

Closes #611

@Raubzeug Raubzeug force-pushed the add-yql-autocomplete branch from db72939 to feed63e Compare March 12, 2024 08:51
@Raubzeug Raubzeug requested a review from artemmufazalov March 12, 2024 09:23
@Raubzeug
Copy link
Contributor Author

Test stand: https://nda.ya.ru/t/8dR2DKuN74wsF6

Comment on lines 68 to 80
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),
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Member

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)

Copy link
Contributor Author

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.

Copy link
Member

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

artemmufazalov
artemmufazalov previously approved these changes Mar 14, 2024
@Raubzeug Raubzeug force-pushed the add-yql-autocomplete branch from a593d16 to 8fd2bb7 Compare March 14, 2024 11:55
@Raubzeug Raubzeug merged commit 799a05f into main Mar 14, 2024
@Raubzeug Raubzeug deleted the add-yql-autocomplete branch March 14, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add autocomplete for basic SQL

3 participants