protected override void Initialize()
        {
            base.Initialize();

            defaultCompletionWidget = CompletionWidget;
            defaultDocumentContext  = DocumentContext;
            defaultEditor           = Editor;
            completionBuilder       = RazorCompletionBuilderService.GetBuilder("C#");

            // defaultEditor.TextChanging += UnderlyingDocument_TextReplacing;
            //syntaxMode = new RazorSyntaxMode (Editor, DocumentContext);
            //var textEditorData = DocumentContext.GetContent<TextEditorData> ();
            //if (textEditorData != null)
            //	textEditorData.Document.SyntaxMode = syntaxMode;
        }
Example #2
0
        public override void Initialize()
        {
            base.Initialize();

            defaultCompletionWidget = CompletionWidget;
            defaultDocument         = Document;
            completionBuilder       = RazorCompletionBuilderService.GetBuilder("C#");

            defaultDocument.Editor.Document.TextReplacing += UnderlyingDocument_TextReplacing;
            defaultDocument.Editor.Caret.PositionChanged  += delegate
            {
                OnCompletionContextChanged(CompletionWidget, EventArgs.Empty);
            };
            syntaxMode = new RazorSyntaxMode(Document);
            defaultDocument.Editor.Document.SyntaxMode = syntaxMode;
        }