Skip to content

Commit 713cbeb

Browse files
h7mlclaude
andcommitted
fix: Monaco Editor 支持所有编程语言语法高亮
- 移除 MonacoLanguage 类型的硬编码限制(之前只支持14种语言) - 改为 string 类型,利用 Monaco Editor 的内置语言支持 - Monaco Editor 原生支持 60+ 编程语言,包括所有 fileTypes.ts 定义的 43 种 - 现在编辑器会自动为 Java、PHP、Ruby、Scala 等语言提供语法高亮和智能提示 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 502920a commit 713cbeb

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

src/components/MonacoEditor.tsx

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,8 @@
22

33
import Editor from '@monaco-editor/react'
44

5-
// 支持的 Monaco Editor 语言类型
6-
export type MonacoLanguage =
7-
| 'html'
8-
| 'markdown'
9-
| 'javascript'
10-
| 'typescript'
11-
| 'css'
12-
| 'scss'
13-
| 'json'
14-
| 'yaml'
15-
| 'xml'
16-
| 'python'
17-
| 'go'
18-
| 'rust'
19-
| 'shell'
20-
| 'dockerfile'
21-
| 'plaintext'
22-
235
interface MonacoEditorProps {
24-
language: MonacoLanguage
6+
language: string
257
value: string
268
onChange: (value: string) => void
279
height?: string

0 commit comments

Comments
 (0)