Ejemplo n.º 1
0
        private void InitializeEditor()
        {
            _editCount++;

            if (_editCount == 1)
            {
                Debug.Assert(_invisibleEditor == null);

                _invisibleEditor = Workspace.OpenInvisibleEditor(GetDocumentId());
                CodeModelService.AttachFormatTrackingToBuffer(_invisibleEditor.TextBuffer);
            }
        }
Ejemplo n.º 2
0
        private void InitializeEditor()
        {
            // If this is a source generated file, we can't edit it, so just block this at the very start.
            // E_FAIL is probably as a good as anything else, is and is also what we use files that go missing
            // so it's consistent for "this file isn't something you can use."
            if (_isSourceGeneratedOutput)
            {
                throw Exceptions.ThrowEFail();
            }

            _editCount++;

            if (_editCount == 1)
            {
                Debug.Assert(_invisibleEditor == null);

                _invisibleEditor = Workspace.OpenInvisibleEditor(GetDocumentId());
                CodeModelService.AttachFormatTrackingToBuffer(_invisibleEditor.TextBuffer);
            }
        }