Exemplo n.º 1
0
 public ProtocolInfo(IPythonProjectEntry declaringModule)
 {
     _protocols       = new List <Protocol>();
     DeclaringModule  = declaringModule;
     DeclaringVersion = declaringModule?.AnalysisVersion ?? -1;
     _references      = new ReferenceDict();
 }
 public ProtocolInfo(IPythonProjectEntry declaringModule, PythonAnalyzer state)
 {
     _protocols       = AnalysisSet.CreateUnion(1);
     DeclaringModule  = declaringModule;
     DeclaringVersion = declaringModule?.AnalysisVersion ?? -1;
     _references      = new ReferenceDict();
     State            = state ?? throw new ArgumentNullException(nameof(state));
 }
Exemplo n.º 3
0
 internal override void AddReference(Node node, AnalysisUnit unit)
 {
     if (!unit.ForEval)
     {
         if (_references == null)
         {
             _references = new ReferenceDict();
         }
         _references.GetReferences(unit.DeclaringModule.ProjectEntry).AddReference(new EncodedLocation(unit, node));
     }
 }
 public void AddReference(Node node, AnalysisUnit unit, string name)
 {
     if (!unit.ForEval)
     {
         if (_references == null)
         {
             _references = new Dictionary <string, ReferenceDict>();
         }
         ReferenceDict refs;
         if (!_references.TryGetValue(name, out refs))
         {
             _references[name] = refs = new ReferenceDict();
         }
         refs.GetReferences(unit.DeclaringModule.ProjectEntry).AddReference(new EncodedLocation(unit.Tree, node));
     }
 }
Exemplo n.º 5
0
 public void AddReference(Node node, AnalysisUnit unit, string name)
 {
     if (!unit.ForEval)
     {
         ReferenceDict refs;
         lock (_references) {
             if (!_references.TryGetValue(name, out refs))
             {
                 _references[name] = refs = new ReferenceDict();
             }
         }
         lock (refs) {
             refs.GetReferences(unit.DeclaringModule.ProjectEntry)
             .AddReference(new EncodedLocation(unit, node));
         }
     }
 }