Hi Team,
I need to integrate IntelliPrompt for IronPython. As you certanly know IronPython is the .NET integration of Python. Problem I'm facing is that IntelliPrompt can't reach .NET types when "resolve" and I don't know how to provide info it needs.
My attempt is to add my custom IModuleDefinition to ActiveModules collection of project:
var language = new PythonSyntaxLanguage(PythonVersion.Version2);
var prj = language.GetService<IProject>();
prj.Resolver.UnknownReturnTypeReferenceCallback = MyUnknownReturnTypeReferenceCallback;
prj.ActiveModules.Add(new Scripting.AssemblyModuleDefinition(Assembly.GetExecutingAssembly()));
where AssemblyModuleDefinition class is defined like this:
public class AssemblyModuleDefinition : IModuleDefinition
{
public Assembly Assembly { get; private set; }
public AssemblyModuleDefinition(Assembly assembly)
{
if (assembly == null)
throw new ArgumentNullException("assembly");
Assembly = assembly;
}
///......omitted
public IFunctionDefinitionCollection Functions
{
get { return null; }
}
public IImportDefinitionCollection Imports
{
get { return null; }
}
public System.Collections.Generic.IEnumerable<string> PublicNames
{
get { return new string[] { }; }
}
public ITypeDefinitionCollection Types
{
get { return new AssemblyTypeDefinitionCollection(Assembly.GetTypes().Select(_ => new AssemblyTypeDefinition(_))); }
}
public IVariableDefinitionCollection Variables
{
get { return null; }
}
public string Key
{
get { return Assembly.FullName; }
}
public bool IsBuiltin
{
get { return false; }
}
///.....omitted...
}
In other words I'm trying the feed the resolver with types that come from .NET assemblies instead of normal .py files.
When I run this code I see that SyntaxEditor calls the Key property of the custom module defintion several times but nothing more.
Can you suggest a correct way to proceed? Is there any other approach to address my task?
Please let me know if you need further info,
Thanks