コード例 #1
0
        /// <summary>
        /// Gets the document in this solution with the specified syntax tree.
        /// </summary>
        public LogicalDocument GetLogicalDocument(SyntaxTreeBase syntaxTree)
        {
            if (syntaxTree != null)
            {
                // is this tree known to be associated with a document?
                return(LogicalDocument.GetDocumentIdForTree(syntaxTree));
            }

            return(null);
        }
コード例 #2
0
 private static void BindSyntaxTreeToId(SyntaxTreeBase tree, LogicalDocument id)
 {
     using (s_syntaxTreeToIdMapLock.DisposableWrite())
     {
         if (s_syntaxTreeToIdMap.TryGetValue(tree, out var existingId))
         {
             Contract.ThrowIfFalse(existingId == id);
         }
         else
         {
             s_syntaxTreeToIdMap.Add(tree, id);
         }
     }
 }
コード例 #3
0
 public DocumentSpan(LogicalDocument document, SourceFileSpan sourceSpan)
 {
     Document   = document;
     SourceSpan = sourceSpan;
 }