/// <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); }
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); } } }
public DocumentSpan(LogicalDocument document, SourceFileSpan sourceSpan) { Document = document; SourceSpan = sourceSpan; }