public void Init()
		{
			projectContent = new MockProjectContent();
			ParseInformation parseInfo = new ParseInformation(new DefaultCompilationUnit(projectContent));
			
			PythonImportCompletion completion = new PythonImportCompletion(projectContent);
			completionItems = completion.GetCompletionItems(String.Empty);
		}
		public void Init()
		{
			projectContent = new MockProjectContent();
			List<ICompletionEntry> namespaceItems = new List<ICompletionEntry>();
			namespaceItems.Add(new NamespaceEntry("ICSharpCode.PythonBinding.Test"));
			projectContent.AddExistingNamespaceContents("ICSharpCode", namespaceItems);
			
			PythonImportCompletion completion = new PythonImportCompletion(projectContent);
			completionItems = completion.GetCompletionItems("ICSharpCode");
		}
		public void Init()
		{
			projectContent = new MockProjectContent();
			ParseInformation parseInfo = new ParseInformation(new DefaultCompilationUnit(projectContent));
			List<ICompletionEntry> namespaceItems = new List<ICompletionEntry>();
			namespaceItems.Add(new NamespaceEntry("Test"));
			projectContent.AddExistingNamespaceContents(String.Empty, namespaceItems);
			
			PythonImportCompletion completion = new PythonImportCompletion(projectContent);
			completionItems = completion.GetCompletionItems();
		}
		/// <summary>
		/// Called when Ctrl+Space is entered by the user.
		/// </summary>
		public List<ICompletionEntry> CtrlSpace(int caretLine, int caretColumn, ParseInformation parseInfo, string fileContent, ExpressionContext context)
		{
			resolverContext = new PythonResolverContext(parseInfo);
			if (resolverContext.HasProjectContent) {
				if (context == ExpressionContext.Namespace) {
					PythonImportCompletion importCompletion = new PythonImportCompletion(resolverContext.ProjectContent);
					return importCompletion.GetCompletionItems();
				} else {
					return resolverContext.GetImportedTypes();
				}
			}
			return new List<ICompletionEntry>();
		}
 /// <summary>
 /// Called when Ctrl+Space is entered by the user.
 /// </summary>
 public ArrayList CtrlSpace(int caretLine, int caretColumn, ParseInformation parseInfo, string fileContent, ExpressionContext context)
 {
     resolverContext = new PythonResolverContext(parseInfo);
     if (resolverContext.HasProjectContent)
     {
         if (context == ExpressionContext.Namespace)
         {
             PythonImportCompletion importCompletion = new PythonImportCompletion(resolverContext.ProjectContent);
             return(importCompletion.GetCompletionItems());
         }
         else
         {
             return(resolverContext.GetImportedTypes());
         }
     }
     return(new ArrayList());
 }
        public override List <ICompletionEntry> GetCompletionData(IProjectContent projectContent)
        {
            PythonImportCompletion completion = new PythonImportCompletion(projectContent);

            if (expression.HasFromAndImport)
            {
                if (expression.HasIdentifier)
                {
                    return(new List <ICompletionEntry>());
                }
                else
                {
                    return(completion.GetCompletionItemsFromModule(expression.Module));
                }
            }
            return(completion.GetCompletionItems(expression.Module));
        }
Beispiel #7
0
        List <ICompletionEntry> GetImportCompletionItems(IProjectContent projectContent)
        {
            PythonImportCompletion importCompletion = new PythonImportCompletion(projectContent);

            return(importCompletion.GetCompletionItems());
        }
Beispiel #8
0
		List<ICompletionEntry> GetImportCompletionItems(IProjectContent projectContent)
		{
			PythonImportCompletion importCompletion = new PythonImportCompletion(projectContent);
			return importCompletion.GetCompletionItems();
		}