Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_AutocompletePlugin Interface Reference

This plugin allows for autocompletion for common structure / code excerpts and boilerplate code. More...

Inheritance diagram for SCR_AutocompletePlugin:

Public Member Functions

override void Run ()
 

Protected Member Functions

void AutoCompleteCurrentLine ()
 
bool AddCastCheck (notnull ScriptEditor scriptEditor, string indentation, string currentLine)
 
bool AddResourceLoadValidityCheck (notnull ScriptEditor scriptEditor, string indentation, string currentLine)
 
bool AddPrintLogLevel (notnull ScriptEditor scriptEditor, string indentation, string currentLine, string comment)
 
bool AddAttributeDecorator (notnull ScriptEditor scriptEditor, string indentation, string currentLine)
 
string AddIndentation (string input, string indentation)
 Add indentation to the provided text, keeping empty lines empty.
 
bool AddConstructorDestructor (notnull ScriptEditor scriptEditor, bool isConstructor, string indentation, string comment)
 
void CheckToolKeywords ()
 
void FillKeywordsMap ()
 
void CheckToolAttributeDecorators ()
 
void FillAttributeDecoratorMap ()
 
override void Configure ()
 
int ButtonOK ()
 

Protected Attributes

bool m_bAddConstructor
 
bool m_bAddDestructor
 
bool m_bAddCastNullcheck
 
bool m_bAddOrFixResourceLoadValidityCheck
 
LogLevel m_eAddPrintLogLevel
 
bool m_bKeepCommentIndentation = true
 
bool m_bUseToolKeywords
 
ref array< ref SCR_AutocompletePlugin_KeywordDatam_aToolKeywords
 
bool m_bUseUserKeywords
 
ref array< ref SCR_AutocompletePlugin_KeywordDatam_aUserKeywords
 
bool m_bUseToolAttributeDecorators
 
ref array< ref SCR_AutocompletePlugin_AttributeDatam_aToolAttributeDecorators
 
bool m_bUseUserAttributeDecorators
 
ref array< ref SCR_AutocompletePlugin_AttributeDatam_aUserAttributeDecorators
 
ref map< string, SCR_AutocompletePlugin_KeywordDatam_mKeywords = new map<string, SCR_AutocompletePlugin_KeywordData>()
 
ref map< string, SCR_AutocompletePlugin_AttributeDatam_mAttributeDecorators = new map<string, SCR_AutocompletePlugin_AttributeData>()
 

Static Protected Attributes

static const string SEP_NL = SCR_StringHelper.DOUBLE_SLASH + "------------------------------------------------------------------------------------------------\n"
 
static const string CONSTRUCTOR_KEYWORD = "ctor"
 
static const string DESTRUCTOR_KEYWORD = "dtor"
 

Detailed Description

This plugin allows for autocompletion for common structure / code excerpts and boilerplate code.

Features: if → adds an if structure ife → adds an if-else structure for → adds a for loop forr → adds a for loop, reversed (i–) foreach → adds a foreach loop foreachi → adds a foreach loop with i index switch → adds a switch case with one case and default while → adds a while loop class → adds a class with its constructor structure method/func → adds a method with separator and Doxygen doc skeleton

ctor → adds a constructor dtor → adds a destructor findcomp → adds SCR_ComponentClass component = SCR_ComponentClass.Cast(entity.FindComponent(SCR_ComponentClass)); print → adds a Print with normal LogLevel

nullcheck on cast (e.g "Class a = Class.Cast(b)") → adds an "if (!a) return;" check below if not present validity check on Resource.Load → adds an "if (!resource.IsValid())" check below (or fixes, in case of "if (!resource)") if not present potential attribute (e.g "ResourceName m_sResourceName;") → adds an [Attribute()] if not present adds missing or incorrect LogLevel to Print/PrintFormat

Member Function Documentation

◆ AddAttributeDecorator()

bool SCR_AutocompletePlugin.AddAttributeDecorator ( notnull ScriptEditor scriptEditor,
string indentation,
string currentLine )
protected
Parameters
[in]scriptEditor
[in]indentation
[in]currentLine

◆ AddCastCheck()

bool SCR_AutocompletePlugin.AddCastCheck ( notnull ScriptEditor scriptEditor,
string indentation,
string currentLine )
protected
Parameters
[in]scriptEditor
[in]indentation
[in]currentLine

◆ AddConstructorDestructor()

bool SCR_AutocompletePlugin.AddConstructorDestructor ( notnull ScriptEditor scriptEditor,
bool isConstructor,
string indentation,
string comment )
protected
Parameters
[in]scriptEditor
[in]isConstructortrue for constructor, false for destructor
[in]indentation
[in]comment

◆ AddIndentation()

string SCR_AutocompletePlugin.AddIndentation ( string input,
string indentation )
protected

Add indentation to the provided text, keeping empty lines empty.

Parameters
[in]input
[in]indentation
Returns
the indented text

◆ AddPrintLogLevel()

bool SCR_AutocompletePlugin.AddPrintLogLevel ( notnull ScriptEditor scriptEditor,
string indentation,
string currentLine,
string comment )
protected
Parameters
[in]scriptEditor
[in]indentation
[in]currentLine
[in]comment

◆ AddResourceLoadValidityCheck()

bool SCR_AutocompletePlugin.AddResourceLoadValidityCheck ( notnull ScriptEditor scriptEditor,
string indentation,
string currentLine )
protected
Parameters
[in]scriptEditor
[in]indentation
[in]currentLine

◆ AutoCompleteCurrentLine()

void SCR_AutocompletePlugin.AutoCompleteCurrentLine ( )
protected

◆ ButtonOK()

int SCR_AutocompletePlugin.ButtonOK ( )
protected

◆ CheckToolAttributeDecorators()

void SCR_AutocompletePlugin.CheckToolAttributeDecorators ( )
protected

◆ CheckToolKeywords()

void SCR_AutocompletePlugin.CheckToolKeywords ( )
protected

◆ Configure()

override void SCR_AutocompletePlugin.Configure ( )
protected

◆ FillAttributeDecoratorMap()

void SCR_AutocompletePlugin.FillAttributeDecoratorMap ( )
protected

◆ FillKeywordsMap()

void SCR_AutocompletePlugin.FillKeywordsMap ( )
protected

◆ Run()

override void SCR_AutocompletePlugin.Run ( )

Member Data Documentation

◆ CONSTRUCTOR_KEYWORD

const string SCR_AutocompletePlugin.CONSTRUCTOR_KEYWORD = "ctor"
staticprotected

◆ DESTRUCTOR_KEYWORD

const string SCR_AutocompletePlugin.DESTRUCTOR_KEYWORD = "dtor"
staticprotected

◆ m_aToolAttributeDecorators

ref array<ref SCR_AutocompletePlugin_AttributeData> SCR_AutocompletePlugin.m_aToolAttributeDecorators
protected

◆ m_aToolKeywords

ref array<ref SCR_AutocompletePlugin_KeywordData> SCR_AutocompletePlugin.m_aToolKeywords
protected

◆ m_aUserAttributeDecorators

ref array<ref SCR_AutocompletePlugin_AttributeData> SCR_AutocompletePlugin.m_aUserAttributeDecorators
protected

◆ m_aUserKeywords

ref array<ref SCR_AutocompletePlugin_KeywordData> SCR_AutocompletePlugin.m_aUserKeywords
protected

◆ m_bAddCastNullcheck

bool SCR_AutocompletePlugin.m_bAddCastNullcheck
protected

◆ m_bAddConstructor

bool SCR_AutocompletePlugin.m_bAddConstructor
protected

◆ m_bAddDestructor

bool SCR_AutocompletePlugin.m_bAddDestructor
protected

◆ m_bAddOrFixResourceLoadValidityCheck

bool SCR_AutocompletePlugin.m_bAddOrFixResourceLoadValidityCheck
protected

◆ m_bKeepCommentIndentation

bool SCR_AutocompletePlugin.m_bKeepCommentIndentation = true
protected

◆ m_bUseToolAttributeDecorators

bool SCR_AutocompletePlugin.m_bUseToolAttributeDecorators
protected

◆ m_bUseToolKeywords

bool SCR_AutocompletePlugin.m_bUseToolKeywords
protected

◆ m_bUseUserAttributeDecorators

bool SCR_AutocompletePlugin.m_bUseUserAttributeDecorators
protected

◆ m_bUseUserKeywords

bool SCR_AutocompletePlugin.m_bUseUserKeywords
protected

◆ m_eAddPrintLogLevel

LogLevel SCR_AutocompletePlugin.m_eAddPrintLogLevel
protected

◆ m_mAttributeDecorators

ref map<string, SCR_AutocompletePlugin_AttributeData> SCR_AutocompletePlugin.m_mAttributeDecorators = new map<string, SCR_AutocompletePlugin_AttributeData>()
protected

◆ m_mKeywords

ref map<string, SCR_AutocompletePlugin_KeywordData> SCR_AutocompletePlugin.m_mKeywords = new map<string, SCR_AutocompletePlugin_KeywordData>()
protected

◆ SEP_NL

const string SCR_AutocompletePlugin.SEP_NL = SCR_StringHelper.DOUBLE_SLASH + "------------------------------------------------------------------------------------------------\n"
staticprotected

The documentation for this interface was generated from the following file: