Hi all,
here's my weekly report of GSOC activity. This week, I've managed to hook
into the BASIC compiler, and use it for code completition. The reason is
simple: it recognizes everything (eg. variables, ..), and stores them in
the symbol table. After the parsing, I extract the data from the symbol
table. This work is done by a function
called GetCodeCompleteDataFromParse() created in SbModule, and returns a
vector of CodeCompleteData, which is a simple struct to hold variable name,
it's parent(the function where it was created, in case of global variable
nothing) and also it's type, when it's an object
(like com.sun.star.ui.dialogs.XFilePicker). The parsing+extracting the data
is trigerred by inserting/deleting/changing text in the ide, and is
implemented in the funtion EditorWindow::Notify. Here, I should update a
cache, but now, it simply reassigns a variable named aCodeCompleteCache
(type std::vector< CodeCompleteData > ) beacuse now the parses parses the
whole file (which may sound nasty, but it was simple to do something
working, and it may change later, as the cache). Code completition is
trigerred by pressing key "." (the dot :) ), and this is implemented in
function EditorWindow::KeyInput: when the user presses teh dot key, it
extracts the string before the dot(to the first space), and if is can be
found in aCodeCompleteCache (beacuse it was delared as a valid object),
it's methods are printed out on terminal (with SAL_WARN this time), these
method will go to a LisBox/ComboBox, which will display them, and allow the
user to select one from them. At the moment, I'm stuck witch ListBox, it
gets created, but not displaying(and Show() function is called :) ).
Regards,
Gergő
Context
- GSOC weekly report week 2 · Gergő Mocsi
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.