~/talk

Building your own code editor with Monaco

Talkat CityJS Athens 2022 · 2022-05-25..05-27· [typescript, developer-experience]
slides:none on file

Builds a browser code editor using Monaco Editor via the monaco-editor/react wrapper and teaches it a custom language (JSONata) with a Monarch grammar of regex rules so syntax highlighting works. Adds a completion item provider triggered on "$" for autocompletion, returns markdown docs with isTrusted=true, and a hover provider for inline documentation. Implements debounced onChange, a keyboard command to run the built-in formatDocument action (used to reformat pasted jQuery), and embeds the editor in a three-pane JSON→transform→output playground that works in production for mappings.

AI-written summary · about

  1. 0:00Introduction and thanks
  2. 5:03Why build a code editor
  3. 6:29Introducing Monaco Editor
  4. 8:14Basic Monaco setup
  5. 8:35Customizing editor colors
  6. 9:38Handling editor changes
  7. 10:39Case study: JSONata playground
  8. 12:46Teaching Monaco a new language
  9. 14:30Adding autocomplete
  10. 15:53Embedding documentation
  11. 17:18Hover tooltips for code
  12. 19:03Keyboard shortcuts and commands
  13. 20:27Key takeaways and closing
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.