DynamoVisualProgramming.DynamoServices by Autodesk

<PackageReference Include="DynamoVisualProgramming.DynamoServices" Version="3.4.0-beta6196" />

 PythonCodeCompletionProviderCommon

This class represents a base class for Python code completion providers It partially implements the IExternalCodeCompletionProviderCore interface and contains a collection of utility functions/properties that are common among existing code completion provider classes
protected enum PythonScriptType

Maps a basic variable regex to a basic python type.

protected Dictionary<string, int> BadStatements { get; protected set; }

Keeps track of failed statements to avoid poluting the log

protected HashSet<string> ClrModules { get; protected set; }

Tracks already referenced CLR modules

public Dictionary<string, Type> ImportedTypes { get; set; }

public Dictionary<string, Type> VariableTypes { get; set; }

protected static List<Tuple<string, string, string>> FindAllImportStatements(string code)

Attempts to find all import statements in the code

protected static List<string> FindClrReferences(string code)

Detect all library references given the provided code

protected static string GetFirstPossibleTypeName(string line)

Returns the first possible type name from the type's declaration line.

protected static string GetLastName(string text)

Returns the last name from the input line. The regex ignores tabs, spaces, the first new line, etc.

protected static string GetLastNameSpace(string text)

Returns the entire namespace from the end of the input line. The regex ignores tabs, spaces, the first new line, etc.

protected static string StripDocStrings(string code)

Removes any docstring characters from the source code

protected static Type TryGetTypeFromFullName(string name)

Check if a full type name is found in one of the known pre-loaded assemblies and return the type

protected IEnumerable<Tuple<string, string, bool, ExternalCodeCompletionType>> EnumerateMembers(Type type, string name)

List all of the members in a CLR type

protected abstract object EvaluateScript(string script, PythonScriptType type)

protected Dictionary<string, Type> FindAllVariableAssignments(string code)

Attempts to find all variable assignments in the code. Has basic variable unpacking support. We don't need to check the line indices because regex matches are ordered as per the code.

protected abstract Type GetCLRType(string name)

public abstract IExternalCodeCompletionData[] GetCompletionData(string code, bool expand = false)

public string GetDescription(string stub, string item, bool isInstance)

Try to generate a description from a typename.

protected abstract object GetDescriptionObject(string docCommand)

public abstract void Initialize(string dynamoCorePath)

public abstract bool IsSupportedEngine(string engineName)

protected abstract void LogError(string msg)

protected Type TryGetType(string name)

Retrieves the clr Type corresponding to the input paramater name