Example #1
0
        private void writeSignature(string type, ICodeReference coderef, string[] additional)
        {
            var json = "";

            if (coderef.JSON != null)
            {
                json = coderef.JSON;
            }
            var additionalArguments = "";

            if (_visibility == true)
            {
                foreach (var argument in additional)
                {
                    additionalArguments += "|" + argument;
                }
            }
            _writer.Write("signature|{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}{8}",
                          coderef.Parent,
                          coderef.Signature,
                          coderef.Name,
                          type,
                          coderef.Scope,
                          coderef.Line,
                          coderef.Column,
                          json,
                          additionalArguments);
        }
Example #2
0
 private void add(ICodeReference reference)
 {
     if (_codeReferences.Any(x => x.Is(reference)))
     {
         return;
     }
     _codeReferences.Add(reference);
 }
Example #3
0
        private void addSignaturePosition(ICodeReference x)
        {
            var fullSignature = x.Signature;

            if (!_signaturePositions.ContainsKey(fullSignature))
            {
                _signaturePositions.Add(fullSignature, new FilePosition(x.File.File, x.Line, x.Column));
            }
        }
Example #4
0
 public string Format(ICodeReference reference)
 {
     return string.Format("signature|{0}|{1}|{2}|{3}|{4}|{5}",
         reference.Signature,
         reference.Name,
         reference.Type,
         reference.Offset,
         reference.Line,
         reference.Column);
 }
Example #5
0
        private void addNameAndTypeIndex(ICodeReference x)
        {
            var signature = x.Parent + "." + x.Name;

            _typeIndex.Add(signature);
            if (!_nameIndex.ContainsKey(x.Name))
            {
                _nameIndex.Add(x.Name, signature);
            }
        }
 private void addItem(ICodeReference type)
 {
     var item = informationList.Items.Add(type.Language);
     item.SubItems.Add(type.Type);
     item.SubItems.Add(type.Name);
     item.SubItems.Add(
         string.Format("{0} ({1})",
             type.Signature,
             Path.GetFileName(type.File)));
     item.Tag = type;
 }
Example #7
0
        private void addItem(ICodeReference type)
        {
            var item = informationList.Items.Add(type.Language);

            item.SubItems.Add(type.Type);
            item.SubItems.Add(type.Name);
            item.SubItems.Add(
                string.Format("{0} ({1})",
                              type.Signature,
                              Path.GetFileName(type.File)));
            item.Tag = type;
        }
Example #8
0
 public string Format(ICodeReference reference)
 {
     return(string.Format("{0}|signature|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}",
                          reference.Language,
                          reference.Parent,
                          reference.Signature,
                          reference.Name,
                          reference.Type,
                          reference.Scope,
                          reference.Line,
                          reference.Column,
                          reference.JSON));
 }
 public string Format(ICodeReference reference)
 {
     return string.Format("{0}|signature|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}",
         reference.Language,
         reference.Parent,
         reference.Signature,
         reference.Name,
         reference.Type,
         reference.Scope,
         reference.Line,
         reference.Column,
         reference.JSON);
 }
Example #10
0
 private void writeSignature(string type, ICodeReference coderef, string[] additional)
 {
     var additionalArguments = "";
     foreach (var argument in additional)
         additionalArguments += "|" + argument;
     Console.WriteLine("signature|{0}|{1}|{2}|{3}|{4}|{5}{6}",
         coderef.Signature,
         coderef.Name,
         type,
         coderef.Offset,
         coderef.Line,
         coderef.Column,
         additionalArguments);
 }
Example #11
0
 public bool Is(ICodeReference compare)
 {
     return
         (Language == compare.Language &&
          Type == compare.Type &&
          File == compare.File &&
          Signature == compare.Signature &&
          Parent == compare.Parent &&
          Name == compare.Name &&
          Scope == compare.Scope &&
          Line == compare.Line &&
          Column == compare.Column &&
          JSON == compare.JSON &&
          TypeSearch == compare.TypeSearch);
 }
Example #12
0
    private void Validate(ICodeReference codeReference)
    {
        string usingNamespace = GetNamespace(codeReference.ReferencingDeclaration);
        string usedNamespace  = GetNamespace(codeReference.ReferencedDeclaration);

        if (usingNamespace.Equals(usedNamespace, StringComparison.Ordinal))
        {
            return;
        }
        if (this.namespaces.Any(
                x => usingNamespace.Equals(x, StringComparison.Ordinal) ||
                (usingNamespace.StartsWith(x, StringComparison.Ordinal) && usingNamespace[x.Length] == '.')))
        {
            return;
        }
        object[] arguments = new object[] { /*...*/ };
        Message.Write(MessageLocation.Of(codeReference.ReferencingDeclaration), SeverityType.Warning, "ErrorCode", "Access error message.", arguments);
    }
 private bool filter(ICodeReference reference, Query query, Func<string, string, bool> matcher)
 {
     if (query == null)
         return true;
     if (query.Language != null &&  !matcher(reference.Language, query.Language))
         return false;
     if (query.Type != null && !matcher(reference.Type, query.Type))
         return false;
     if (query.File != null && !matcher(reference.File, query.File))
         return false;
     if (query.Signature != null && !matcher(reference.Signature, query.Signature))
         return false;
     if (query.Name != null && !matcher(reference.Name, query.Name))
         return false;
     if (query.Parent != null && !matcher(reference.Parent, query.Parent))
         return false;
     if (query.Custom != null && !matcher(reference.JSON, query.Custom))
         return false;
     return true;
 }
Example #14
0
 private bool filter(ICodeReference reference, Query query, Func <string, string, bool> matcher)
 {
     if (query == null)
     {
         return(true);
     }
     if (query.Language != null && !matcher(reference.Language, query.Language))
     {
         return(false);
     }
     if (query.Type != null && !matcher(reference.Type, query.Type))
     {
         return(false);
     }
     if (query.File != null && !matcher(reference.File, query.File))
     {
         return(false);
     }
     if (query.Signature != null && !matcher(reference.Signature, query.Signature))
     {
         return(false);
     }
     if (query.Name != null && !matcher(reference.Name, query.Name))
     {
         return(false);
     }
     if (query.Parent != null && !matcher(reference.Parent, query.Parent))
     {
         return(false);
     }
     if (query.Custom != null && !matcher(reference.JSON, query.Custom))
     {
         return(false);
     }
     return(true);
 }
Example #15
0
 public void Add(ICodeReference reference)
 {
     Signatures.Add(reference);
 }
Example #16
0
 private void writeSignature(string type, ICodeReference coderef)
 {
     writeSignature(type, coderef, new string[] {});
 }
Example #17
0
 public void Add(ICodeReference reference)
 {
     lock (_codeReferences)
         _codeReferences.Add(reference);
 }
Example #18
0
 public bool Is(ICodeReference compare)
 {
     return
         Language == compare.Language &&
         Type == compare.Type &&
         File == compare.File &&
         Signature == compare.Signature &&
         Parent == compare.Parent &&
         Name == compare.Name &&
         Scope == compare.Scope &&
         Line == compare.Line &&
         Column == compare.Column &&
         JSON == compare.JSON &&
         TypeSearch == compare.TypeSearch;
 }
Example #19
0
 public void Add(ICodeReference reference)
 {
     Signatures.Add(reference);
 }
Example #20
0
 private void writeSignature(string type, ICodeReference coderef)
 {
     writeSignature(type, coderef, new string[] {});
 }
Example #21
0
 private void add(ICodeReference reference)
 {
     if (_codeReferences.Any(x => x.Is(reference)))
         return;
     _codeReferences.Add(reference);
 }
Example #22
0
 public void Add(ICodeReference reference)
 {
     lock (_codeReferences) {
         add(reference);
     }
 }
 public void Add(ICodeReference reference)
 {
     References.Add(reference);
 }
Example #24
0
 public void Add(ICodeReference reference)
 {
     References.Add(reference);
 }