Embedded Monaco Editor

This simple example demonstrates how to embed a Monaco editor into a browser and how to connect it to the Xtext based implementation of the language server via the protocol.


Instructions

  • With the provided example language one can define constants and basic functions.
  • The editor includes a bunch of pre-defined mathematical functions such as square root of a number or the absolute value of a number. Besides that some constants (such as Pi) are also available.
  • The editor support content proposal via the Ctrl + Space binding.
  • Editor validates unique constant and function names. It also checks the correctness of the function arguments.
  • When the caret is on an expression, one can perform a top level, inline expression evaluation via the Shift + Enter binding in the editor.
  • Previous inline evaluations can be cleared via the Ctrl + X key binding.