Skip to content

2534 Add syntax highlighting and line numbers to the input files editor - #2535

Open
martastn wants to merge 3 commits into
2479-rework-the-input-files-tab-detect-simulators-choose-files-to-run-fix-downloadsfrom
2534-input-files-editor-has-no-syntax-highlighting-or-line-numbers
Open

martastn wants to merge 3 commits into
2479-rework-the-input-files-tab-detect-simulators-choose-files-to-run-fix-downloadsfrom
2534-input-files-editor-has-no-syntax-highlighting-or-line-numbers

Conversation

@martastn

Copy link
Copy Markdown
Contributor

Closes #2534

Depends on #2490 (built on its branch, it changes the InputFilesEditor added there). Until #2490 is merged, this PR targets its branch.

Changes:

  • Code editor for input files (CodeMirror 6 via @uiw/react-codemirror): line numbers, search (Ctrl/Cmd+F), light and dark theme. Large files are loaded whole and editable (the 100 kB limit is gone). The editor is loaded lazily, so the main bundle does not grow.
  • Highlighting by file extension (inputFileLanguages.ts):
    • .dat, .inp, .mac: own grammars for SHIELD-HIT12A, FLUKA and Geant4 macros;
    • known types (.gdml, .json, .py, .yaml, … ~100): @codemirror/language-data, loaded on demand;
    • anything else: numbers, quoted strings and common comments.
  • Search panel styled like the rest of the app (searchPanelTheme.ts).
  • Tests: Selenium tests read file content from the editor view (the editor renders only visible lines). Jest maps @marijn/find-cluster-break to its CommonJS build.
Light Dark Other files
light dark other-files
Search, light Search, dark
search-light search-dark

@martastn martastn self-assigned this Nov 14, 2026
@martastn
martastn added this pull request to stack #2536 November 14, 2026 18:53
@martastn
martastn marked this pull request as draft November 14, 2026 18:56
@martastn
martastn force-pushed the 2534-input-files-editor-has-no-syntax-highlighting-or-line-numbers branch 2 times, most recently from c87bc1c to c6f9341 Compare November 16, 2026 18:28
@martastn
martastn marked this pull request as ready for review November 16, 2026 18:28
@martastn
martastn force-pushed the 2534-input-files-editor-has-no-syntax-highlighting-or-line-numbers branch 4 times, most recently from 00964e4 to 6c89cf1 Compare November 19, 2026 21:22
@martastn
martastn force-pushed the 2534-input-files-editor-has-no-syntax-highlighting-or-line-numbers branch 2 times, most recently from 83a0a2f to e2352da Compare November 19, 2026 21:28
@martastn martastn changed the title 2534 input files editor has no syntax highlighting or line numbers 2534 Add syntax highlighting and line numbers to the input files editor Nov 22, 2026
@martastn
martastn force-pushed the 2534-input-files-editor-has-no-syntax-highlighting-or-line-numbers branch from e2352da to 24d7a9a Compare November 22, 2026 16:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Input files editor has no syntax highlighting or line numbers

1 participant