Click or drag to resize

Altaxo's code editor

Previous section: Export of a text document


The code editor in Altaxo is used to create, edit, and finally run scripts written in the C# programming language. The scripts are compiled using the Roslyn compiler, an open source project from Microsoft. In this way it keeps pace with the development of the C# language. Additionally, Roslyn is powering some features that make working with scripts more comfortable. These features are:

  • Semantic highlighting: the text is colored according to the semantics.

  • Code completion: the editor gives you a list of class names available, member names that are valid in the given context and so on. This makes it very ease to write code, and method names can be long and meaningful.

  • Signature help: closely related to code completion, signature help shows you different signatures of (overloaded) methods.

  • Brace matching: if the cursor is at an open or closing brace, the corresponding brace will be highlighted, too.

  • Diagnostics: code fragments that will not compile have red squiggles under the text.

  • Documentation: documentation text that you have added to methods you have added to your script is shown when you use those methods in other parts of your script text.

  • External help: if you place the cursor on a .NET framework class or member and press F1, the documentation web page from Microsoft will be shown. Likewise, if you place the cursor on an Altaxo class or member, the documentation web page of Altaxo's class library will be shown in the browser.

  • Folding: code fragments that are framed inside of #region and #endregion statements can be folded away or expanded again using the sidebar.

  • Go to definition: if you place the cursor at a variable name and hit F12, the cursor jumps to the location where the variable is defined.

  • Live document formatting: as you write the code, the code is formatted (at the end of the line when you enter the final semicolon, or at the end of a block when you enter the closing brace).

  • Reference highlighting: if you click into a variable, all occurrences of that variable in the text will be highlighted.

  • Quick info: hover the mouse over a variable, a class or a method, and you will get a quick info concerning that item.

  • Renaming: clicking into a variable name and then press F2 allows you to rename that variable. The name will be replaced in all occurrences of that variable.


Next section: Keyboard shortcuts and commands