Feature autoclosing double quotes (strings) implemented.
When the user presses the '"' key, it's pair is also being inserted (only when the previous character is also a '"'), and the cursor is being placed inside the two quotes.
Also, if the there was a string (like: "aaa""), the second one is not inserted.
Change-Id: I3e4a5e426d2d4bdbf56899fe3e36359ae161b52a
Now, function procedure autoclose is working.
Created a struct named IncompleteProcData to store the line number, type and name of the inclomplete procedure. Procedures are store in a vector (IncompleteProcedures), and are as a member in SbModule.
I've created a function called SbModule::GetIncompleteProcedures() to extract the data. Data extraction uses SbModule::SetSource32, beacuse that one tokenizes sthe source file, and recognizes procedures.
Closing procedures is triggered ky pressing the Enter key when typing. It checks the actual sub, and if it's incomplete, adds the correct ending( End Sub/End Function).
There is only one problem: function SbModule::SetSource32 is not too often calle, maybe extraction should be done by a timer.
Change-Id: Id88daaef329e8b5c194b765c5261d356bfb3a0c9
Added a function to disable QuickSelectionEngine in ListBox, beacuse it's not needed.
ListBox navigation changed: it is not hiding/showing entries, instead of it, jumps to the longest match without filtering.
Arrow behavior remains the same.
Change-Id: I8982c280f20929c74f9630cbaa95010820d2e234
note: using VBA objects with the code completion is not possible at
the moment. Unfortunately there is some hard coded hacks for flattening
the namespace used by checkUnoObject.
Change-Id: Ic3a3149f41a6959943e71fa7ac22ff4dab7f30a1
The CodeCompleteDataCache got a new implementation: global variables are stored separately.
The "static const" OUString-s were removed from the class.
Data extraction is only done when pressing the dot key.
Change-Id: I3ff94c0c6eabe328761336d4c74744eb7efc6056
Created a ModalDialog named CodeCompleteOptionsDlg to edit options for code completition/suggestion.
Unimplemented features in it are disabled.
The dialog window uses Glade .ui file.
Change-Id: I1b59f386a9575aa25b38c5a1d7d1f020498a69ab
Menu entry is added under View->Enable Code Completition when in Experimental mode.
Fixed the call of funtion SbModule::GetCodeCompleteDataFromParse() to be called only when code completition is enabled.
Replaced the occurences of SvtMiscOptions to CodeCompleteOptions.
Change-Id: If0520123ab5f612d7d24fb98f8e9bf6881af76cb
Fixed the definition of GLOB_KEY, NOT_FOUND from const to static const.
Added a new menu entry for code completition under View->Enable Code Completition.
Change-Id: If8ac25ee43a7ba780ccdee2e5e909777115a1f27
CodeCompleteWindow is hidden when clicking out: thi is implemented in
EditorWindow::MouseButtonDown: if CodeCompleteWindow is visible and
the actual TextSelection of the window and the parent's TextView is
different, hide the window (I assume the user changed selection, eg.
clicked on other line, etc.).
Change-Id: Icb6bcffa837b2f7e1ccef288b9d762e27649410b
Fixed the link error: declared CodeCompleteDataCache as BASIC_DLLPUBLIC and it worked fine.
Fixed sergmentation fault error in CodeCompleteWindow.
The new cache implementation is fully functional.
CodeCompleteWindow is now being used as boost::scoped_ptr.
Change-Id: I76a0fc7407d589e7f94280fc4d50cea51b9639db
WARNING: cache implementation gives a link error to it's methods.
Created the cache called CodeCompleteDataCache in file include/basic/codecompletecache.hxx
This class should replace the std::vector< CodeCompleteData > int file baside2b.cxx
When issuing command "make basic", it compiles fine, but, when "make basctl", it gives a link error (ld returned status 1) to CodeCompleteDataCache's methods.
Change-Id: If78c6533b7fb5653cc459d22b80c98d097b886eb
ListBox sorts entries alphabetically.
When typing, filters the matching function names.
ListBox closes on key tab and space, beacuse I assume the user typed in the
whole function name.
Change-Id: I045b1b990b0e0af70de75c32249b7497b51b9e98
Added a function to select the first entry in the ListBox by default.
Selected entry can be inserted with the ENTER key.
Fixed some code in basic code generation class (SbiCodeGen).
Change-Id: Ia6eb43ee5661a0a3ae0b738b619f19972f019eac
Fixed the window width to adopt size by longest entry.
Window height is set to display 8 lines, plus the scrollbar.
When selected, window can be close by the ESC key( done by PreNotify() ).
Also, renamed it to CodeCompleteWindow for consistency.
Change-Id: I9cd53c3d868cdaeb8d391547f16da7038278154b
Changed CodeCompleteListBox into a Window which contains a single ListBox.
Navigation with arrows is enabled, window closes on ESC key.
Double click inserts the selected method into the source code.
Visible line count in ListBox is set to 8 lines, width is adopted from the
longest entry.
Change-Id: I6b6ceb0ce78f9fc727aed53952dc6ee24cba47df
Ive fixed the parameter problem: I use the tokens created
by the syntax highlighter (it's struct HighlightPortion),
and put the identiiers to the vector, and reflect them.
Change-Id: I08888e4a8bf00fa987a16466f4a5ac03836e5ee7
This week I've managed to fix the ListBox appearance. Also, I've modified the code: it gets the data on insert/remove/change, and gets updated only when the dot is pressed. This makes the data to be up-to-date. Next, I wrote a Split(OUString , char) function to do the nested reflection (It works, but it will need some tweaks later). Also, code generation is disabled for code completition (just a boolean value, maybe it could be done in a more "elegant" way, like the error supression).
Change-Id: I43d250c0a065351950ac6424dcd88266d70bcef3
This patch allows the pop-up CodeCompleteListBox to appear under the cursor.
It's size is fixed:150x150.
Also, I've fixed a bug in extracting the current variable name.
Change-Id: Id98cb1c29be72af07a25aac3d51561f072bf103e
This patch allows the Code Completition feature to list methods in a custom ListBox class called CodeCompleteListBox.
So, when the user presses the dot("."), a ListBox appears, and listed the methods(not just prints on the terminal).
The user can select one from them, and it is put in the source code (after the dot).
Change-Id: Ie5165e7bdaae1d96bbf40a9b996ca8ebbdb40dea
This is an early version. I use the BASIC parser to parse the source,
then the infromation is extracted from the symbol table built by parser.
Error reporting is suppressed, beacuse it is not needed fro code completition.
I placed my function inside SbModule, and created a struct called CodeCompletitionData, which holds the object's name, it's parent, and it's type name.
This function, SbMethod::GetCodeCompleteDataFromParse() is called from Basic IDE's Notify function, which updates a cache(actually, reassigns a viariable :) ).
Later, in the EditorWindow::KeyInput function there is a check wheteher dot key is pressed. After that, the actual variable (or word) is being looked up in the vector that holds code completition data. And finally, if it is found, it's methods are printed on the terminal.
Change-Id: Idaf19baa8f720b8b117a76dc3cc2f90dd04fd155
Introduced a new function calles IsUnoInterface in SbiParser to determine, if
a variable is a type of an UNO interface. It uses reflection.CoreReflection to
do that, on success it returs true otherwise false.
Change-Id: I18895127bcbd92dc7a25feb5d82a7d1343bde851
rsc needs to resolve all known defined languages without access to
liblangtag because that would need
/usr/local/share/liblangtag/language-subtag-registry.xml so we'd end up
with a bootstrap problem (or would have to pass the database path).
Change-Id: I6b966d45080da26cb89169cdb40cd8a58c04a276
Checking a string of 17399 spaces takes 20 seconds here in
GrammarCheckingIterator::GetSuggestedEndOfSentence() because
BreakIterator_Unicode::endOfSentence() will always return
0 as a result regardless of what nStartPos it gets.
Change-Id: Id02440a91d7015c2896e387854445ee5383092fa