Skip to content

Add the code editor - #852

Open
SharonStrats wants to merge 2 commits into
stagingfrom
move-editor
Open

Add the code editor #852
SharonStrats wants to merge 2 commits into
stagingfrom
move-editor

Conversation

@SharonStrats

Copy link
Copy Markdown
Contributor

Moved the code editor from source pane so it can be used in other panes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a reusable CodeEditor utility (based on CodeMirror 6) and exposes it from the library’s public entrypoint so it can be used across panes instead of being tied to a single pane implementation.

Changes:

  • Added a new CodeEditor class with initialization, content replacement, read-only toggling, language switching, and dirty-state tracking.
  • Exported the new module via src/lib/code-editor and re-exported it from src/index.ts.
  • Added CodeMirror-related runtime dependencies and a unit test covering basic initialization and operations.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/unit/codeEditor.test.js Adds unit tests and CodeMirror mocks for the new CodeEditor.
src/lib/code-editor/index.ts Public barrel export for the code editor module.
src/lib/code-editor/CodeEditor.ts Implements the reusable CodeMirror-backed CodeEditor class.
src/index.ts Re-exports lib/code-editor from the package entrypoint.
package.json Bumps package version and adds CodeMirror/theme dependencies.
package-lock.json Locks newly added CodeMirror/theme dependency tree.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib/code-editor/CodeEditor.ts Outdated
Comment thread src/lib/code-editor/CodeEditor.ts
Comment thread test/unit/codeEditor.test.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants