Skip to content

Commit c922931

Browse files
committed
fix (core): 修复函数帮助提示框出现白色背景问题
1 parent 9feb61c commit c922931

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ pnpm-lock.yaml
2727
*.json
2828
!config*.json
2929
go.mod
30+
.RData
31+
.Rhistory

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ CodeForge 是一款轻量级、高性能的桌面代码执行器,专为开发
3434
<img src="public/icons/java.svg" width="60" alt="Java">
3535
<img src="public/icons/javascript-browser.svg" width="60" alt="JavaScript (Browser)">
3636
<img src="public/icons/javascript-jquery.svg" width="60" alt="JavaScript (jQuery)">
37-
<img src="public/icons/nodejs.svg" width="60" alt="JavaScript (Node.js)">
37+
<img src="public/icons/javascript-nodejs.svg" width="60" alt="JavaScript (Node.js)">
3838
<img src="public/icons/kotlin.svg" width="60" alt="Kotlin">
3939
<img src="public/icons/nodejs.svg" width="60" alt="Node.js">
4040
<img src="public/icons/php.svg" width="60" alt="PHP">

src-tauri/src/plugins/shell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ impl LanguagePlugin for ShellPlugin {
99
}
1010

1111
fn get_language_name(&self) -> &'static str {
12-
"Shell"
12+
"ShellScript"
1313
}
1414

1515
fn get_language_key(&self) -> &'static str {

src/composables/useCodeMirrorFunctionHelp.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { EditorView, hoverTooltip } from '@codemirror/view'
1+
import {EditorView, hoverTooltip} from '@codemirror/view'
2+
23
1
4+
35
export function useCodeMirrorFunctionHelp()
46
{
57
// 提示框
@@ -10,7 +12,7 @@ export function useCodeMirrorFunctionHelp()
1012
dom.innerHTML = `
1113
<div class="relative mb-1">
1214
<div class="px-2 py-1 bg-gray-800 text-white text-xs rounded">
13-
<span class="font-mono">${ text }</span>
15+
<span class="font-mono">${text}</span>
1416
</div>
1517
<!-- 小三角箭头 -->
1618
<div class="absolute left-1/2 transform -translate-x-1/2 top-full">
@@ -19,12 +21,12 @@ export function useCodeMirrorFunctionHelp()
1921
</div>
2022
`
2123

22-
return { dom }
24+
return {dom}
2325
}
2426

2527
// 显示函数提示扩展
2628
const showFunctionHelpHover = hoverTooltip((view, pos, side) => {
27-
let { from, to, text } = view.state.doc.lineAt(pos)
29+
let {from, to, text} = view.state.doc.lineAt(pos)
2830
let start = pos, end = pos
2931
while (start > from && /\w/.test(text[start - from - 1])) {
3032
start--
@@ -44,7 +46,7 @@ export function useCodeMirrorFunctionHelp()
4446
return createHelpTooltip(text.slice(start - from, end - from))
4547
}
4648
}
47-
}, { hoverTime: 300 })
49+
}, {hoverTime: 300})
4850

4951
// 提示框样式主题
5052
const functionHelpTheme = EditorView.theme({
@@ -53,11 +55,16 @@ export function useCodeMirrorFunctionHelp()
5355
animation: 'fadeIn 0.2s ease-out'
5456
},
5557
'.cm-tooltip': {
56-
border: 'none !important'
58+
border: 'none !important',
59+
backgroundColor: 'transparent !important',
60+
boxShadow: 'none !important'
61+
},
62+
'.cm-tooltip-arrow': {
63+
display: 'none !important'
5764
},
5865
'@keyframes fadeIn': {
59-
'from': { opacity: '0', transform: 'translateY(-2px)' },
60-
'to': { opacity: '1', transform: 'translateY(0)' }
66+
'from': {opacity: '0', transform: 'translateY(-2px)'},
67+
'to': {opacity: '1', transform: 'translateY(0)'}
6168
}
6269
})
6370

0 commit comments

Comments
 (0)