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:
CopyC#
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
ActiproSoftware.Text.Languages.Python.Implementation.
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.