Hello,
We are developing a WPF desktop application that allows users to create and execute both C# and Python scripts.
For C# scripting, we expose our application's .NET types to the scripting environment and IntelliSense works very well. Users can see our custom classes, methods, properties, and type information directly within the editor.
We are now adding support for Python scripting using the SyntaxEditor Python Language Add-on and would like to provide a similar experience.
Our Python scripts are executed through Python.NET, which allows Python code to access our .NET assemblies and types at runtime. While the scripts execute correctly, IntelliSense in the SyntaxEditor does not recognize our application-specific .NET types.
public class DeviceManager {
public string Name { get; set; }
public void Connect() { }
}
and make it available to Python scripts. We would like users to get IntelliSense for scenarios such as:
from MyApplication import DeviceManager
device = DeviceManager()
device.
where IntelliSense would show:
- Connect()
- Name
- documentation/tooltips
- method signatures
Questions:
- Does the Python Language Add-on support exposing custom .NET types for IntelliSense?
- Is there a recommended approach for integrating Python.NET types with the resolver/introspection system?
- Are there any samples demonstrating how to add custom symbols, modules, or type providers to the Python language service?
- If this is not supported out of the box, what would be the recommended extension point for implementing custom IntelliSense backed by our application's .NET type system?
Our goal is to provide Python users with an IntelliSense experience similar to what they receive when authoring C# scripts in our application.
Any guidance, examples, or best practices would be greatly appreciated.
Thank you!