示例#1
0
 public PreviewFactoryService(
     IThreadingContext threadingContext,
     ITextBufferFactoryService textBufferFactoryService,
     IContentTypeRegistryService contentTypeRegistryService,
     IProjectionBufferFactoryService projectionBufferFactoryService,
     ICocoaTextEditorFactoryService textEditorFactoryService,
     IEditorOptionsFactoryService editorOptionsFactoryService,
     ITextDifferencingSelectorService differenceSelectorService,
     IDifferenceBufferFactoryService differenceBufferService,
     ICocoaDifferenceViewerFactoryService differenceViewerService
     )
     : base(
         threadingContext,
         textBufferFactoryService,
         contentTypeRegistryService,
         projectionBufferFactoryService,
         editorOptionsFactoryService,
         differenceSelectorService,
         differenceBufferService,
         textEditorFactoryService.CreateTextViewRoleSet(
             TextViewRoles.PreviewRole,
             PredefinedTextViewRoles.Analyzable
             )
         )
 {
     _differenceViewerService = differenceViewerService;
 }
示例#2
0
 public PreviewEngine(
     string title,
     string helpString,
     string description,
     string topLevelItemName,
     Glyph topLevelGlyph,
     Solution newSolution,
     Solution oldSolution,
     IComponentModel componentModel,
     IVsImageService2 imageService,
     bool showCheckBoxes = true)
 {
     _topLevelName = topLevelItemName;
     _topLevelGlyph = topLevelGlyph;
     _title = title;
     _helpString = helpString;
     _description = description;
     _newSolution = newSolution.WithMergedLinkedFileChangesAsync(oldSolution, cancellationToken: CancellationToken.None).Result;
     _oldSolution = oldSolution;
     _diffSelector = componentModel.GetService<ITextDifferencingSelectorService>();
     _editorFactory = componentModel.GetService<IVsEditorAdaptersFactoryService>();
     _componentModel = componentModel;
     this.ShowCheckBoxes = showCheckBoxes;
     _imageService = imageService;
 }
示例#3
0
        public PreviewFactoryService(
            IThreadingContext threadingContext,
            ITextBufferFactoryService textBufferFactoryService,
            IContentTypeRegistryService contentTypeRegistryService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            ITextDifferencingSelectorService differenceSelectorService,
            IDifferenceBufferFactoryService differenceBufferService,
            IWpfDifferenceViewerFactoryService differenceViewerService)
            : base(threadingContext)
        {
            Contract.ThrowIfFalse(ThreadingContext.HasMainThread);

            _textBufferFactoryService       = textBufferFactoryService;
            _contentTypeRegistryService     = contentTypeRegistryService;
            _projectionBufferFactoryService = projectionBufferFactoryService;
            _editorOptionsFactoryService    = editorOptionsFactoryService;
            _differenceSelectorService      = differenceSelectorService;
            _differenceBufferService        = differenceBufferService;
            _differenceViewerService        = differenceViewerService;

            _previewRoleSet = textEditorFactoryService.CreateTextViewRoleSet(
                TextViewRoles.PreviewRole, PredefinedTextViewRoles.Analyzable);
        }
        public ContainedDocument(
            IThreadingContext threadingContext,
            DocumentId documentId,
            ITextBuffer subjectBuffer,
            ITextBuffer dataBuffer,
            IVsTextBufferCoordinator bufferCoordinator,
            Workspace workspace,
            VisualStudioProject project,
            IComponentModel componentModel,
            AbstractFormattingRule vbHelperFormattingRule)
            : base(threadingContext)
        {
            _componentModel = componentModel;
            _workspace      = workspace;
            _project        = project;

            Id                = documentId;
            SubjectBuffer     = subjectBuffer;
            DataBuffer        = dataBuffer;
            BufferCoordinator = bufferCoordinator;

            _differenceSelectorService = componentModel.GetService <ITextDifferencingSelectorService>();
            _snapshotTracker           = new ReiteratedVersionSnapshotTracker(SubjectBuffer);
            _vbHelperFormattingRule    = vbHelperFormattingRule;

            _hostType = GetHostType();
            s_containedDocuments.TryAdd(documentId, this);
        }
示例#5
0
 public PreviewEngine(
     IThreadingContext threadingContext,
     string title,
     string helpString,
     string description,
     string topLevelItemName,
     Glyph topLevelGlyph,
     Solution newSolution,
     Solution oldSolution,
     IComponentModel componentModel,
     IVsImageService2 imageService,
     bool showCheckBoxes = true)
     : base(threadingContext)
 {
     _topLevelName       = topLevelItemName;
     _topLevelGlyph      = topLevelGlyph;
     _title              = title ?? throw new ArgumentNullException(nameof(title));
     _helpString         = helpString ?? throw new ArgumentNullException(nameof(helpString));
     _description        = description ?? throw new ArgumentNullException(nameof(description));
     _newSolution        = newSolution.WithMergedLinkedFileChangesAsync(oldSolution, cancellationToken: CancellationToken.None).Result;
     _oldSolution        = oldSolution;
     _diffSelector       = componentModel.GetService <ITextDifferencingSelectorService>();
     _editorFactory      = componentModel.GetService <IVsEditorAdaptersFactoryService>();
     _componentModel     = componentModel;
     this.ShowCheckBoxes = showCheckBoxes;
     _imageService       = imageService;
 }
示例#6
0
        public ContainedDocument(
            AbstractContainedLanguage containedLanguage,
            SourceCodeKind sourceCodeKind,
            Workspace workspace,
            IVsHierarchy hierarchy,
            uint itemId,
            IComponentModel componentModel,
            IFormattingRule vbHelperFormattingRule)
        {
            Contract.ThrowIfNull(containedLanguage);

            _containedLanguage = containedLanguage;
            _sourceCodeKind    = sourceCodeKind;
            _componentModel    = componentModel;
            _workspace         = workspace;
            _optionService     = _workspace.Services.GetService <IOptionService>();
            _hostType          = GetHostType();

            var rdt = (IVsRunningDocumentTable)componentModel.GetService <SVsServiceProvider>().GetService(typeof(SVsRunningDocumentTable));

            IVsHierarchy sharedHierarchy;
            uint         itemIdInSharedHierarchy;
            var          isSharedHierarchy = LinkedFileUtilities.TryGetSharedHierarchyAndItemId(hierarchy, itemId, out sharedHierarchy, out itemIdInSharedHierarchy);

            var filePath = isSharedHierarchy
                ? rdt.GetMonikerForHierarchyAndItemId(sharedHierarchy, itemIdInSharedHierarchy)
                : rdt.GetMonikerForHierarchyAndItemId(hierarchy, itemId);

            // we couldn't look up the document moniker in RDT for a hierarchy/item pair
            // Since we only use this moniker as a key, we could fall back to something else, like the document name.
            if (filePath == null)
            {
                Debug.Assert(false, "Could not get the document moniker for an item in its hierarchy.");
                filePath = hierarchy.GetDocumentNameForHierarchyAndItemId(itemId);
            }

            if (Project.Hierarchy != null)
            {
                string moniker;
                Project.Hierarchy.GetCanonicalName(itemId, out moniker);
                _itemMoniker = moniker;
            }

            this.Key     = new DocumentKey(Project, filePath);
            this.Id      = DocumentId.CreateNewId(Project.Id, filePath);
            this.Folders = containedLanguage.Project.GetFolderNames(itemId);
            this.Loader  = TextLoader.From(containedLanguage.SubjectBuffer.AsTextContainer(), VersionStamp.Create(), filePath);
            _differenceSelectorService = componentModel.GetService <ITextDifferencingSelectorService>();
            _snapshotTracker           = new ReiteratedVersionSnapshotTracker(_containedLanguage.SubjectBuffer);
            _vbHelperFormattingRule    = vbHelperFormattingRule;
        }
示例#7
0
        public ContainedDocument(
            AbstractContainedLanguage containedLanguage,
            SourceCodeKind sourceCodeKind,
            Workspace workspace,
            IVsHierarchy hierarchy,
            uint itemId,
            IComponentModel componentModel,
            IFormattingRule vbHelperFormattingRule)
        {
            Contract.ThrowIfNull(containedLanguage);
            Contract.ThrowIfFalse(containedLanguage.Project is AbstractLegacyProject);

            _containedLanguage = containedLanguage;
            _sourceCodeKind    = sourceCodeKind;
            _componentModel    = componentModel;
            _workspace         = workspace;
            _hostType          = GetHostType();

            string filePath;

            if (!ErrorHandler.Succeeded(((IVsProject)hierarchy).GetMkDocument(itemId, out filePath)))
            {
                // we couldn't look up the document moniker from an hierarchy for an itemid.
                // Since we only use this moniker as a key, we could fall back to something else, like the document name.
                Debug.Assert(false, "Could not get the document moniker for an item from its hierarchy.");
                if (!hierarchy.TryGetItemName(itemId, out filePath))
                {
                    Environment.FailFast("Failed to get document moniker for a contained document");
                }
            }

            if (Project.Hierarchy != null)
            {
                string moniker;
                Project.Hierarchy.GetCanonicalName(itemId, out moniker);
                _itemMoniker = moniker;
            }

            this.Key     = new DocumentKey(Project, filePath);
            this.Id      = DocumentId.CreateNewId(Project.Id, filePath);
            this.Folders = ((AbstractLegacyProject)containedLanguage.Project).GetFolderNames(itemId);
            this.Loader  = TextLoader.From(containedLanguage.SubjectBuffer.AsTextContainer(), VersionStamp.Create(), filePath);
            _differenceSelectorService = componentModel.GetService <ITextDifferencingSelectorService>();
            _snapshotTracker           = new ReiteratedVersionSnapshotTracker(_containedLanguage.SubjectBuffer);
            _vbHelperFormattingRule    = vbHelperFormattingRule;
        }
 public AbstractPreviewFactoryService(
     IThreadingContext threadingContext,
     ITextBufferFactoryService textBufferFactoryService,
     IContentTypeRegistryService contentTypeRegistryService,
     IProjectionBufferFactoryService projectionBufferFactoryService,
     EditorOptionsService editorOptionsService,
     ITextDifferencingSelectorService differenceSelectorService,
     IDifferenceBufferFactoryService differenceBufferService,
     ITextViewRoleSet previewRoleSet)
 {
     ThreadingContext                = threadingContext;
     _textBufferFactoryService       = textBufferFactoryService;
     _contentTypeRegistryService     = contentTypeRegistryService;
     _projectionBufferFactoryService = projectionBufferFactoryService;
     _editorOptionsService           = editorOptionsService;
     _differenceSelectorService      = differenceSelectorService;
     _differenceBufferService        = differenceBufferService;
     _previewRoleSet = previewRoleSet;
 }
示例#9
0
        public EditActionPreviewProvider(
            ITextBufferFactoryService textBufferFactoryService,
            ITextDocumentFactoryService textDocumentFactoryService,
            ITextDifferencingSelectorService textDifferencingSelectorService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            IDifferenceBufferFactoryService differenceBufferFactoryService,
            IWpfDifferenceViewerFactoryService wpfDifferenceViewerFactoryService,
            ITextEditorFactoryService textEditorFactoryService)
        {
            this.textBufferFactoryService          = textBufferFactoryService;
            this.textDocumentFactoryService        = textDocumentFactoryService;
            this.textDifferencingSelectorService   = textDifferencingSelectorService;
            this.projectionBufferFactoryService    = projectionBufferFactoryService;
            this.editorOptionsFactoryService       = editorOptionsFactoryService;
            this.differenceBufferFactoryService    = differenceBufferFactoryService;
            this.wpfDifferenceViewerFactoryService = wpfDifferenceViewerFactoryService;

            this.previewRoleSet = textEditorFactoryService.CreateTextViewRoleSet(PredefinedTextViewRoles.Analyzable);
        }
示例#10
0
        private MonoDevelopContainedDocument(ITextBuffer languageBuffer, IProjectionBuffer dataBuffer, IMonoDevelopContainedLanguageHost containedLanguageHost)
        {
            LanguageBuffer        = languageBuffer;
            DataBuffer            = dataBuffer;
            ContainedLanguageHost = containedLanguageHost;

            _differenceSelectorService = CompositionManager.GetExportedValue <ITextDifferencingSelectorService> ();

            var container    = languageBuffer.CurrentSnapshot.AsText().Container;
            var registration = Workspace.GetWorkspaceRegistration(container);

            if (registration.Workspace == null)
            {
                registration.WorkspaceChanged += Registration_WorkspaceChanged;
            }
            else
            {
                FinishInitialization();
            }
        }
示例#11
0
        public PreviewFactoryService(
            ITextBufferFactoryService textBufferFactoryService,
            IContentTypeRegistryService contentTypeRegistryService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            ITextDifferencingSelectorService differenceSelectorService,
            IDifferenceBufferFactoryService differenceBufferService,
            IWpfDifferenceViewerFactoryService differenceViewerService)
        {
            _textBufferFactoryService       = textBufferFactoryService;
            _contentTypeRegistryService     = contentTypeRegistryService;
            _projectionBufferFactoryService = projectionBufferFactoryService;
            _editorOptionsFactoryService    = editorOptionsFactoryService;
            _differenceSelectorService      = differenceSelectorService;
            _differenceBufferService        = differenceBufferService;
            _differenceViewerService        = differenceViewerService;

            _previewRoleSet = textEditorFactoryService.CreateTextViewRoleSet(
                TextViewRoles.PreviewRole, PredefinedTextViewRoles.Analyzable);
        }
示例#12
0
        public PreviewFactoryService(
            ITextBufferFactoryService textBufferFactoryService,
            IContentTypeRegistryService contentTypeRegistryService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            ITextDifferencingSelectorService differenceSelectorService,
            IDifferenceBufferFactoryService differenceBufferService,
            IWpfDifferenceViewerFactoryService differenceViewerService)
        {
            _textBufferFactoryService = textBufferFactoryService;
            _contentTypeRegistryService = contentTypeRegistryService;
            _projectionBufferFactoryService = projectionBufferFactoryService;
            _editorOptionsFactoryService = editorOptionsFactoryService;
            _differenceSelectorService = differenceSelectorService;
            _differenceBufferService = differenceBufferService;
            _differenceViewerService = differenceViewerService;

            _previewRoleSet = textEditorFactoryService.CreateTextViewRoleSet(
                TextViewRoles.PreviewRole, PredefinedTextViewRoles.Analyzable);
        }
        public AbstractPreviewFactoryService(
            IThreadingContext threadingContext,
            ITextBufferFactoryService textBufferFactoryService,
            IContentTypeRegistryService contentTypeRegistryService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            ITextDifferencingSelectorService differenceSelectorService,
            IDifferenceBufferFactoryService differenceBufferService,
            ITextViewRoleSet previewRoleSet)
            : base(threadingContext)
        {
            Contract.ThrowIfFalse(ThreadingContext.HasMainThread);

            _textBufferFactoryService       = textBufferFactoryService;
            _contentTypeRegistryService     = contentTypeRegistryService;
            _projectionBufferFactoryService = projectionBufferFactoryService;
            _editorOptionsFactoryService    = editorOptionsFactoryService;
            _differenceSelectorService      = differenceSelectorService;
            _differenceBufferService        = differenceBufferService;

            _previewRoleSet = previewRoleSet;
        }
示例#14
0
        public ContainedDocument(
            AbstractContainedLanguage containedLanguage,
            SourceCodeKind sourceCodeKind,
            Workspace workspace,
            IVsHierarchy hierarchy,
            uint itemId,
            IComponentModel componentModel,
            IFormattingRule vbHelperFormattingRule)
        {
            Contract.ThrowIfNull(containedLanguage);

            _containedLanguage = containedLanguage;
            _sourceCodeKind    = sourceCodeKind;
            _componentModel    = componentModel;
            _workspace         = workspace;
            _optionService     = _workspace.Services.GetService <IOptionService>();
            _hostType          = GetHostType();

            var rdt      = (IVsRunningDocumentTable)componentModel.GetService <SVsServiceProvider>().GetService(typeof(SVsRunningDocumentTable));
            var filePath = rdt.GetMonikerForHierarchyAndItemId(hierarchy, itemId);

            this.SharedHierarchy = hierarchy == null ? null : LinkedFileUtilities.GetSharedHierarchyForItem(hierarchy, itemId);

            if (Project.Hierarchy != null)
            {
                string moniker;
                Project.Hierarchy.GetCanonicalName(itemId, out moniker);
                _itemMoniker = moniker;
            }

            this.Key     = new DocumentKey(Project, filePath);
            this.Id      = DocumentId.CreateNewId(Project.Id, filePath);
            this.Folders = containedLanguage.Project.GetFolderNames(itemId);
            this.Loader  = TextLoader.From(containedLanguage.SubjectBuffer.AsTextContainer(), VersionStamp.Create(), filePath);
            _differenceSelectorService = componentModel.GetService <ITextDifferencingSelectorService>();
            _snapshotTracker           = new ReiteratedVersionSnapshotTracker(_containedLanguage.SubjectBuffer);
            _vbHelperFormattingRule    = vbHelperFormattingRule;
        }
        public PreviewFactoryService(
            ITextBufferFactoryService textBufferFactoryService,
            IContentTypeRegistryService contentTypeRegistryService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            ITextDifferencingSelectorService differenceSelectorService,
            IDifferenceBufferFactoryService differenceBufferService,
            IWpfDifferenceViewerFactoryService differenceViewerService)
        {
            Contract.ThrowIfTrue(this.ForegroundKind == ForegroundThreadDataKind.Unknown);

            _textBufferFactoryService       = textBufferFactoryService;
            _contentTypeRegistryService     = contentTypeRegistryService;
            _projectionBufferFactoryService = projectionBufferFactoryService;
            _editorOptionsFactoryService    = editorOptionsFactoryService;
            _differenceSelectorService      = differenceSelectorService;
            _differenceBufferService        = differenceBufferService;
            _differenceViewerService        = differenceViewerService;

            _previewRoleSet = textEditorFactoryService.CreateTextViewRoleSet(
                TextViewRoles.PreviewRole, PredefinedTextViewRoles.Analyzable);
        }
 public EditorTextDifferencingService(ITextBufferFactoryService textBufferFactoryService, ITextDifferencingSelectorService differenceSelectorService)
 {
     _textBufferFactoryService = textBufferFactoryService;
     _differenceSelectorService = differenceSelectorService;
 }
示例#17
0
        public ContainedDocument(
            AbstractContainedLanguage containedLanguage,
            SourceCodeKind sourceCodeKind,
            Workspace workspace,
            IVsHierarchy hierarchy,
            uint itemId,
            IComponentModel componentModel,
            IFormattingRule vbHelperFormattingRule)
        {
            Contract.ThrowIfNull(containedLanguage);

            _containedLanguage = containedLanguage;
            _sourceCodeKind = sourceCodeKind;
            _componentModel = componentModel;
            _workspace = workspace;
            _optionService = _workspace.Services.GetService<IOptionService>();
            _hostType = GetHostType();

            var rdt = (IVsRunningDocumentTable)componentModel.GetService<SVsServiceProvider>().GetService(typeof(SVsRunningDocumentTable));
            var filePath = rdt.GetMonikerForHierarchyAndItemId(hierarchy, itemId);

            if (Project.Hierarchy != null)
            {
                string moniker;
                Project.Hierarchy.GetCanonicalName(itemId, out moniker);
                _itemMoniker = moniker;
            }

            this.Key = new DocumentKey(Project, filePath);
            this.Id = DocumentId.CreateNewId(Project.Id, filePath);
            this.Folders = containedLanguage.Project.GetFolderNames(itemId);
            this.Loader = TextLoader.From(containedLanguage.SubjectBuffer.AsTextContainer(), VersionStamp.Create(), filePath);
            _differenceSelectorService = componentModel.GetService<ITextDifferencingSelectorService>();
            _snapshotTracker = new ReiteratedVersionSnapshotTracker(_containedLanguage.SubjectBuffer);
            _vbHelperFormattingRule = vbHelperFormattingRule;
        }
示例#18
0
 public EditorTextDifferencingService(ITextBufferFactoryService textBufferFactoryService, ITextDifferencingSelectorService differenceSelectorService)
 {
     _textBufferFactoryService  = textBufferFactoryService;
     _differenceSelectorService = differenceSelectorService;
 }
示例#19
0
        public ContainedDocument(
            AbstractContainedLanguage containedLanguage,
            SourceCodeKind sourceCodeKind,
            Workspace workspace,
            IVsHierarchy hierarchy,
            uint itemId,
            IComponentModel componentModel,
            IFormattingRule vbHelperFormattingRule)
        {
            Contract.ThrowIfNull(containedLanguage);

            _containedLanguage = containedLanguage;
            _sourceCodeKind = sourceCodeKind;
            _componentModel = componentModel;
            _workspace = workspace;
            _optionService = _workspace.Services.GetService<IOptionService>();
            _hostType = GetHostType();

            string filePath;
            if (!ErrorHandler.Succeeded(((IVsProject)hierarchy).GetMkDocument(itemId, out filePath)))
            {
                // we couldn't look up the document moniker from an hierarchy for an itemid.
                // Since we only use this moniker as a key, we could fall back to something else, like the document name.
                Debug.Assert(false, "Could not get the document moniker for an item from its hierarchy.");
                if (!hierarchy.TryGetItemName(itemId, out filePath))
                {
                    Environment.FailFast("Failed to get document moniker for a contained document");
                }
            }

            if (Project.Hierarchy != null)
            {
                string moniker;
                Project.Hierarchy.GetCanonicalName(itemId, out moniker);
                _itemMoniker = moniker;
            }

            this.Key = new DocumentKey(Project, filePath);
            this.Id = DocumentId.CreateNewId(Project.Id, filePath);
            this.Folders = containedLanguage.Project.GetFolderNames(itemId);
            this.Loader = TextLoader.From(containedLanguage.SubjectBuffer.AsTextContainer(), VersionStamp.Create(), filePath);
            _differenceSelectorService = componentModel.GetService<ITextDifferencingSelectorService>();
            _snapshotTracker = new ReiteratedVersionSnapshotTracker(_containedLanguage.SubjectBuffer);
            _vbHelperFormattingRule = vbHelperFormattingRule;
        }
 public EditorTextDifferencingService(ITextDifferencingSelectorService differenceSelectorService)
 => _differenceSelectorService = differenceSelectorService;
示例#21
0
        public ContainedDocument(
            AbstractContainedLanguage containedLanguage,
            SourceCodeKind sourceCodeKind,
            Workspace workspace,
            IVsHierarchy hierarchy,
            uint itemId,
            IComponentModel componentModel,
            IFormattingRule vbHelperFormattingRule)
        {
            Contract.ThrowIfNull(containedLanguage);

            _containedLanguage = containedLanguage;
            _sourceCodeKind = sourceCodeKind;
            _componentModel = componentModel;
            _workspace = workspace;
            _optionService = _workspace.Services.GetService<IOptionService>();
            _hostType = GetHostType();

            var rdt = (IVsRunningDocumentTable)componentModel.GetService<SVsServiceProvider>().GetService(typeof(SVsRunningDocumentTable));

            IVsHierarchy sharedHierarchy;
            uint itemIdInSharedHierarchy;
            var isSharedHierarchy = LinkedFileUtilities.TryGetSharedHierarchyAndItemId(hierarchy, itemId, out sharedHierarchy, out itemIdInSharedHierarchy);

            var filePath = isSharedHierarchy
                ? rdt.GetMonikerForHierarchyAndItemId(sharedHierarchy, itemIdInSharedHierarchy)
                : rdt.GetMonikerForHierarchyAndItemId(hierarchy, itemId);

            // we couldn't look up the document moniker in RDT for a hierarchy/item pair
            // Since we only use this moniker as a key, we could fall back to something else, like the document name.
            if (filePath == null)
            {
                Debug.Assert(false, "Could not get the document moniker for an item in its hierarchy.");
                filePath = hierarchy.GetDocumentNameForHierarchyAndItemId(itemId);
            }

            if (Project.Hierarchy != null)
            {
                string moniker;
                Project.Hierarchy.GetCanonicalName(itemId, out moniker);
                _itemMoniker = moniker;
            }

            this.Key = new DocumentKey(Project, filePath);
            this.Id = DocumentId.CreateNewId(Project.Id, filePath);
            this.Folders = containedLanguage.Project.GetFolderNames(itemId);
            this.Loader = TextLoader.From(containedLanguage.SubjectBuffer.AsTextContainer(), VersionStamp.Create(), filePath);
            _differenceSelectorService = componentModel.GetService<ITextDifferencingSelectorService>();
            _snapshotTracker = new ReiteratedVersionSnapshotTracker(_containedLanguage.SubjectBuffer);
            _vbHelperFormattingRule = vbHelperFormattingRule;
        }