Forums

Code Completion Video

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Code Completion Video

Postby nerdzero » Wed Nov 28, 2012 1:59 am

I finally made some time today to sit down and really focus on getting autocompletion working. This video shows some keyword, class, and member completion. I haven't been able to get local variables in methods to work yet.

http://www.youtube.com/watch?v=pgJKQRm25qI&hd=1

Apologies about crappy video quality (screen flickers at times) but it's really late and I don't feel like messing with the settings. It's best watched in fullscreen.

There are a lot of bugs and still a lot of work to be done but I was quite happy when I got something that was working without crashing and was actually useful. If you want to play with it yourself, download the 'completion' branch from GitHub but please remember this is not considered stable: https://github.com/ramon-rocha/MonoDeve ... completion

I should have all day to work on this Saturday so hopefully I can squash some bugs, clean up the code, and get us that much closer to proper code completion for Cobra!
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: Code Completion Video

Postby kobi7 » Wed Nov 28, 2012 9:28 am

Congratulations!! nice work!
Falun Dafa is Good.
Truth, Compassion, Forbearance is Good.
kobi7
 
Posts: 82
Location: Israel

Re: Code Completion Video

Postby Charles » Wed Nov 28, 2012 10:02 am

Excellent! Thanks.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Code Completion Video

Postby Nefarel » Wed Nov 28, 2012 2:17 pm

Nice.

It would be nice not to have do indentation manually with TAB key. It is so annoying.
Nefarel
 
Posts: 6

Re: Code Completion Video

Postby Charles » Wed Nov 28, 2012 2:38 pm

Does your editor maintain indentation? Many do out of the box or can be configured to do so.

Presuming you get that going, then indentation in Cobra is two keystrokes:
<ENTER> <TAB>

In Python it's typically <SHIFT><:;><ENTER> and C-like languages are typically <SHIFT><{[><ENTER>.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Code Completion Video

Postby nerdzero » Wed Nov 28, 2012 3:02 pm

Agreed, Nefarel. In MonoDevelop, this would be accomplished by developing a Formatting text editor extension.
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: Code Completion Video

Postby jaegs » Wed Nov 28, 2012 6:57 pm

Nice!
jaegs
 
Posts: 58

Re: Code Completion Video

Postby hopscc » Wed Nov 28, 2012 10:23 pm

Cool stuff, excellent work...

One thing that struck me watching the video is that with cobra theres another opportunity for completion:
If you are entering the first non whitespace token (word) on a new line, more often than not ( or pretty often, or sometimes (:-))
it's a keyword
assert, print, raise, def, while, .....

if you can detect that condition (only whitespace before cursor back to SOLn ) perhaps add the matching keywords to the filter list

( enhancement v2 :) )

Good stuff with what you've got working so far...
...
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Code Completion Video

Postby nerdzero » Thu Nov 29, 2012 9:42 am

Thanks, hops. I've tried something similar so far with mixed results. After determining what region the cursor is in, the completion extension will examine the text of the first line of the region. It will include a different list of keywords depending on if the region starts with "class ", or "def ", etc. I've been thinking about maybe seeing if I can utilize the CobraTokenizer here to simplify this or possibly use regular expressions instead.
nerdzero
 
Posts: 286
Location: Chicago, IL


Return to Discussion

Who is online

Users browsing this forum: No registered users and 9 guests