diff --git a/frontend/src/components/QueryEditor.external-sql-save.test.tsx b/frontend/src/components/QueryEditor.external-sql-save.test.tsx index 878d84f..8ea484a 100644 --- a/frontend/src/components/QueryEditor.external-sql-save.test.tsx +++ b/frontend/src/components/QueryEditor.external-sql-save.test.tsx @@ -777,8 +777,15 @@ describe('QueryEditor external SQL save', () => { expect(editorState.domNode.style.cursor).toBe('pointer'); const lastDecorationCall = editorState.editor.deltaDecorations.mock.calls.at(-1); expect(lastDecorationCall?.[1]?.[0]?.options?.inlineClassName).toBe('gonavi-query-editor-link-hint'); - expect(lastDecorationCall?.[1]?.[0]?.options?.hoverMessage?.value).toMatch(/(?:Ctrl|⌘) \+ 点击打开该表/); - expect(lastDecorationCall?.[1]?.[0]?.options?.hoverMessage?.value).toContain('**表** `events`'); + expect(lastDecorationCall?.[1]?.[0]?.options?.hoverMessage).toBeUndefined(); + + const hover = editorState.hoverProviders[0]?.provideHover( + editorState.editor.getModel(), + { lineNumber: 1, column: 27 }, + ); + const hoverText = String(hover?.contents?.[0]?.value || ''); + expect(hoverText.match(/\*\*表\*\*/g)).toHaveLength(1); + expect(hoverText).toContain('**表** `events`'); await act(async () => { editorState.mouseLeaveListeners[0]?.(); diff --git a/frontend/src/components/QueryEditor.tsx b/frontend/src/components/QueryEditor.tsx index 6fa4920..58c79cc 100644 --- a/frontend/src/components/QueryEditor.tsx +++ b/frontend/src/components/QueryEditor.tsx @@ -1630,16 +1630,6 @@ export const resolveQueryEditorNavigationDecorations = ( }]; }; -const buildQueryEditorNavigationHoverMarkdown = ( - hoverTarget: QueryEditorHoverTarget | null, - actionHint: string, -): string => { - const hoverContent = hoverTarget ? buildQueryEditorHoverMarkdown(hoverTarget) : ''; - return hoverContent - ? `${hoverContent}\n\n---\n\n${actionHint}` - : actionHint; -}; - const dispatchQueryEditorSidebarLocate = (detail: Record) => { if (typeof window === 'undefined') { return; @@ -2652,20 +2642,6 @@ const QueryEditor: React.FC<{ tab: TabData; isActive?: boolean }> = ({ tab, isAc setQueryEditorMouseCursor(editor, ''); return; } - const hoverTarget = resolveQueryEditorHoverTarget( - getQueryEditorObjectResolveText(model, lineContent), - lineContent, - targetPosition.column, - currentDbRef.current, - visibleDbsRef.current, - tablesRef.current, - allColumnsRef.current, - viewsRef.current, - materializedViewsRef.current, - triggersRef.current, - routinesRef.current, - ); - linkDecorationIdsRef.current = editor.deltaDecorations( linkDecorationIdsRef.current, decorations.map((item) => ({ @@ -2677,9 +2653,6 @@ const QueryEditor: React.FC<{ tab: TabData; isActive?: boolean }> = ({ tab, isAc ), options: { inlineClassName: 'gonavi-query-editor-link-hint', - hoverMessage: { - value: buildQueryEditorNavigationHoverMarkdown(hoverTarget, item.hoverMessage), - }, }, })), );