-
Notifications
You must be signed in to change notification settings - Fork 16.6k
feat(extensions): Allow replacing editors using extensions #37499
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat(extensions): Allow replacing editors using extensions #37499
Conversation
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
...rset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.tsx
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #37499 +/- ##
===========================================
+ Coverage 0 66.58% +66.58%
===========================================
Files 0 643 +643
Lines 0 49049 +49049
Branches 0 5500 +5500
===========================================
+ Hits 0 32661 +32661
- Misses 0 15093 +15093
- Partials 0 1295 +1295
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Code Review Agent Run #b00531
Actionable Suggestions - 3
-
superset-frontend/src/core/editors/AceEditorProvider.tsx - 1
- Incorrect syntax highlighting for yaml · Line 298-299
-
superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.jsx - 1
- Missing Word Wrap in Editor Migration · Line 303-303
-
superset-frontend/src/core/editors/EditorHost.tsx - 1
- Incorrect useEffect dependencies · Line 77-79
Additional Suggestions - 2
-
superset-frontend/src/core/editors/EditorProviders.ts - 1
-
Language mapping conflict · Line 143-145The registerProvider method allows multiple providers to register for the same language, with the last one silently overwriting the mapping. This can make previous providers inaccessible if they supported the same language. It looks like the intention is to replace, but this could lead to unexpected behavior in extension loading. If multiple registrations for the same language aren't intended, add a check to warn and skip registration.
-
-
superset-frontend/src/features/themes/ThemeModal.tsx - 1
-
Type assertion cleanup · Line 59-67Replace the inline array type with JsonValidationAnnotation[] and remove the type assertion on severity since the types are compatible.
-
Review Details
-
Files reviewed - 29 · Commit Range:
38caf6a..38caf6a- scripts/check-type.js
- superset-frontend/packages/superset-core/src/api/contributions.ts
- superset-frontend/packages/superset-core/src/api/editors.ts
- superset-frontend/packages/superset-core/src/api/index.ts
- superset-frontend/packages/superset-ui-core/src/components/index.ts
- superset-frontend/src/SqlLab/components/AceEditorWrapper/AceEditorWrapper.test.tsx
- superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx
- superset-frontend/src/SqlLab/components/SqlEditor/index.tsx
- superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx
- superset-frontend/src/components/SQLEditorWithValidation/index.tsx
- superset-frontend/src/core/editors/AceEditorProvider.tsx
- superset-frontend/src/core/editors/EditorHost.test.tsx
- superset-frontend/src/core/editors/EditorHost.tsx
- superset-frontend/src/core/editors/EditorProviders.test.ts
- superset-frontend/src/core/editors/EditorProviders.ts
- superset-frontend/src/core/editors/index.ts
- superset-frontend/src/core/index.ts
- superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
- superset-frontend/src/dashboard/components/PropertiesModal/sections/AdvancedSection.tsx
- superset-frontend/src/dashboard/components/PropertiesModal/sections/StylingSection.tsx
- superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.jsx
- superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx
- superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/index.tsx
- superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.tsx
- superset-frontend/src/extensions/ExtensionsManager.ts
- superset-frontend/src/extensions/ExtensionsStartup.tsx
- superset-frontend/src/features/annotations/AnnotationModal.tsx
- superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx
- superset-frontend/src/features/themes/ThemeModal.tsx
-
Files skipped - 4
- docs/developer_portal/extensions/contribution-types.md - Reason: Filter setting
- docs/developer_portal/extensions/extension-points/editors.md - Reason: Filter setting
- docs/developer_portal/extensions/registry.md - Reason: Filter setting
- superset-frontend/package.json - Reason: Filter setting
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- Eslint (Linter) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.
Documentation & Help
superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.jsx
Show resolved
Hide resolved
superset-frontend/src/SqlLab/components/EditorWrapper/index.tsx
Outdated
Show resolved
Hide resolved
Code Review Agent Run #d22c31Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Code Review Agent Run #e57268Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
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.
Super nice step forward for opening up editor extendability! First pass comments.
superset-frontend/packages/superset-core/src/api/contributions.ts
Outdated
Show resolved
Hide resolved
| default: | ||
| return FullSQLEditor; |
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.
I noticed we have JS and TS editors as options in EditorLanguage - is FullSQLEditor a good default option for those? If not should we consider removing those for now from EditorLanguage until we have good default editors for them?
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.
Good point. It will not be a good option for those languages. I removed them here.
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.
Last comment on this point: should we raise rather than default to FullSQLEditor for unknown languages?
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.
35B2LGTM - left one last comment, feel free to merge when this is green
Code Review Agent Run #64cb3cActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
This PR introduces a new extension contribution type that allows extensions to replace Superset's default Ace editor with custom editor implementations. Extensions can now register alternative editors (such as Monaco, CodeMirror, or SimpleMDE) for specific languages, enabling enhanced editing experiences across the application.
Key changes:
editorscontribution type: Extensions can declare editor contributions in their manifest that specify which languages they support (sql, json, css, markdown, yaml)registerEditorProvider,getEditorProvider,hasEditorProvider) exposed via@apache-superset/corefor extensions to register their editorsDocumentation:
Editors Extension Pointdocumentation with implementation guideContribution Typeswith editors sectionEditors Bundleexample extension to the community registryExample usage:
extension.json
{ "name": "monaco-editor", "version": "1.0.0", "frontend": { "contributions": { "editors": [ { "id": "monaco-editor.sql", "name": "Monaco SQL Editor", "languages": ["sql"], "description": "Monaco-based SQL editor with IntelliSense" } ] } } }MonacoSQLEditor.tsx
activate.ts
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After - Extension providing alternative SQL editors (Monaco, CodeMirror, SimpleMDE):
Screen.Recording.2026-01-27.at.18.35.55.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION