Class CodeActionsCompiller
OptimaJet.Workflow.Core.CodeActions.CodeActionsCompiller
Compiles scheme and global CodeActionDefinition objects into CodeActionsInvoker instances.
Namespace: OptimaJet.Workflow.Core.CodeActions
public static class CodeActionsCompillerProperties
public static IExternalCompiler ExternalCompiler { get; set; } #Gets or sets the external compiler used for code-action compilation.
Remarks
When this property is set, compilation methods delegate to IExternalCompiler instead of the built-in Roslyn pipeline.
public static bool CompillationEnable { get; set; } #Gets or sets whether dynamic code-action compilation is enabled.
public static bool DebugMode { get; set; } #Gets or sets whether debug code-action compilation is requested.
Remarks
With the built-in compiler, true enables debug optimization, expands
/*break*/ markers, and writes generated .cs, .dll, and .pdb files to the system temporary directory. An IExternalCompiler receives the value as its debug-compilation request. The default is false.public static IEnumerable<string> Usings { get; } #Gets namespace names registered for code-action compilation.
public static IEnumerable<string> Locations { get; } #Gets assembly file locations supplied as metadata references during compilation.
Methods
public static void RegisterAssembly(string longName) #Loads an assembly by name and adds its file location and namespace names to the compiler registries.
Parameters
Name
Type
Description
public static void RegisterAssembly(Assembly assembly) #Adds an assembly file location and its namespace names to the compiler registries.
Parameters
Name
Type
Description
public static CodeActionsInvoker CompileCodeActions(ProcessDefinition processDefinition, Guid schemeId) #Compiles code actions from a ProcessDefinition and returns a CodeActionsInvoker.
Parameters
Name
Type
Description
processDefinitionProcessDefinitionThe ProcessDefinition whose CodeActionDefinition list is compiled.
Returns
Type
Description
CodeActionsInvokerAn invoker containing the compiled code actions, or an empty invoker when no code actions are defined or CodeActionsCompiller.CompillationEnable is false.
Exceptions
Type
Description
InvalidOperationExceptionThrown by the built-in compiler when one or more code actions cannot be compiled.
public static CodeActionsInvoker CompileGlobalCodeActions(List<CodeActionDefinition> codeActionDefinitions, bool ignoreNotCompilled, out Dictionary<string, string> compileErrors) #Compiles global code actions and returns a CodeActionsInvoker.
Parameters
Name
Type
Description
codeActionDefinitionsList<CodeActionDefinition>The global CodeActionDefinition instances to compile.
ignoreNotCompilledBooleancompileErrorsDictionary<String, String>When this method returns, contains diagnostics for omitted code actions keyed by code-action type and name; empty when no errors were ignored.
Returns
Type
Description
CodeActionsInvokerAn invoker for the successfully compiled global code actions, or an empty invoker when the input is empty or CodeActionsCompiller.CompillationEnable is false.
Exceptions
Type
Description
InvalidOperationExceptionThrown by the built-in compiler when
ignoreNotCompilled is false, an error cannot be attributed to one code action, or compilation still fails after invalid actions are omitted.public static CodeActionsInvoker CompileCodeActions(string commonUsings, List<CodeActionDefinition> codeActionDefinitions, string namespaceName) #Compiles code actions with explicit common namespace imports and a generated namespace postfix.
Parameters
Name
Type
Description
commonUsingsStringSemicolon-separated namespace imports shared by the code actions.
namespaceNameStringThe postfix used to create the generated namespace.
Returns
Type
Description
CodeActionsInvokerAn invoker containing the compiled code actions, or an empty invoker when no actions are supplied or CodeActionsCompiller.CompillationEnable is false.
Exceptions
Type
Description
InvalidOperationExceptionThrown by the built-in compiler when one or more code actions cannot be compiled.
Fields
public static List<string> DefaultUsings #The base namespace imports considered when generated code-action source is created.
Remarks
A code-action definition can add imports through CodeActionDefinition.Usings or remove imports through CodeActionDefinition.ExcludedUsings.