Beispiel #1
0
 internal static ComHandle <EnvDTE80.FileCodeModel2, FileCodeModel> Create(
     CodeModelState state,
     object parent,
     DocumentId documentId,
     ITextManagerAdapter textManagerAdapter)
 {
     return(new FileCodeModel(state, parent, documentId, textManagerAdapter).GetComHandle <EnvDTE80.FileCodeModel2, FileCodeModel>());
 }
Beispiel #2
0
 internal static ComHandle <EnvDTE80.FileCodeModel2, FileCodeModel> Create(
     CodeModelState state,
     object?parent,
     DocumentId documentId,
     bool isSourceGeneratorOutput,
     ITextManagerAdapter textManagerAdapter)
 {
     return(new FileCodeModel(state, parent, documentId, isSourceGeneratorOutput, textManagerAdapter).GetComHandle <EnvDTE80.FileCodeModel2, FileCodeModel>());
 }
Beispiel #3
0
 internal static ComHandle <EnvDTE80.FileCodeModel2, FileCodeModel> Create(
     CodeModelState state,
     object?parent,
     DocumentId documentId,
     bool isSourceGeneratorOutput,
     ITextManagerAdapter textManagerAdapter)
 {
     // Keep track that code model was accessed.  We want to get a sense of how widespread usage of it still is.
     Logger.Log(FunctionId.CodeModel_FileCodeModel_Create);
     return(new FileCodeModel(state, parent, documentId, isSourceGeneratorOutput, textManagerAdapter).GetComHandle <EnvDTE80.FileCodeModel2, FileCodeModel>());
 }
Beispiel #4
0
        private FileCodeModel(
            CodeModelState state,
            object parent,
            DocumentId documentId,
            ITextManagerAdapter textManagerAdapter)
            : base(state)
        {
            Debug.Assert(documentId != null);
            Debug.Assert(textManagerAdapter != null);

            _parentHandle       = new ComHandle <object, object>(parent);
            _documentId         = documentId;
            _textManagerAdapter = textManagerAdapter;

            _elementTable = new ElementTable();

            _batchMode      = false;
            _batchDocument  = null;
            _lastSyntaxTree = GetSyntaxTree();
        }
Beispiel #5
0
        private FileCodeModel(
            CodeModelState state,
            object parent,
            DocumentId documentId,
            ITextManagerAdapter textManagerAdapter)
            : base(state)
        {
            Debug.Assert(documentId != null);
            Debug.Assert(textManagerAdapter != null);

            _parentHandle      = new ComHandle <object, object>(parent);
            _documentId        = documentId;
            TextManagerAdapter = textManagerAdapter;

            _codeElementTable = new CleanableWeakComHandleTable <SyntaxNodeKey, EnvDTE.CodeElement>(state.ThreadingContext);

            _batchMode      = false;
            _batchDocument  = null;
            _lastSyntaxTree = GetSyntaxTree();
        }
Beispiel #6
0
        private FileCodeModel(
            CodeModelState state,
            object?parent,
            DocumentId documentId,
            bool isSourceGeneratedOutput,
            ITextManagerAdapter textManagerAdapter)
            : base(state)
        {
            RoslynDebug.AssertNotNull(documentId);
            RoslynDebug.AssertNotNull(textManagerAdapter);

            _parentHandle            = new ComHandle <object?, object?>(parent);
            _documentId              = documentId;
            _isSourceGeneratedOutput = isSourceGeneratedOutput;
            TextManagerAdapter       = textManagerAdapter;

            _codeElementTable = new CleanableWeakComHandleTable <SyntaxNodeKey, EnvDTE.CodeElement>(state.ThreadingContext);

            _batchMode      = false;
            _batchDocument  = null;
            _lastSyntaxTree = GetSyntaxTree();
        }