Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
dev
Branches (103)
Tags (63)
dev
main
refactor/remove-old-files
codex/auto-compaction-setting
ux
codex/fix-browser-open
feat/skills-enhancement
feat/support-custom-in-welcome
bugfix/migration-flow-issue
fix/agent-ui-i18n
codex/add-dimcode-acp-agent
bugfix/webhook-hook
codex/artifact-sidebar
bugfix/large-tool-call-2
refactor/no-more-multi-tabs
refactor/context-truncator
refactor/default-model-config
feat/new-mcp-settings
feat/new-thread-mock
chatbot-version
v1.0.0-beta.2
v1.0.0-beta.1
v0.5.8
v0.5.7
v0.5.6-beta.5
v0.5.6-beta.4
v0.5.6-beta.3
v0.5.6-beta.2
v0.5.6-beta.1
v0.5.5
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.9
v0.4.8
v0.4.6
v0.4.5
workflow-19022687016
v0.4.3
dev
Branches (103)
Tags (63)
dev
main
refactor/remove-old-files
codex/auto-compaction-setting
ux
codex/fix-browser-open
feat/skills-enhancement
feat/support-custom-in-welcome
bugfix/migration-flow-issue
fix/agent-ui-i18n
codex/add-dimcode-acp-agent
bugfix/webhook-hook
codex/artifact-sidebar
bugfix/large-tool-call-2
refactor/no-more-multi-tabs
refactor/context-truncator
refactor/default-model-config
feat/new-mcp-settings
feat/new-thread-mock
chatbot-version
v1.0.0-beta.2
v1.0.0-beta.1
v0.5.8
v0.5.7
v0.5.6-beta.5
v0.5.6-beta.4
v0.5.6-beta.3
v0.5.6-beta.2
v0.5.6-beta.1
v0.5.5
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.9
v0.4.8
v0.4.6
v0.4.5
workflow-19022687016
v0.4.3
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
dev
Branches (103)
Tags (63)
dev
main
refactor/remove-old-files
codex/auto-compaction-setting
ux
codex/fix-browser-open
feat/skills-enhancement
feat/support-custom-in-welcome
bugfix/migration-flow-issue
fix/agent-ui-i18n
codex/add-dimcode-acp-agent
bugfix/webhook-hook
codex/artifact-sidebar
bugfix/large-tool-call-2
refactor/no-more-multi-tabs
refactor/context-truncator
refactor/default-model-config
feat/new-mcp-settings
feat/new-thread-mock
chatbot-version
v1.0.0-beta.2
v1.0.0-beta.1
v0.5.8
v0.5.7
v0.5.6-beta.5
v0.5.6-beta.4
v0.5.6-beta.3
v0.5.6-beta.2
v0.5.6-beta.1
v0.5.5
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.9
v0.4.8
v0.4.6
v0.4.5
workflow-19022687016
v0.4.3
DeepChat
/
src
/
shared
/
utils
/
codeLanguage.ts
DeepChat
/
src
/
shared
/
utils
/
codeLanguage.ts
codeLanguage.ts 3.03 KB
Copy Edit Raw Blame History
zerob13 authored 2026年01月09日 15:47 +08:00 . feat: diff block in toolcall (#1267)
const DEFAULT_CODE_LANGUAGE = 'plaintext'
const BASENAME_LANGUAGE_MAP: Record<string, string> = {
dockerfile: 'dockerfile',
'.dockerfile': 'dockerfile',
'.npmrc': 'ini',
'.babelrc': 'json',
'.eslintrc': 'json',
'.eslintignore': 'gitignore',
'.prettierrc': 'json',
'.gitignore': 'gitignore',
'.dockerignore': 'gitignore',
'.editorconfig': 'ini',
'.htaccess': 'apacheconf',
'.nginx': 'nginx'
}
const SUFFIX_LANGUAGE_MAP: Record<string, string> = {
'.babel.config.js': 'json'
}
const EXTENSION_LANGUAGE_MAP: Record<string, string> = {
'.js': 'javascript',
'.jsx': 'javascript',
'.ts': 'typescript',
'.tsx': 'typescript',
'.py': 'python',
'.java': 'java',
'.c': 'c',
'.cpp': 'cpp',
'.cc': 'cpp',
'.cxx': 'cpp',
'.h': 'c',
'.hpp': 'cpp',
'.hxx': 'cpp',
'.hh': 'cpp',
'.cs': 'csharp',
'.go': 'go',
'.rb': 'ruby',
'.php': 'php',
'.rs': 'rust',
'.swift': 'swift',
'.kt': 'kotlin',
'.scala': 'scala',
'.pl': 'perl',
'.lua': 'lua',
'.sh': 'shell',
'.html': 'html',
'.htm': 'html',
'.css': 'css',
'.dart': 'dart',
'.r': 'r',
'.m': 'matlab',
'.sql': 'sql',
'.json': 'json',
'.yaml': 'yaml',
'.yml': 'yaml',
'.xml': 'xml',
'.md': 'markdown',
'.vue': 'vue',
'.svelte': 'svelte',
'.sass': 'scss',
'.scss': 'scss',
'.less': 'less',
'.f90': 'fortran',
'.f95': 'fortran',
'.f03': 'fortran',
'.jl': 'julia',
'.ex': 'elixir',
'.exs': 'elixir',
'.elm': 'elm',
'.clj': 'clojure',
'.cljs': 'clojure',
'.fs': 'fsharp',
'.fsx': 'fsharp',
'.hs': 'haskell',
'.ml': 'ocaml',
'.mli': 'ocaml',
'.nim': 'nim',
'.proto': 'protobuf',
'.groovy': 'groovy',
'.tf': 'terraform',
'.tfvars': 'terraform',
'.dockerfile': 'dockerfile',
'.toml': 'toml',
'.graphql': 'graphql',
'.gql': 'graphql',
'.astro': 'astro',
'.zig': 'zig',
'.v': 'v',
'.ini': 'ini',
'.env': 'dotenv',
'.conf': 'configuration',
'.config': 'configuration',
'.properties': 'properties',
'.lock': 'yaml'
}
const normalizeFilename = (filename: string): string => filename.replace(/\\/g, '/').toLowerCase()
const getBasename = (filename: string): string => {
const normalized = normalizeFilename(filename)
const parts = normalized.split('/')
return parts[parts.length - 1] || normalized
}
const getExtension = (basename: string): string => {
const dotIndex = basename.lastIndexOf('.')
if (dotIndex === 0 && basename.indexOf('.', 1) === -1) {
return basename
}
if (dotIndex > 0) {
return basename.slice(dotIndex)
}
return ''
}
export const getLanguageFromFilename = (filename?: string): string => {
if (!filename) return DEFAULT_CODE_LANGUAGE
const basename = getBasename(filename)
for (const [suffix, language] of Object.entries(SUFFIX_LANGUAGE_MAP)) {
if (basename.endsWith(suffix)) {
return language
}
}
if (basename in BASENAME_LANGUAGE_MAP) {
return BASENAME_LANGUAGE_MAP[basename]
}
const extension = getExtension(basename)
return EXTENSION_LANGUAGE_MAP[extension] ?? DEFAULT_CODE_LANGUAGE
}
export { DEFAULT_CODE_LANGUAGE }
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

DeepChat - 连接强大AI与个人世界的智能助手 主要特性 :globe_with_meridians: 支持多个模型云服务:DeepSeek、OpenAI、硅基流动等 :h
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/xzan/DeepChat.git
git@gitee.com:xzan/DeepChat.git
xzan
DeepChat
DeepChat
dev
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /