Ejemplo n.º 1
0
        public ImportSymbolCompletionData(MonoDevelop.Ide.Gui.Document doc, ImportSymbolCache cache, IType type)
        {
            this.doc   = doc;
            this.cache = cache;
//			this.data = doc.Editor;
            this.ambience = AmbienceService.GetAmbience(doc.Editor.MimeType);
            this.type     = type;
            this.unit     = doc.ParsedDocument;
        }
Ejemplo n.º 2
0
        public ImportSymbolCompletionData(MonoDevelop.Ide.Gui.Document doc, ImportSymbolCache cache, IType type)
        {
            this.doc   = doc;
            this.cache = cache;
//			this.data = doc.Editor;
            this.ambience      = AmbienceService.GetAmbience(doc.Editor.MimeType);
            this.type          = type;
            this.unit          = doc.ParsedDocument;
            this.DisplayFlags |= ICSharpCode.NRefactory.Completion.DisplayFlags.IsImportCompletion;
        }
Ejemplo n.º 3
0
 public ImportSymbolCompletionData(MonoDevelop.Ide.Gui.Document doc, ImportSymbolCache cache, ProjectDom dom, IType type)
 {
     this.doc      = doc;
     this.cache    = cache;
     this.dom      = dom;
     this.data     = doc.Editor;
     this.ambience = doc.Project != null ? doc.Project.Ambience : AmbienceService.GetAmbienceForFile(doc.FileName);
     this.type     = type;
     this.unit     = doc.CompilationUnit;
 }
Ejemplo n.º 4
0
        protected override void Run()
        {
            var doc = IdeApp.Workbench.ActiveDocument;

            if (doc == null || doc.FileName == FilePath.Null || doc.CompilationUnit == null)
            {
                return;
            }
            ITextEditorExtension ext = doc.EditorExtension;

            while (ext != null && !(ext is CompletionTextEditorExtension))
            {
                ext = ext.Next;
            }
            if (ext == null)
            {
                return;
            }

            ProjectDom        dom   = doc.Dom;
            ImportSymbolCache cache = new ImportSymbolCache();

            List <ImportSymbolCompletionData> typeList = new List <ImportSymbolCompletionData> ();

            foreach (IType type in dom.Types)
            {
                typeList.Add(new ImportSymbolCompletionData(doc, cache, dom, type));
            }
            foreach (var refDom in dom.References)
            {
                foreach (IType type in refDom.Types)
                {
                    typeList.Add(new ImportSymbolCompletionData(doc, cache, dom, type));
                }
            }

            typeList.Sort(delegate(ImportSymbolCompletionData left, ImportSymbolCompletionData right) {
                return(left.Type.Name.CompareTo(right.Type.Name));
            });


            CompletionDataList completionList = new CompletionDataList();

            completionList.IsSorted = true;
            typeList.ForEach(cd => completionList.Add(cd));

            ((CompletionTextEditorExtension)ext).ShowCompletion(completionList);
        }
Ejemplo n.º 5
0
        protected override void Run()
        {
            var doc = IdeApp.Workbench.ActiveDocument;

            if (doc == null || doc.FileName == FilePath.Null || doc.ParsedDocument == null)
            {
                return;
            }
            ITextEditorExtension ext = doc.EditorExtension;

            while (ext != null && !(ext is CompletionTextEditorExtension))
            {
                ext = ext.Next;
            }
            if (ext == null)
            {
                return;
            }

            var dom = doc.Compilation;
            ImportSymbolCache cache = new ImportSymbolCache();
            var lookup = new MemberLookup(null, doc.Compilation.MainAssembly);

            List <ImportSymbolCompletionData> typeList = new List <ImportSymbolCompletionData> ();

            foreach (var type in dom.GetAllTypeDefinitions())
            {
                if (!lookup.IsAccessible(type, false))
                {
                    continue;
                }
                typeList.Add(new ImportSymbolCompletionData(doc, cache, type));
            }

            typeList.Sort(delegate(ImportSymbolCompletionData left, ImportSymbolCompletionData right) {
                return(left.Type.Name.CompareTo(right.Type.Name));
            });


            CompletionDataList completionList = new CompletionDataList();

            completionList.IsSorted = true;
            typeList.ForEach(cd => completionList.Add(cd));

            ((CompletionTextEditorExtension)ext).ShowCompletion(completionList);
        }
		protected override void Run ()
		{
			var doc = IdeApp.Workbench.ActiveDocument;
			if (doc == null || doc.FileName == FilePath.Null || doc.ParsedDocument == null)
				return;
			ITextEditorExtension ext = doc.EditorExtension;
			while (ext != null && !(ext is CompletionTextEditorExtension))
				ext = ext.Next;
			if (ext == null)
				return;
		
			var dom = doc.Compilation;
			ImportSymbolCache cache = new ImportSymbolCache ();
			
			List<ImportSymbolCompletionData> typeList = new List<ImportSymbolCompletionData> ();
			foreach (var type in dom.GetAllTypeDefinitions ()) {
				typeList.Add (new ImportSymbolCompletionData (doc, cache, type));
			}
			
			typeList.Sort (delegate (ImportSymbolCompletionData left, ImportSymbolCompletionData right) {
				return left.Type.Name.CompareTo (right.Type.Name);
			});
			
			
			CompletionDataList completionList = new CompletionDataList ();
			completionList.IsSorted = true;
			typeList.ForEach (cd => completionList.Add (cd));
			
			((CompletionTextEditorExtension)ext).ShowCompletion (completionList);
		}
		public ImportSymbolCompletionData (MonoDevelop.Ide.Gui.Document doc, ImportSymbolCache cache, IType type)
		{
			this.doc = doc;
			this.cache = cache;
//			this.data = doc.Editor;
			this.ambience = AmbienceService.GetAmbience (doc.Editor.MimeType);
			this.type = type;
			this.unit = doc.ParsedDocument;
		}
Ejemplo n.º 8
0
		public ImportSymbolCompletionData (MonoDevelop.Ide.Gui.Document doc, ImportSymbolCache cache, ProjectDom dom, IType type)
		{
			this.doc = doc;
			this.cache = cache;
			this.dom = dom;
			this.data = doc.Editor;
			this.ambience = doc.Project != null ? doc.Project.Ambience : AmbienceService.GetAmbienceForFile (doc.FileName);
			this.type = type;
			this.unit = doc.CompilationUnit;
		}
Ejemplo n.º 9
0
		public ImportSymbolCompletionData (MonoDevelop.Ide.Gui.Document doc, ImportSymbolCache cache, IType type)
		{
			this.doc = doc;
			this.cache = cache;
//			this.data = doc.Editor;
			this.ambience = AmbienceService.GetAmbience (doc.Editor.MimeType);
			this.type = type;
			this.unit = doc.ParsedDocument;
			this.DisplayFlags |= ICSharpCode.NRefactory.Completion.DisplayFlags.IsImportCompletion;
		}