コード例 #1
0
        public static HybridCollection <IPsiSourceFile> GetSourceFiles(IUriIdentifierDeclaredElement declaredElement)
        {
            var cache = declaredElement.GetSolution().GetComponent <NTriplesCache>();

            return(new HybridCollection <IPsiSourceFile>(
                       cache.GetFilesContainingUri(declaredElement.GetNamespace(), declaredElement.GetLocalName())));
        }
コード例 #2
0
        /*public bool ChangeName { get; set; }
         *
         * public string NewName
         * {
         *  get { return this.myNewName; }
         *  set
         *  {
         *      this.ChangeName = true;
         *      this.myNewName = value;
         *  }
         * }*/

        public static IList <IDeclaration> GetDeclarations(IUriIdentifierDeclaredElement declaredElement)
        {
            var result = new List <IDeclaration>();

            foreach (var sourceFile in GetSourceFiles(declaredElement))
            {
                result.AddRange(GetDeclarationsIn(sourceFile, declaredElement));
            }

            return(result);
        }
コード例 #3
0
 public UriIdentifierDeclaredElement(
     IFile file,
     string @namespace,
     string localName,
     IdentifierInfo info,
     IPsiServices services,
     bool filterDeclarations = false,
     IUriIdentifierDeclaredElement parent = null)
 {
     this.myFile             = file;
     this.ns                 = @namespace;
     this.localName          = localName;
     this.myName             = localName;
     this.myNewName          = localName;
     this.myServices         = services;
     this.filterDeclarations = filterDeclarations;
     this.parent             = parent;
     this.info               = info;
 }
コード例 #4
0
 public UriIdentifierDeclaredElement(
     IFile file,
     string @namespace,
     string localName,
     IdentifierInfo info,
     IPsiServices services,
     bool filterDeclarations = false,
     IUriIdentifierDeclaredElement parent = null)
 {
     this.myFile = file;
     this.ns = @namespace;
     this.localName = localName;
     this.myName = localName;
     this.myNewName = localName;
     this.myServices = services;
     this.filterDeclarations = filterDeclarations;
     this.parent = parent;
     this.info = info;
 }
コード例 #5
0
        public static IList <IDeclaration> GetDeclarationsIn(
            IPsiSourceFile sourceFile, IUriIdentifierDeclaredElement declaredElement)
        {
            var psiFile = sourceFile.GetPsiFile <NTriplesLanguage>(new DocumentRange(sourceFile.Document, 0)) as NTriplesFile;

            if (psiFile == null)
            {
                return(EmptyList <IDeclaration> .InstanceList);
            }

            var uri = declaredElement.GetUri();

            if (string.IsNullOrEmpty(uri))
            {
                return(EmptyList <IDeclaration> .InstanceList);
            }

            var uriIdentifiers = psiFile.GetUriIdentifiers(uri);

            return(uriIdentifiers);
        }
コード例 #6
0
 public static HybridCollection<IPsiSourceFile> GetSourceFiles(IUriIdentifierDeclaredElement declaredElement)
 {
     var cache = declaredElement.GetSolution().GetComponent<NTriplesCache>();
     return new HybridCollection<IPsiSourceFile>(
         cache.GetFilesContainingUri(declaredElement.GetNamespace(), declaredElement.GetLocalName()));
 }
コード例 #7
0
        public static IList<IDeclaration> GetDeclarationsIn(
            IPsiSourceFile sourceFile, IUriIdentifierDeclaredElement declaredElement)
        {
            var psiFile = sourceFile.GetPsiFile<NTriplesLanguage>(new DocumentRange(sourceFile.Document, 0)) as NTriplesFile;
            if (psiFile == null)
            {
                return EmptyList<IDeclaration>.InstanceList;
            }

            var uri = declaredElement.GetUri();
            if (string.IsNullOrEmpty(uri))
            {
                return EmptyList<IDeclaration>.InstanceList;
            }

            var uriIdentifiers = psiFile.GetUriIdentifiers(uri);
            return uriIdentifiers;
        }
コード例 #8
0
        /*public bool ChangeName { get; set; }

        public string NewName
        {
            get { return this.myNewName; }
            set
            {
                this.ChangeName = true;
                this.myNewName = value;
            }
        }*/

        public static IList<IDeclaration> GetDeclarations(IUriIdentifierDeclaredElement declaredElement)
        {
            var result = new List<IDeclaration>();
            foreach (var sourceFile in GetSourceFiles(declaredElement))
            {
                result.AddRange(GetDeclarationsIn(sourceFile, declaredElement));
            }

            return result;
        }
コード例 #9
0
 public static bool IsImportantSubject(IUriIdentifierDeclaredElement uriIdentifier)
 {
     return uriIdentifier.GetInfo().IsClassDeclaration;
 }
コード例 #10
0
 public static bool IsImportantSubject(IUriIdentifierDeclaredElement uriIdentifier)
 {
     return(uriIdentifier.GetInfo().IsClassDeclaration);
 }