https://github.com/codemirror/dev
Development repository for the CodeMirror editor project
https://github.com/codemirror/dev
Last synced: about 1 year ago
JSON representation
Development repository for the CodeMirror editor project
- Host: GitHub
- URL: https://github.com/codemirror/dev
- Owner: codemirror
- License: other
- Created: 2018-08-28T12:10:35.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-09-27T10:04:51.000Z (over 1 year ago)
- Last Synced: 2024-10-29T15:35:10.582Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://codemirror.net/
- Size: 3.61 MB
- Stars: 5,864
- Watchers: 74
- Forks: 374
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- StarryDivineSky - codemirror/dev - javascript`)快速集成语言支持,同时提供丰富的 API 接口以实现与外部工具(如 LSP 服务、代码分析工具)的联动。 CodeMirror 的工作原理基于浏览器环境,通过监听用户输入事件动态解析代码内容,并利用语法解析器(如 Tree-sitter)实现精准的高亮与错误检测。其核心功能由 JavaScript 实现,通过事件驱动模型处理用户操作(如光标移动、代码删除)和实时渲染。项目支持通过配置文件或代码直接设置编辑器行为(如自动保存、行号显示),并提供命令式 API 供开发者调用(如 `editor.replaceSelection()`)。此外,CodeMirror 通过开源社区持续迭代,开发者可通过 GitHub 贡献代码或报告问题,项目维护者定期发布版本更新以修复漏洞和优化性能。 该编辑器适用于需要嵌入代码编辑功能的网页应用(如在线 IDE、代码审查工具),其轻量级特性(压缩后约 30KB)和跨平台兼容性(支持主流浏览器)使其成为开发者的首选方案。 (前端开发框架及项目 / 多工具库支持或纯JS)
README
# CodeMirror
[](https://github.com/codemirror/codemirror.next/actions)
This is the central repository for [CodeMirror](https://codemirror.net/). It holds the bug tracker and development scripts.
If you want to **use** CodeMirror, install the separate packages from npm, and ignore the contents of this repository. If you want to **develop on** CodeMirror, this repository provides scripts to install and work with the various packages.
To get started, make sure you are running [node.js](https://nodejs.org/) version 16. After cloning the repository, run
node bin/cm.js install
to clone the packages that make up the system, install dependencies, and build the packages. At any time you can rebuild packages, either by running `npm run prepare` in their subdirectory, or all at once with
node bin/cm.js build
Developing is best done by setting up
npm run dev
which starts a server that automatically rebuilds the packages when their code changes and exposes a dev server on port 8090 running the [demo](http://localhost:8090) and [browser tests](http://localhost:8090/test/).
Please see [the website](https://codemirror.net/) for more information and [docs](https://codemirror.net/docs/ref).