6 #ifndef CODECOMPLETION_H 7 #define CODECOMPLETION_H 107 virtual std::vector<CCCallTip>
GetCallTips(
int pos,
int style,
cbEditor* ed,
int& argsPos);
241 void DoCodeComplete(
int caretPos,
cbEditor* ed, std::vector<CCToken>& tokens,
bool preprocessorOnly =
false);
511 DECLARE_EVENT_TABLE()
514 #endif // CODECOMPLETION_H virtual cbConfigurationPanel * GetConfigurationPanel(wxWindow *parent)
CC's config dialog.
int m_CurrentLine
current caret line, this is actually the saved caret line
bool m_NeedsBatchColour
batch run UpdateEditorSyntax() after first parsing
void OnEditorActivated(CodeBlocksEvent &event)
int EndLine
function body (implementation) end line
bool m_InitDone
Indicates CC's initialization is done.
wxArrayString GetLocalIncludeDirs(cbProject *project, const wxArrayString &buildTargets)
Get the include paths setting (usually set by user for each C::B project).
bool m_CCDetectImplementation
add function arguments' types and names when autocompleted outside function.
Base class for code-completion plugins.
void OnFunction(wxCommandEvent &event)
Toolbar select event.
void OnReparsingTimer(wxTimerEvent &event)
delayed for re-parsing
virtual void OnAttach()
Any descendent plugin should override this virtual method and perform any necessary initialization...
virtual cbConfigurationPanel * GetProjectConfigurationPanel(wxWindow *parent, cbProject *project)
CC's config dialog which show in the project options panel.
std::map< wxString, FunctionsScopePerFile > FunctionsScopeMap
filename -> FunctionsScopePerFile map, contains all the opened files scope info
CCProviderStatus
Level of functionality a CC plugin is able to provide.
std::vector< FunctionScope > FunctionsScopeVec
vector containing all the function information of a single source file
void GetAbsolutePath(const wxString &basePath, const wxArrayString &targets, wxArrayString &dirs)
search target file names (mostly relative names) under basePath, then return the absolute dirs the re...
void OnOpenIncludeFile(wxCommandEvent &event)
open the include file under the caret position
virtual void DoAutocomplete(const CCToken &token, cbEditor *ed)
Callback for inserting the selected autocomplete entry into the editor.
wxArrayString & GetSystemIncludeDirs(cbProject *project, bool force)
get the whole search dirs except the ones locally belong to the c::b project, note this function is u...
int StartLine
function body (implementation) start line
wxString m_CCFillupChars
user defined characters that work like Tab (empty by Default).
std::vector< int > ScopeMarksVec
helper class to support FunctionsScopeVec
void EditorEventHook(cbEditor *editor, wxScintillaEvent &event)
handle all the editor event
void DoCodeComplete(int caretPos, cbEditor *ed, std::vector< CCToken > &tokens, bool preprocessorOnly=false)
fill the tokens with correct code complete words
cbEditor * m_LastEditor
the last valid editor it is saved in editor activated event handler, and will be verified in editor a...
void OnEditorActivatedTimer(wxTimerEvent &event)
delayed running of editor activated event, only the last activated editor should be considered ...
CodeCompletion()
Constructor.
void OnProjectSavedTimer(wxTimerEvent &event)
delayed running after saving project, while many projects' saving
wxTimer m_TimerRealtimeParsing
timer triggered by editor hook function to delay the real-time parse
wxString m_LastFile
the file updating the toolbar info
int NameSpacePosition() const
find the namespace whose scope covers the current line the m_CurrentLine is used
FunctionsScopeMap m_AllFunctionsScopes
this is a "filename->info" map containing all the opening files choice info
void UpdateFunctions(unsigned int scopeItem)
the scope item has changed or becomes invalid, so the associated function wxChoice should be updated...
Identify a function body's position, the underline data structure of the second wxChoice of CC's tool...
void OnCurrentProjectReparse(wxCommandEvent &event)
event handler when user select context menu->reparse file/projects
static const int cgEditor
Editor related.
wxString Name
function's long name (including arguments and return type)
virtual ~CodeCompletion()
Destructor.
virtual std::vector< CCCallTip > GetCallTips(int pos, int style, cbEditor *ed, int &argsPos)
Supply content for the calltip at the specified location.
void OnAppDoneStartup(CodeBlocksEvent &event)
SDK event when application has started up.
A generic Code::Blocks event.
void OnRenameSymbols(wxCommandEvent &event)
CC's re-factoring function, rename a symbol.
Code completion plugin has those features: show tool-tip when the mouse hover over the variables/func...
wxString OnDocumentationLink(wxHtmlLinkEvent &event, bool &dismissPopup)
void OnProjectClosed(CodeBlocksEvent &event)
bool m_LexerKeywordsToInclude[9]
indicate whether the predefined keywords set should be added in the suggestion list ...
void OnEditorSave(CodeBlocksEvent &event)
SDK editor related events.
CodeRefactoring m_CodeRefactoring
code re-factoring tool
std::vector< NameSpace > NameSpaceVec
wxTimer m_TimerReparsing
delay after receive a project save/modified event
Represents a Code::Blocks project.
virtual CCProviderStatus GetProviderStatusFor(cbEditor *ed)
Does this plugin handle code completion for the editor ed?
wxTimer m_TimerProjectSaved
delay after project saved event
virtual std::vector< CCToken > GetTokenAt(int pos, cbEditor *ed, bool &allowCallTip)
Supply the definition of the token at the specified location.
ModuleType
The type of module offering a context menu.
void OnViewClassBrowser(wxCommandEvent &event)
event handler when user click Menu->View->Symbols browser
void DoCodeCompleteIncludes(cbEditor *ed, int &tknStart, int tknEnd, std::vector< CCToken > &tokens)
fill the tokens with correct include file names
int DoAllMethodsImpl()
ContextMenu->Insert-> All class methods.
int m_CurrentLength
remember the number of bytes in the current editor/document this is actually the saved editor or file...
NameSpaceVec m_NameSpaces
wxString ShortName
function's base name (without scope prefix)
wxString Scope
class or namespace
FunctionsScopeVec m_FunctionsScope
virtual void OnRelease(bool appShutDown)
void OnGotoPrevFunction(wxCommandEvent &event)
navigate to the previous function body
void OnProjectSaved(CodeBlocksEvent &event)
Structure representing a generic token, passed between CC plugins and CCManager.
void OnGotoDeclaration(wxCommandEvent &event)
handle both goto declaration and implementation event
bool m_CCAutoAddParentheses
whether add parentheses after user selects a function name in the code-completion suggestion list ...
virtual wxString OnDocumentationLink(wxHtmlLinkEvent &event, bool &dismissPopup)
Callback to handle a click on a link in the documentation popup.
void OnProjectFileChanged(CodeBlocksEvent &event)
void OnUnimplementedClassMethods(wxCommandEvent &event)
handle CC's context menu->insert "All class methods without implementation..."
virtual int GetConfigurationGroup() const
Return the configuration group for this plugin.
void OnFindReferences(wxCommandEvent &event)
CC's re-factoring function, find all the reference place.
void OnUpdateUI(wxUpdateUIEvent &event)
event handler for updating UI e.g.
FunctionScope(const NameSpace &ns)
a namespace token can be convert to a FunctionScope type
void OnProjectFileAdded(CodeBlocksEvent &event)
Base class for plugin configuration panels.
void OnSelectedFileReparse(wxCommandEvent &event)
void GotoFunctionPrevNext(bool next=false)
navigate between function bodies
void OnWorkspaceChanged(CodeBlocksEvent &event)
SDK workspace related events.
void OnRealtimeParsingTimer(wxTimerEvent &event)
event fired from the edit event hook function to indicate parsing while editing
NativeParser class is just like a manager class to control Parser objects.
int DoClassMethodDeclImpl()
ContextMenu->Insert-> declaration/implementation.
wxChoice * m_Function
function choice control of CC's toolbar, it is the second choice
void UpdateEditorSyntax(cbEditor *ed=NULL)
highlight member variables
void OnProjectActivated(CodeBlocksEvent &event)
SDK project related events.
FunctionsScopeVec m_FunctionsScope
current active file's function body info
wxTimer m_TimerEditorActivated
delay after receive editor activated event the reason we need a timer is that we want to get a stable...
ScopeMarksVec m_ScopeMarks
current active file's line info, helper member to access function scopes
void OnEditorClosed(CodeBlocksEvent &event)
DocumentationHelper m_DocHelper
Provider of documentation for the popup window.
void OnProjectFileRemoved(CodeBlocksEvent &event)
wxChoice * m_Scope
namespace/scope choice control, it is the first choice control
void OnCCDebugLogger(CodeBlocksThreadEvent &event)
CC's own debug logger, to handle log event sent from other worker threads or itself(the main GUI thre...
void OnGotoFunction(wxCommandEvent &event)
event handler when user click Menu->Search->Goto function
void FindFunctionAndUpdate(int currentLine)
the caret has changed, so the wxChoice need to be updated to indicates which scope and function in wh...
ReparsingMap m_ReparsingMap
all the files need to be parsed and their associated projects
void OnGotoNextFunction(wxCommandEvent &event)
navigate to the next function body
void OnCCLogger(CodeBlocksThreadEvent &event)
CC's own logger, to handle log events sent from other worker threads or itself(the main GUI thread)...
void OnSelectedProjectReparse(wxCommandEvent &event)
void OnParserStart(wxCommandEvent &event)
batch parsing start event this event usually be fired when an Parser object try to start parsing task...
void DoParseOpenedProjectAndActiveEditor()
if C::B starts up with some projects opened, this function will be called to parse the already opened...
void OnParserEnd(wxCommandEvent &event)
batch parsing end event this event usually be fired when the task pool becomes empty ...
virtual wxString GetDocumentation(const CCToken &token)
Supply html formatted documentation for the passed token.
void OnScope(wxCommandEvent &event)
Toolbar select event.
NameSpaceVec m_NameSpaces
current active file's namespace/scope info
void RereadOptions()
read CC's options, mostly happens the user change some setting and press APPLY
virtual std::vector< CCToken > GetAutocompList(bool isAuto, cbEditor *ed, int &tknStart, int &tknEnd)
Supply content for the autocompletion list.
std::map< cbProject *, wxArrayString > ReparsingMap
map to record all re-parsing files
void MatchCodeStyle(wxString &str, int eolStyle=wxSCI_EOL_LF, const wxString &indent=wxEmptyString, bool useTabs=false, int tabSize=4)
modify the string content to follow the current editor's code style The code style includes the EOL...
void OnEditorOpen(CodeBlocksEvent &event)
void OnClassMethod(wxCommandEvent &event)
handle CC's context menu->insert "Class method declaration/implementation..."
bool m_NeedReparse
indicate the editor has modified by the user and a real-time parse should be start ...
void FunctionPosition(int &scopeItem, int &functionItem) const
helper method in finding the function position in the vector for the function containing the current ...
void DoCodeCompletePreprocessor(int tknStart, int tknEnd, cbEditor *ed, std::vector< CCToken > &tokens)
fill the tokens with correct preprocessor directives, such as #i will prompt "if", "include"
size_t m_CCMaxMatches
maximum allowed code-completion list entries
NativeParser m_NativeParser
this member will actually manage all the Parser instances