- Notifications
You must be signed in to change notification settings - Fork715
fix: changed code-mirror to monaco-editor#8047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Greptile Summary
This pull request implements a complete migration from CodeMirror to Monaco Editor for the web application's code editing functionality. The changes encompass several key areas:
Dependency Management: Thepackage.json removes 16 CodeMirror-related packages (including@codemirror/autocomplete,@codemirror/commands, language packages, themes, and core codemirror) and replaces them withmonaco-editor (v0.52.2) andvite-plugin-monaco-editor (v1.1.0).
Build Configuration: Thevite.config.ts is updated to integrate Monaco Editor with a custom plugin configuration that specifies a distribution path for Monaco's web workers, and updates chunk configurations to handle Monaco Editor bundles instead of CodeMirror.
Component Rewrite: TheCodeQueryEditor.vue component undergoes a complete rewrite, replacing CodeMirror'sEditorView API with Monaco's editor instance. The component maintains the same external interface but changes internal implementation including editor initialization, content handling, and theme management.
Theme Removal: BothCodeQueryEditorLightTheme.ts andCodeQueryEditorDarkTheme.ts files are removed entirely, as Monaco Editor provides built-in theming (vs andvs-dark) that replaces the custom CodeMirror theme configurations.
This migration aligns the codebase with Monaco Editor's more robust feature set, including better TypeScript support, enhanced IntelliSense, and the familiar VS Code editing experience. The change affects code editing functionality throughout the application, particularly in query editors and log analysis interfaces.
Confidence score: 2/5
- This PR has significant implementation issues that could cause runtime errors and functionality problems
- Score lowered due to missing null checks, removed debouncing logic, potential memory leaks, and incomplete error handling in the main editor component
- Pay close attention to
web/src/components/CodeQueryEditor.vuewhich contains several critical issues including unsafe editor object access and missing cleanup logic
5 files reviewed, 2 comments
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
663111d toa3bc0d0ComparePR Code Suggestions ✨Explore these optional code suggestions:
|
bef657c toac05008Compare980d040 to5e17100Compare5e17100 to3a877f7Compare45a9909 toc39e0f4Comparec39e0f4 todf0f801Compare685aae0 to080ffa2Compare080ffa2 to11f2765Compareab156ba intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
PR Type
Enhancement, Bug fix
Description
Replace CodeMirror with Monaco editor
Add Monaco autocomplete and markers
Update build to bundle Monaco
Remove re-render key from logs UI
Diagram Walkthrough
File Walkthrough
3 files
Replace CodeMirror with Monaco, add featuresCleanups, visualization flow, formatting tweaksEditor placeholder, menus, toggle guards3 files
Remove legacy CodeMirror dark themeRemove legacy CodeMirror light themeRemove CodeMirror deps; add Monaco and plugin1 files
Integrate Monaco plugin and chunking