Cannot find PythonSyntaxLanguage class

SyntaxEditor Python Language Add-on for WPF Forum

Posted 9 years ago by Bob Puckett
Version: 15.1.0622

Hello, I am trying to use the Python add on.  I am working through the docs for how to add it to my project.  I am using verision 15.1.622.

I get to this step:

Create the PythonSyntaxLanguage
The next step is to create an instance of the PythonSyntaxLanguage class and configure its project.

Note Note
Since Python v3.x has breaking syntax changes from v2.x, you can pass a PythonVersion parameter into the language constructor to designate which version should be supported.

This code creates a PythonSyntaxLanguage for editing Python v3.x code:

var language = new PythonSyntaxLanguage(PythonVersion.Version3);


But, I cannot find the PythonSyntaxLanguage class.  I have a reference to the namespace and a number of using statements:

using ActiproSoftware.Text.Languages.Python;
using ActiproSoftware.Text.Languages.Python.Implementation;
using ActiproSoftware.Text.Languages.Python.Reflection;
using ActiproSoftware.Text.Languages.Python.Reflection.Implementation;
using ActiproSoftware.Text.Parsing;
using ActiproSoftware.Text.Parsing.Implementation;

But that class is not found.  If I typing 


I expect Intellisense in Visual Studio to offer me that class.  However, all I get is a list of every other class in hat namespace.  PythonParser is there.  PythonTokenID is there, but no PythonSyntaxLanguage.

So, what am I missing?  Thanks very much.

Here is a bit more code:

// setup the background language syntax parser
AmbientParseRequestDispatcherProvider.Dispatcher = new ThreadedParseRequestDispatcher();

// set up the path to the python libraries for IntelliSense
string ironPythonLibrariesPath = @"C:\Program Files (x86)\IronPython 2.7\Lib";
AmbientPackageRepositoryProvider.Repository = new FileBasedPackageRepository(ironPythonLibrariesPath);

var myPythonSyntaxLanguage = new PythonSyntaxLanguage(PythonVersion.Version2);

There is an error on the last line because the class is not fouin.

Thanks so much.

Comments (2)

Answer - Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Bob,

The Python Language Add-on consists of two assemblies specifically for Python that you must reference, along with several others for SyntaxEditor.  My guess is that you only referenced one of the Python ones and not the other.  Check the last section in the "Getting Started" topic in the documentation for the Python Language Add-on since it lists the assemblies you must reference to get it all working.

Actipro Software Support

Posted 9 years ago by Bob Puckett

You called it.  I was missing one of them.  Thanks so much.

The latest build of this product (v24.1.2) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.