예제 #1
0
        private void TE_TextChanged(object sender, EventArgs e)
        {
            toolTipService.RemoveAll();
            textMarkerService.RemoveAll(delegate(ITextMarker marker) { return(true); });

            var textEditor = sender as TextEditor;
            var text       = textEditor.Text;
            var tuple      = Controller.Check(text);

            Errors = tuple.Item2;
            tree   = tuple.Item1;

            Debug.WriteLine("\n");
            Errors.ForEach((VoltaCompilerError error) => {
                int offset         = textEditor.Document.GetOffset(error.Line, error.Column);
                ITextMarker marker = textMarkerService.Create(offset, 0);
                marker.MarkerTypes = TextMarkerTypes.SquigglyUnderline;
                marker.MarkerColor = Colors.Red;

                toolTipService.CreateErrorToolTip(error, marker as TextMarker);
            });

            OnErrorListUpdated?.Invoke(Errors);

            if (e != null)
            {
                CodeFile.HasUnsavedChanges = true;
            }
        }
예제 #2
0
 public new void Focus()
 {
     OnEditorCaretChanged?.Invoke(TE.TextArea.Caret);
     OnErrorListUpdated?.Invoke(Errors);
 }