You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(ui-source-code-editor): add python language support - #2799
Add python to the language prop of SourceCodeEditor (v1 and v2), using the Python mode from @codemirror/legacy-modes, which the package already depends on for shell and YAML.
Add a Python sample to the Language support example in both READMEs.
Python tokens map onto the existing highlight tags, so they use the same theme colors as the other languages (keyword #770088, definition #0000ff, string #aa1111 in the default theme).
Bundle size: the Python mode adds 6,469 B minified, 2,723 B minified and gzipped (esbuild, @codemirror/* external). It is imported statically like the YAML mode (728 B gzipped), so every SourceCodeEditor consumer pays it.
Part of INSTUI-5223. This covers the Python option only; jql and plaintext are still open on the ticket.
Test Plan
On the SourceCodeEditor docs page, pick python in the Language support example and check the highlighting in the light, dark and high contrast themes.
Check that the other languages in that example still highlight as before.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You have signed the CLA already but the status is still pending? Let us recheck it.
📊 View full report — click a screenshot's ⚠ badge to see each violation boxed on the image, with the offending element named and contrast failures shown as color swatches.
Diff images (1)
tooltip-dark.png — 15191 pixels differ
Baselines come from the visual-baselines branch. They refresh on every merge to master. The Cypress suite line covers the a11y and console-error assertions — a ❌ there means the suite found real issues even if the visual diff is clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pythonto thelanguageprop ofSourceCodeEditor(v1 and v2), using the Python mode from@codemirror/legacy-modes, which the package already depends on for shell and YAML.#770088, definition#0000ff, string#aa1111in the default theme).@codemirror/*external). It is imported statically like the YAML mode (728 B gzipped), so everySourceCodeEditorconsumer pays it.Part of INSTUI-5223. This covers the Python option only;
jqlandplaintextare still open on the ticket.Test Plan
pythonin the Language support example and check the highlighting in the light, dark and high contrast themes.