Code::Blocks  SVN r11506
Classes | Functions
CodeCompletionHelper Namespace Reference

Classes

struct  GotoDeclarationItem
 used to record the position of a token when user click find declaration or implementation More...
 

Functions

bool LessFunctionScope (const CodeCompletion::FunctionScope &fs1, const CodeCompletion::FunctionScope &fs2)
 
bool EqualFunctionScope (const CodeCompletion::FunctionScope &fs1, const CodeCompletion::FunctionScope &fs2)
 
bool LessNameSpace (const NameSpace &ns1, const NameSpace &ns2)
 
bool EqualNameSpace (const NameSpace &ns1, const NameSpace &ns2)
 
wxChar GetLastNonWhitespaceChar (cbStyledTextCtrl *control, int position)
 for OnGotoFunction(), search backward More...
 
xxxxx **begin result *wxChar GetNextNonWhitespaceChar (cbStyledTextCtrl *control, int position)
 for OnGotoFunction(), search forward /* yyy More...
 
int CompareStringLen (const wxString &first, const wxString &second)
 Sorting in GetLocalIncludeDirs() More...
 
bool TestIncludeLine (wxString const &line)
 for CodeCompleteIncludes() a line has some pattern like below More...
 
bool EditorHasNameUnderCursor (wxString &NameUnderCursor, bool &IsInclude)
 return identifier like token string under the current cursor pointer More...
 
static wxString AutocompGetName (const wxString &selected)
 when user select one item in the suggestion list, the selected contains the full display name, for example, "function_name():function_return_type", and we only need to insert the "function_name" to the editor, so this function just get the actual inserted text. More...
 

Class Documentation

◆ CodeCompletionHelper::GotoDeclarationItem

struct CodeCompletionHelper::GotoDeclarationItem

used to record the position of a token when user click find declaration or implementation

Definition at line 262 of file codecompletion.cpp.

Collaboration diagram for CodeCompletionHelper::GotoDeclarationItem:
Class Members
wxString filename
unsigned line

Function Documentation

◆ AutocompGetName()

static wxString CodeCompletionHelper::AutocompGetName ( const wxString selected)
static

when user select one item in the suggestion list, the selected contains the full display name, for example, "function_name():function_return_type", and we only need to insert the "function_name" to the editor, so this function just get the actual inserted text.

Parameters
selecteda full display name of the selected token in the suggestion list
Returns
the stripped text which are used to insert to the editor

Definition at line 274 of file codecompletion.cpp.

References _T, wxString::find_first_of(), and wxString::substr().

Referenced by CodeCompletion::DoAutocomplete().

◆ CompareStringLen()

int CodeCompletionHelper::CompareStringLen ( const wxString first,
const wxString second 
)
inline

Sorting in GetLocalIncludeDirs()

Definition at line 191 of file codecompletion.cpp.

References wxString::Len().

Referenced by CodeCompletion::GetLocalIncludeDirs().

◆ EditorHasNameUnderCursor()

bool CodeCompletionHelper::EditorHasNameUnderCursor ( wxString NameUnderCursor,
bool &  IsInclude 
)
inline

return identifier like token string under the current cursor pointer

Parameters
[out]NameUnderCursorthe identifier like token string
[out]IsIncludetrue if it is a #include command
Returns
true if the underlining text is a #include command, or a normal identifier

Definition at line 226 of file codecompletion.cpp.

References _T, wxString::Clear(), Manager::Get(), wxScintilla::GetCurrentPos(), wxScintilla::GetLine(), wxRegEx::GetMatch(), wxScintilla::GetTextRange(), wxString::IsEmpty(), wxScintilla::LineFromPosition(), wxRegEx::Matches(), wxScintilla::WordEndPosition(), and wxScintilla::WordStartPosition().

Referenced by CodeCompletion::BuildModuleMenu(), CodeCompletion::OnOpenIncludeFile(), and CodeCompletion::OnUpdateUI().

◆ EqualFunctionScope()

bool CodeCompletionHelper::EqualFunctionScope ( const CodeCompletion::FunctionScope fs1,
const CodeCompletion::FunctionScope fs2 
)
inline

◆ EqualNameSpace()

bool CodeCompletionHelper::EqualNameSpace ( const NameSpace ns1,
const NameSpace ns2 
)
inline

Definition at line 131 of file codecompletion.cpp.

References NameSpace::Name.

◆ GetLastNonWhitespaceChar()

wxChar CodeCompletionHelper::GetLastNonWhitespaceChar ( cbStyledTextCtrl control,
int  position 
)
inline

for OnGotoFunction(), search backward

xxxxx /* yyy */
^ ^
result begin

Definition at line 142 of file codecompletion.cpp.

References _T, wxScintilla::GetCharAt(), wxScintilla::GetStyleAt(), and cbStyledTextCtrl::IsComment().

Referenced by cbSmartIndentPlugin::OnCCDone(), and CodeCompletion::OnGotoDeclaration().

◆ GetNextNonWhitespaceChar()

xxxxx* * begin result* wxChar CodeCompletionHelper::GetNextNonWhitespaceChar ( cbStyledTextCtrl control,
int  position 
)
inline

for OnGotoFunction(), search forward /* yyy

Definition at line 167 of file codecompletion.cpp.

References _T, wxScintilla::GetCharAt(), wxScintilla::GetLength(), wxScintilla::GetStyleAt(), and cbStyledTextCtrl::IsComment().

Referenced by CodeCompletion::OnGotoDeclaration().

◆ LessFunctionScope()

bool CodeCompletionHelper::LessFunctionScope ( const CodeCompletion::FunctionScope fs1,
const CodeCompletion::FunctionScope fs2 
)
inline

◆ LessNameSpace()

bool CodeCompletionHelper::LessNameSpace ( const NameSpace ns1,
const NameSpace ns2 
)
inline

Definition at line 126 of file codecompletion.cpp.

References NameSpace::Name.

Referenced by CodeCompletion::ParseFunctionsAndFillToolbar().

◆ TestIncludeLine()

bool CodeCompletionHelper::TestIncludeLine ( wxString const &  line)
inline

for CodeCompleteIncludes() a line has some pattern like below

# [space or tab] include

Definition at line 202 of file codecompletion.cpp.

References _T, wxString::find(), wxString::length(), wxString::Mid(), and wxString::npos.

Referenced by CodeCompletion::DoCodeCompleteIncludes().