IDE enchavements : AutoComplete (including user libs), Doc Tooltips, New SyntaxColoring, etc..

532 views
Skip to first unread message

Ricardo JL Rufino

unread,
Dec 16, 2014, 9:27:17 AM12/16/14
to devel...@arduino.cc
Hello friends,
Finally finish at least 90% of implementing and testing, took a little more work than I imagined, but I think the result was legal.
And it will be important for novice users, and even that is experienced (I even learned several new methods that did not know existed)

The overall goals were:

- Autocomplete (90%)
- Real-time Parser and Error Marker(90%)
- Documentation in Editor (in progress - 20%)

The parser system library was implemented in a separate project: cplus-libparser

The parser is done only the first time, and is saved in a binary file (lib.index), these files I do not commited, then the first parser will be a little slow (but is done in threads). 
After we made the necessary adjustments in the libraries (such as adding documentation in the code) these files (index) will be distributed with the IDE

Follow my work log and tests

Autocomplete
===================
[X] Integration with the IDE  (using: RSyntaxTextArea)

## Indexing of Libraries Classes
     [*] Arduino Core (AVR)
        NOTE: I believe you need to make manual adjustments, remove some useless things and add other (eg contants HIGH, LOW)
              I'm not reading the #DEFINE for 'variables', because it will turn a mess.  
     [x] Multi Editor (many instances) support.
     [x] User Lib's(3rd-party libs)
     [x] Arduino Default Lib's
     [x] Inheritance Support  (Ex: Serial -> Stream -> Print)
     [] Index only the important files of libs (for now is taking all .h)  
     

## Autocomplete methods Classes
    - [X] Instances
    - [X] Static Classes
    - [X] Pointer 
    - [X] Get the parameters of methods
    - [X] Auto-Complete using partial name method (contains!)
    - [X] Order by type
    - [x] Handle Struct
    - [*] Handle extern (Ex: extern SPIClass SPI || extern EthernetClass Ethernet).
          [] Multiple alias Ex: Serial1, Serial2, etc...
    - [*] '#define' statements 
          I'm not reading the #DEFINE for 'variables', because it will turn a mess. 
          NOTE: not parsing blocks like: "#if defined(UBRR1H) extern HardwareSerial Serial1;" in HardwareSerial.h    
      [*] Disable on External MODE.

## Sketck - Autocomplete code being edited
      [x] Show only included Classes.
      [x] Show the variables of the current scope (use offset techniques)
         [x] Detect current function (based at the cursor location)
         [x] Update the position (offset) of the functions when the document is modified (new lines), without making the parser.
         |- NOTES:
         |- In Autocomplete they must appear first (deone).
         |- Not perfect, variables declared in blocks (if / while) are considered as function scope, to improve the performace
      [] Renaming / save as you must update the name in the Autocomplete Cache
         - have to remove the libraries that BEEN REMOVED (imports removed ..) ...
      [x] Parse source in-memory (do not need to save)
      [x] No show 'functions' outsite functions, only show classes
      [x] Detect custom variable names (EthernetClient client)
      [*] Parser in real time: 
          [x] Make the parser of changed line (ending with ';') and extract variables (and possibly errors).
          [x] Perform parse if you are changing a line with errors (syntax)
          [x] Perform parse if you are changing a line with errors (after compile)
          [x] Perform parse if you are changing a line with variable declararion.

          [] Enhancement: Parser current line using REXEX (for performance)
          - IMPL NOTE: For while it is being made a parser all code, is fast but could be better
                       The whole parser was necessary because i had to update the position (offset) of the methods in the document, 
                       but now this is already being done, I think a REGEX can be better    
          - NOTE: Only a parser(for same file) can run at the same time

[x] Async(Multi-tread) library parser... (based on Eclipse CDT AST Parser) 
    This is a external project: 'cplus-libparser', which can be used in other projects. ;)          

[] Auto-Detect libraries dependency.


[x] Auto generate variable names (ALT + ENTER) inside a function call (Ex: digitalRead(var))
    [x] After inserting into document, it must also appear in autocomplete

[*] Auto-Complete of the main functions parameters
  Ex: Serial.begin({lista develocidades}), digitalWrite( {variables} , [HIGH / LOW])
   [] This information should be captured from the source code (documentation)

[*] Show syntax(parser) error's
    NOTE: need to be well tested, I did a few tests

[x] Autocomplete for #include pick up all the libraries;
    NOTE: The window of the options just close with ESC or when you click with the MOUSE out, not close with TAB

[*] - Update LibraryIndex/Autocomplete on change libs of sketch
    [x] Fire on Import from Menu
    [ ] Fire on Import from ZIP.
     
[*] Store/Load parsed result in lib.index on each folder..
    [ ] establish policies to update the index (LibraryChangeMonitor (only for h. files))
        - How to deal with the upgrade of core libraries? must validate the version?
    [x] You may want to implement a Serializer / Deserializer (NOTE:for now the index is binary )
   
[] Use 'javax.swing.text.Document' to parser, to avoid strings allocations
   TODO: It has not been confirmed whether there is this problem. but I think so ...
   Need implement: org.eclipse.cdt.internal.core.parser.scanner.AbstractCharArray

[x] Automatic adjustment of the position of the tooltip(completions window) to left or right

[] BUG(linux): The autocomplete window not working when you have another window "always on TOP"

Editor
===================
[X] Swap lines using ALT+(UP/DOWN)
[X] word navigation - CTRL + (UP/DOWN/LEFT/RIGHT)
[x] Muli-line ident using TAB
[x] Auto-close / Identation brackets in if/method/etc..
[x] Auto ident on new Line.
[x] FIX/NEW: Goto line on ERROR and Highlight
[x] Automatic doc block closing
[x] Change TABS - Control+TAB / Control+SHIF+TAB(bugs on linux)
[x] Old Popup Menu (has been improved)
[x] Menu shortcuts (tests)
[x] Preferences: Show Lines Numbers
[*] Text / Documentation Links (CONTROL + CLICK)
[x] Open reference documentation using CONTROL + CLICK
[] Highlight the rows that were changed? with GREEN? and erase a block of code?
[x] Keep Selection / Cursor when switch between Tabs
[x] BUG: Line counter: this cutting the numbers starting Line 100
[x] Better tab header font render e dirty icon
[x] Suporte a UNDO/REDO em várias abas de forma independente
[X] Melhoria no sistema de Ctrl-z (ante voltava de 1 por 1 caracter ! muito chato...)
[x] FIX: Ugly Icon and Name on Linux (ALT+TAB  Window)
[x] Show syntax errors (only to well Ugly Mistakes)
[X] Export to HTML/BBCODE (tested copy/past and online html viewer - http://jsfiddle.net/9wza5Lnh/2)
[x] MENU (Use Selection For Find) Removed - It was not working, and also normal Find already performs the same task
[x] Open Urls from Text
[x] Autoformat

[*] Multi-Tab Support
    [x] Independent Undo/redo
    [ ] Some features do not work properly (as Mark Ocorrences and Code Fold)  
        NOTE: if disabled, can you use without problems
             - A more drastic strategy was to use an instance of Textarea for each tab.   

[*] Internal Documentation Browser
  - This is still in development
   [x] Linked on Editor Click !
   [x] Show documentation Tootip on Hover classes in editor.
   [] Use Doxygen to generate small documentation block's (for each method) for tooltip.
       NOTE: For now, i'm using current reference files (BIGG HTML FILES !!!) and spliting html (performace problem !!!)
   [] From Source-code - takes the source code documentation  
      NOTE: already figured out how to do, but need to create the documentation standardization
[*] Editor Color Shema (using XML Config from: lib/theme/syntax/).
    NOTA:The old classes TextAreaDefaults, THEME, no longer fit for that.sso.
    [] Open XML and allow edit (GUI or TEXT?)
    [] Add the option in the preferences to select the theme file 


Ricardo JL Rufino

unread,
Dec 16, 2014, 9:29:24 AM12/16/14
to devel...@arduino.cc

Federico Fissore

unread,
Dec 16, 2014, 10:12:51 AM12/16/14
to devel...@arduino.cc
Huge!

Thanks, I'll do some testing in the coming days

Regards

Federico


Ricardo JL Rufino ha scrito il 16/12/2014 alle 15:29:
> PS: Just forgot the main! rsrsr
>
> https://github.com/CriativaSoft/Arduino/tree/ide-1.5.x-autocomplete
>
> Em terça-feira, 16 de dezembro de 2014 11h27min17s UTC-3, Ricardo JL
> Rufino escreveu:
>
> Hello friends,
> Finally finish at least 90% of implementing and testing, took a
> little more work than I imagined, but I think the result was legal.
> And it will be important for novice users, and even that is
> experienced (I even learned several new methods that did not know
> existed)
>
> *The overall goals were:*
>
> - Autocomplete (90%)
> - Real-time Parser and Error Marker(90%)
> - Documentation in Editor (in progress - 20%)
>
> The parser system library was implemented in a separate project:
> cplus-libparser <https://github.com/ricardojlrufino/cplus-libparser>
>
> /The parser is done only the first time, and is saved in a binary
> file (lib.index), these files I do not commited, then the first
> parser will be a little slow (but is done in threads). /
> /After we made the necessary adjustments in the libraries (such as
> adding documentation in the code) these files (index) will be
> distributed with the IDE/
>
> *Follow my work log and tests*
> <https://code.google.com/p/arduino/issues/detail?id=236>
> https://github.com/arduino/Arduino/pull/2174
> --
> You received this message because you are subscribed to the Google
> Groups "Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to developers+...@arduino.cc
> <mailto:developers+...@arduino.cc>.

Ricardo JL Rufino

unread,
Dec 18, 2014, 9:53:44 AM12/18/14
to devel...@arduino.cc
Some visual changes



Em terça-feira, 16 de dezembro de 2014 11h27min17s UTC-3, Ricardo JL Rufino escreveu:

Tom Igoe

unread,
Dec 18, 2014, 9:59:29 AM12/18/14
to devel...@arduino.cc
I like the compilation error marks. 

I don’t like the choice that only IO functions are highlighted. I think it’s best that all the API-specific commands are highlighted, as it signals to new programmers what words are built into the API and what words are not. Having only some of the API terms highlighted will be confusing to many, I suspect.

I don’t know what you’re indicating at the top of the IDE, looks like you left a label off.

t.

--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.

Ricardo JL Rufino

unread,
Dec 18, 2014, 10:27:54 AM12/18/14
to devel...@arduino.cc
Really had not thought of that.
I just did the analysis of the examples of the API, and saw that he had many words in orange, visually hinders more than it helps.

Do you think other methods of "native libraries" should be highlighted.
Or only functions of the "Arduino.h"



Tom Igoe

unread,
Dec 18, 2014, 2:01:53 PM12/18/14
to devel...@arduino.cc
I think I’d leave it as it is in the current system. Works pretty well in the classroom.

t.

Ricardo JL Rufino

unread,
Jan 23, 2015, 8:30:47 PM1/23/15
to devel...@arduino.cc
Hello friends, returning to talk again.
The pull previous request had not been well accepted due to refactorings made after making the fork prevented from doing merge easily.

Started the implementation starting in the most current version of branche: 1.5.x and already is available for testing.


Improvements address:
- The replacement of the current editor by: RSyntaxTextArea
- Implementation of Autocomplete (a module part now)

And in part:
- Syntax Error detection at runtime.
- Integrated documentation system

Summary of changes and tests:

Now I need you to help test!



Reply all
Reply to author
Forward
0 new messages