From 45f36de58effceacd299b9b8a2de1f3f836507e9 Mon Sep 17 00:00:00 2001 From: naumov Date: Thu, 8 Aug 2024 00:28:28 +0200 Subject: [PATCH] CB-5474 remove special behaviour for long names --- .../src/SQLEditor/useSqlDialectAutocompletion.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/webapp/packages/plugin-sql-editor-new/src/SQLEditor/useSqlDialectAutocompletion.ts b/webapp/packages/plugin-sql-editor-new/src/SQLEditor/useSqlDialectAutocompletion.ts index 88b48f65a0..36ef3c6c4e 100644 --- a/webapp/packages/plugin-sql-editor-new/src/SQLEditor/useSqlDialectAutocompletion.ts +++ b/webapp/packages/plugin-sql-editor-new/src/SQLEditor/useSqlDialectAutocompletion.ts @@ -12,7 +12,7 @@ import { useService } from '@cloudbeaver/core-di'; import { LocalizationService } from '@cloudbeaver/core-localization'; import { GlobalConstants } from '@cloudbeaver/core-utils'; import type { Compartment, Completion, CompletionConfig, CompletionContext, CompletionResult, Extension } from '@cloudbeaver/plugin-codemirror6'; -import { type ISQLEditorData, SqlEditorSettingsService, type SQLProposal } from '@cloudbeaver/plugin-sql-editor'; +import { type ISQLEditorData, type SQLProposal } from '@cloudbeaver/plugin-sql-editor'; const codemirrorComplexLoader = createComplexLoader(() => import('@cloudbeaver/plugin-codemirror6')); @@ -22,13 +22,11 @@ type SqlCompletion = Completion & { const CLOSE_CHARACTERS = /[\s()[\]{};:>,=\\*]/; const COMPLETION_WORD = /[\w*]*/; -const COMPLETION_WORD_LONG_PROPOSALS = /[\w.*]*/; export function useSqlDialectAutocompletion(data: ISQLEditorData): [Compartment, Extension] { const { closeCompletion, useEditorAutocompletion } = useComplexLoader(codemirrorComplexLoader); const localizationService = useService(LocalizationService); - const sqlEditorSettingsService = useService(SqlEditorSettingsService); - const optionsRef = useObjectRef({ data, sqlEditorSettingsService }); + const optionsRef = useObjectRef({ data }); const [config] = useState(() => { function getOptionsFromProposals(explicit: boolean, word: string, proposals: SQLProposal[]): SqlCompletion[] { @@ -70,7 +68,7 @@ export function useSqlDialectAutocompletion(data: ISQLEditorData): [Compartment, return null; } - const word = context.matchBefore(optionsRef.sqlEditorSettingsService.longNameProposals ? COMPLETION_WORD_LONG_PROPOSALS : COMPLETION_WORD); + const word = context.matchBefore(COMPLETION_WORD); if (word === null) { return null;