Vixen
dd8b0a81
csharp
public class CodeEditorView

A code editor over a document, with its diagnostics in the gutter.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The pane, not the editor. CodeEditor is the control — lines, folding, completion, a caret — and this is what joins one to a CodeDocument: the buffer, the tokenizer, and putting the analysis back on it after it runs.

⚠ Analysis is driven from here and is not automatic. Analyse is called by whatever decides when a pause has happened — the host's frame loop, a timer, a Save — because parsing per keystroke is a parse per keystroke and a document that did it for you could not be talked out of it.

The pane is CodeEditorView.vxml; this file is the accessibility modifier and the two factories, on the arrangement FactRow and NodeInspector use. The emitter's partial carries no modifier, and this type is public because PreviewCodeEditorView derives from it and because the shader editor's factory hands one out.

Fields and properties (8)

  • protected override string TagName
  • protected override bool AcceptsFocus

    Whether the focus can rest on this kind of control at all.

  • public CodeEditor Editor

    The editor.

  • public UiElement Chrome

    The bar above the editor.

  • public ToggleButton Wrap

    The word-wrap toggle.

  • public bool Wrapped

    Whether long lines are broken across rows.

  • public CodeDocument? Edited

    The document being edited, or .

  • public int Errors

    How many errors the last analysis found.

Methods (5)

  • protected override void OnCreated()
  • protected override void OnRemoved()
  • public virtual void Show(CodeDocument code)

    Shows a document.

  • public int Analyse()

    Runs the document's analysis and puts the result in the gutter.

  • protected virtual void Restate(CodeDocument code)

    Called after the document has been analysed.

Used by (3)

  • EditorViewTestsVixen.Editor.AssetEditors.Tests
  • PreviewCodeEditorViewVixen.Editor.AssetEditors
  • ShaderEditorFactoryVixen.Editor.AssetEditors