Due to this problem, I need some clues about the ContextCpp class.
1 : What is the exact goal of the ContextCpp::GetExpression method ? Most of the time, it returns an empty string. And reading the code source, I don't understand what is the expected output regarding the caret position.
2 : What is the expression used for ?
Thanks
ContextCpp questions
-
- CodeLite Guru
- Posts: 351
- Joined: Mon Oct 20, 2008 7:26 pm
- Genuine User: Yes
- IDE Question: C++
- Location: France
- Contact:
ContextCpp questions
Jérémie
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: ContextCpp questions
There are 2 main functions that being used for code-completion (and all other related functionalities, like 'goto declaration' etc):jfouche wrote:: What is the exact goal of the ContextCpp::GetExpression method ? Most of the time, it returns an empty string. And reading the code source, I don't understand what is the expected output regarding the caret position.
Code: Select all
bool TagsManager::AutoCompleteCandidates(const wxFileName &fileName, int lineno, const wxString& expr, const wxString& text, std::vector<TagEntryPtr>& candidates)
bool TagsManager::WordCompletionCandidates(const wxFileName &fileName, int lineno, const wxString& expr, const wxString& text, const wxString &word, std::vector<TagEntryPtr> &candidates)
Assuming this code snippet:
Code: Select all
wxString str;
str.BeforeFirst(wxT('/')).B| // the | represents the caret current position
The function 'ContextCpp::GetExpression' is responsible for extracting it from the editor and passing it 'TagsManager'
Just place a breakpoint at one of the two functions above (TagsManager::AutoCompleteCandidates & TagsManager::WordCompletionCandidates) and see the value of 'expr'
You could take a look at the 'CodeCompletionTests' workspace to see a simplified version of how these two methods are being used
Eran
Make sure you have read the HOW TO POST thread