Commit Graph

20 Commits

Author SHA1 Message Date
Gergo Mocsi
755a74906e GSOC work, multiple fixes
Code completion: parser recognizes extended types ony when the checkbox is checked.
Fixed a crash caused by a misspelled uno type.
Fixed function CodeCompleteDataCache::Clear() to clear both internal variables.

Change-Id: I82fdd2e1cf749237e2e2de4a9a2fc7d07fb7eb4a
2013-09-02 18:17:01 +02:00
Gergo Mocsi
67596f4cc6 GSOC work, autocorrect procedures+variables
Fixed some small issue with the right arrow key in the ListBox.
Autocorrection now correct all variable types and procedure names.

Change-Id: Iff1abaf10c621aef04772837faa272bb6f987e37
2013-09-02 18:17:00 +02:00
Gergo Mocsi
82a4ad7a5c GSOC work, renaming + options fix
Options now work correctly: I've added the missing function.
Rename: renamed some variables and methods to kep the consistence( Autocorrect keywords -> Autocorrect).

Change-Id: I6b4914575f1a06eb3268c133b8b990364e3d24e4
2013-09-02 18:16:59 +02:00
Gergo Mocsi
9b534193a3 GSOC work, behavior fixes
Code completition: left/right arrow keys handled. Left arrow dismisses the dialog when reaches the dot. Right arrow dismissed the dialog when reaches the next line.
ListBox appearance fixed.
TAB key can insert the first matching entry.
Autocorrect:
"Autocorrect Keywords" has been renamed to "Autcorrect" (in the UI, and the config file, after this patch a make dev-install is needed). Keyword case correction is not just capitalizing the first letter ( eg. Elseif -> ElseIf ).
Autoclose procedures:
cursor is being placed inside the preocedure.

Change-Id: Ie7e9ae96b49bd94562db83f96e1c4ad63ab3f3d6
2013-09-02 18:16:58 +02:00
Gergo Mocsi
790a7aff12 GSOC work, renaming for consistency
Menu enrty was renamed to IDE Options under View.
SID_BASICIDE_CODECOMPLETE was renamed to SID_BASICIDE_IDEOPTIONS.
CodeCompleteDlg was rename to BasicIDEOptionDlg.
Ui file was renamed to basicideoptionsdialog.ui.
Checkbox for extended types is now independent from code complete one.

Change-Id: Id862df0ee56cdf2aa81e19a34099fe679ad5d311
2013-09-02 18:16:54 +02:00
Gergo Mocsi
27da1e7340 GSOC work, ListBox appearance fix (at the borders) + code fixes
ListBox appearance fixed at the borders:
a) bottom: it it placed over the current line (not under)
b) right side: listbox's right side is adjusted to the window's right side
Coed fixes:
CodeCompleteOptions now intializes itself from the configuration file BasicIDE.xcs
Added a checkbox for enabling extended types in the options dialog.
Cursor is visible when the listbox is active.
Fixed the small issue when deleting a character.

Change-Id: I68b80143de245cebfce65cdd8af37ea4694aa81b
2013-09-02 18:16:53 +02:00
Gergo Mocsi
c149c96cf4 GSOC work, "autocomplete procedures" fix + new feature
Fixed the procedure autoclose function. Now, autoclose is based on the syntax higlighter: if finds an opening token, starts searching forward to a close token.
If there is another sub/function keyword, or EOF is reached, the procedure is considered incomplete.
If the end token is found, the procedure is considered to be closed.
Added function autocorrect symbol spelling, wich corrects the ascii case of the keywords, and corrects the spelling of the extended types.

Change-Id: Ibd17f319a6d6ff5c3f91f4adb7a10dc701f0468a
2013-09-02 18:16:52 +02:00
Gergo Mocsi
92374fb966 GSOC work, listbox appearance fix
Fixed the listbox appearance even the source file is scrolled.
When scrolling, and the listbox is visible, it gets hidden.
I've set the Code Completition to defaultly true, to make testing easier.

Change-Id: If571a4f1d38751b35fd43ab3c1f13daccd9dd375
2013-09-02 18:16:51 +02:00
Gergo Mocsi
59055f24cb GSOC work, nested reflection fix - again
Fixed the issue when an invalid method was typed, listbox showed tha methods of the base variable.

Change-Id: I88576645b373e76112103055d547f713af1fc153
2013-09-02 18:16:51 +02:00
Gergo Mocsi
412e91d33d GSOC work, implement "Autoclose parenthesis" function
Autoclosing parenthesis function is working. Implementation is similar to autoclosing double quotes, except that this one does not need the HighlighPortion struct to use.
Renamed the checkbox title to "Autoclose parenthesis".

Change-Id: I4311cd8020f0dc0b62a2d8707e0eccbf57e0d2c2
2013-09-02 18:16:50 +02:00
Gergo Mocsi
40433e2ca9 GSOC work, implemented "Autoclose Double Quotes" option
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
2013-09-02 18:16:49 +02:00
Gergo Mocsi
9a7b942a0a GSOC work, procedure autoclose implementation
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
2013-09-02 18:16:49 +02:00
Gergo Mocsi
d5aa9c3b23 GSOC work, disable QuickSelectionEngine+ListBox navigation modification
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
2013-09-02 18:16:49 +02:00
Gergo Mocsi
edcec5b1be GSOC work, cache implementation fix, code fixes
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
2013-09-02 18:16:48 +02:00
Gergo Mocsi
70ab744ccf GSOC work, ModalDialog instead of menu entry
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
2013-09-02 18:16:48 +02:00
Gergo Mocsi
61ee2598b1 GSOC work, code complete option, menu entry fixes
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
2013-09-02 18:16:47 +02:00
Noel Power
b0b511e9b5 fix compile error, cerr not defined
Change-Id: Id33342491dd9bad0ee2f1a7bc648ed669a2b92b9
2013-09-02 18:16:47 +02:00
Gergo Mocsi
3ce1f554de GSOC work menu entry + code fix
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
2013-09-02 18:16:47 +02:00
Gergo Mocsi
6165d0b484 GSOC work, some code fixes
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
2013-09-02 18:16:46 +02:00
Gergo Mocsi
6c1854f9f3 GSOC work, code fixes + cache implementation
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
2013-09-02 18:16:45 +02:00