Esempio n. 1
0
        public List <Hierarchies> GetAllHierarchies(string projectName)
        {
            var project = FindProject(projectName);

            var hierarchyInfo = GlobalCache.Caches.Hierachies.GetCache().Concat(project.Caches.Hierachies.GetCache()).ToList();

            return(CompletionCaches.ToCompletionFormat(hierarchyInfo));
        }
Esempio n. 2
0
        private void LoadCache(string vscodeDir)
        {
            Caches = new CompletionCaches
            {
                Types      = new Cache <TypeCompletionInfo>(GetCacheLocation("types", vscodeDir)),
                Extensions = new Cache <ExtensionMethodInfo>(GetCacheLocation("extensions", vscodeDir)),
                Hierachies = new Cache <HierarchyInfo>(GetCacheLocation("hierarchies", vscodeDir))
            };

            UpdateCache();
        }
Esempio n. 3
0
        public List <ExtensionClass> GetAllExtensionMethods(string projectName, string wordToComplete)
        {
            var project = FindProject(projectName);

            var extensionInfo        = GlobalCache.Caches.Extensions.GetCache().Concat(project.Caches.Extensions.GetCache()).ToList();
            var refinedExtensionData = CompletionCaches.ToCompletionFormat(extensionInfo);

            refinedExtensionData = refinedExtensionData
                                   .Select(extendedClass => new ExtensionClass(extendedClass.ExtendedClass,
                                                                               FilterUnnecessaryData(extendedClass.ExtensionMethods, wordToComplete, (extensionMethod) => extensionMethod.Name))
                                           )
                                   .Where(extendedClass => extendedClass.ExtensionMethods.Count > 0).ToList();

            return(refinedExtensionData);
        }
Esempio n. 4
0
        /// <summary>
        /// Returns the list of types in the .NET base class library + the types in the libraries of the
        /// requested projected + the types in the requested project, as long as they contain the
        /// "WordToComplete" field in the request
        /// </summary>
        public List <TypeCompletion> GetAllTypes(string projectName, string wordToComplete)
        {
            var project = FindProject(projectName);

            var typeInfo = GlobalCache.Caches.Types.GetCache().Concat(project.Caches.Types.GetCache()).ToList();

            //TODO: remove
            typeInfo.Sort((e1, e2) => e1.Name.CompareTo(e2.Name));
            var filtered = typeInfo.Where(t => t.Name.Contains("Fi"));

            var refinedTypeData = FilterUnnecessaryData(CompletionCaches.ToCompletionFormat(typeInfo),
                                                        wordToComplete, (type) => type.Name);

            return(refinedTypeData);
        }