1. WEE auto-complete

One feature I miss from the Euphoria editor is auto-completion of blocks. For example:

if ... 

autocompletes to something like:

if ... then 
 
end if 

I'd test it out with ed, but launching ed currently gives me this error:

<0158>:: Wrong number of arguments supplied for forward reference 
    C:\euphoria\bin\ed.ex (547): function SyntaxColor.  Expected 2, but found 4. 
        color_line = SyntaxColor(this_line, ,get_multiline( bline - 1 )) 
                                ^ 

Anyway, the auto-complete comes in handy, but should probably be an optional sort of thing.

The Ctrl+Space behavior would also be nice if it inserted the missing include at the top of the file on selection.

It would be nice if the Subroutine Arguments (Shift+F2) worked a bit smarter. Currently, you have to select the routine name in order for the arguments to display. What would be nicer is if it popped up automatically. The simplest way (but not most robust) would be to look for a '(' key being pressed. It would then look to the left of the parenthesis to see if there were an token there that belonged to a function. If there was, it could automatically display the argument list for that routine.

- David

new topic     » topic index » view message » categorize

2. Re: WEE auto-complete

dcuny said...

One feature I miss from the Euphoria editor is auto-completion of blocks. For example:

if ... 

autocompletes to something like:

if ... then 
 
end if 

I'd test it out with ed, but launching ed currently gives me this error:

<0158>:: Wrong number of arguments supplied for forward reference 
    C:\euphoria\bin\ed.ex (547): function SyntaxColor.  Expected 2, but found 4. 
        color_line = SyntaxColor(this_line, ,get_multiline( bline - 1 )) 
                                ^ 

- David

Welcome to ed/edx.ex hell...

Obviously you have a ed.ex/syncolor.e mismatch. Line 547 which you quoted from ed.ex appears to be from euphoria 4.1, but you appear to be referencing a 4.0 version of syncolor.e.

Check your eu.cfg files.

I seem to have managed a beta version of Linux which has renamed ed.ex as edx.ex which executes and auto-completes the "if then" block as expected.

However, I have never been able to get any version of ed/edx.ex to display multi-line quotes, double quotes, or single quote - tick marks correctly. It seems that a tremendous amount of effort has gone into adapting syncolor.e and developing tokenize.e - to no good end that I can tell. So, ed.ex has been renamed edx.ex and virtually abandoned. Kinda reminds me of an old movie in which the family members would beat the dog every time grandma farted.

I hope WEE.EX grows to includes the features you referenced. Linux user's best bet for an editor is Geany, or perhaps GVIM.

Regards, Ken Rhodes

new topic     » goto parent     » topic index » view message » categorize

3. Re: WEE auto-complete

dcuny said...

One feature I miss from the Euphoria editor is auto-completion of blocks. For example:

if ... 

autocompletes to something like:

if ... then 
 
end if 

Yes, so much yes. I adored this feature in EE, and will be adding it to WEE eventually.

dcuny said...

The Ctrl+Space behavior would also be nice if it inserted the missing include at the top of the file on selection.

Agreed; the current behavior (the include is a comment) is a half-baked solution. I wouldn't want to put it at the very top of the file, but after the first group of includes in the file.

dcuny said...

It would be nice if the Subroutine Arguments (Shift+F2) worked a bit smarter. Currently, you have to select the routine name in order for the arguments to display. What would be nicer is if it popped up automatically. The simplest way (but not most robust) would be to look for a '(' key being pressed. It would then look to the left of the parenthesis to see if there were an token there that belonged to a function. If there was, it could automatically display the argument list for that routine.

Yeah, popping up on pressing '(' key should be doable. I would also like to see the current argument highlighted like intellisense does. Counting commas backwards seems like the most straightforward solution, but it wouldn't work right if a comma appears in a string, function call, or sequence literal. I could probably use the parser's expression evaluator to figure out which argument to highlight... won't know until I try.

new topic     » goto parent     » topic index » view message » categorize

4. Re: WEE auto-complete

PeteE said...

Yes, so much yes. I adored this feature in EE, and will be adding it to WEE eventually.

Yes! grin

PeteE said...

Agreed; the current behavior (the include is a comment) is a half-baked solution. I wouldn't want to put it at the very top of the file, but after the first group of includes in the file.

And if there are no includes?

PeteE said...

Counting commas backwards seems like the most straightforward solution, but it wouldn't work right if a comma appears in a string, function call, or sequence literal. I could probably use the parser's expression evaluator to figure out which argument to highlight... won't know until I try.

Yeah, I just tested out what I'd coded for wxBasic, and it's not nearly as clever as it should be about handling commas and embedded functions. Basically, I've coded it so that entering a ( causes it to be activated. It remembers the location of the parenthesis, and entering commas while it's active causes it to count the number of commas between the current position and the anchor, and then highlight that parameter in the tooltip.

As you noted, that approach could be a lot better, but it works fairly well for a quick hack.

Something else for autocomplete to eventually know about are include files. That's a long rabbit hole, but being able to specify a namespace such as:

   my_namespace: 

And have intellisense pop up will be really helpful. For example, I've got a lot of code that pretends it's a class by doing stuff like:

include "my_class.e" as my_class 
 
sequence instance = my_class:new() 
 
{instance, result} = my_class:some_call(instance) 
 
instance[my_class:SOME_ATTRIBUTE] = my_class:SOME_CONSTANT * 3 

Having the intellisense trigger on the : character to bring up public declarations from that namespace would make my life much easier.

But I figure that's a ways off, and a request for another thread. blink

- David

new topic     » goto parent     » topic index » view message » categorize

5. Re: WEE auto-complete

Alright, got the auto expand working with if, while, for, loop and subroutine declarations.

Also, autocomplete already kinda worked with namespaces, so I just wired it up to pressing the ':' key, and poof, there you have it.

Still to come: include insertion at the top of the file, revamped ex.err dialog.

Download WEE version 0.12 here

new topic     » goto parent     » topic index » view message » categorize

6. Re: WEE auto-complete

I want you to know that I opened this and checked out the sources of EUPHORIA with it under Wine. Neat stuff I love the auto-complete feature. It's like watching an old favorite movie.

I remember the original Euphoria editor had parenthesis of different colors. Matching parenthesis would be the same color, the outer layer had black the next had some other color, and so on.

SD Pringle

new topic     » goto parent     » topic index » view message » categorize

7. Re: WEE auto-complete

SDPringle said...

I want you to know that I opened this and checked out the sources of EUPHORIA with it under Wine. Neat stuff I love the auto-complete feature. It's like watching an old favorite movie.

Nice. Was it in EE first, or ED? I never used ED much, so I'm not sure where credit is due.

SDPringle said...

I remember the original Euphoria editor had parenthesis of different colors. Matching parenthesis would be the same color, the outer layer had black the next had some other color, and so on.

This might require a custom lexer, which I haven't looked into yet. For now I'm using the Lua lexer since it seems to match the right parts for coloring Euphoria syntax.

new topic     » goto parent     » topic index » view message » categorize

8. Re: WEE auto-complete

SDPringle said...

I want you to know that I opened this and checked out the sources of EUPHORIA with it under Wine. Neat stuff I love the auto-complete feature. It's like watching an old favorite movie.

I remember the original Euphoria editor had parenthesis of different colors. Matching parenthesis would be the same color, the outer layer had black the next had some other color, and so on.

SD Pringle

Likewise, I have been playing with WEE-012 under Wine and it is very impressive!

You are on a role, Pete! smile ~ Ken

new topic     » goto parent     » topic index » view message » categorize

9. Re: WEE auto-complete

K_D_R said...

Likewise, I have been playing with WEE-012 under Wine and it is very impressive!

You are on a role, Pete! smile ~ Ken

Thanks, Ken. I appreciate it. I want to do a native Linux version, but my development machine is 64-bit and I'm struggling to build the latest Euphoria from source. Is there a howto that explains step-by-step how to build 64-bit Euphoria? Or better yet, could someone build 64-bit Linux Eubins and post them somewhere?

new topic     » goto parent     » topic index » view message » categorize

10. Re: WEE auto-complete

PeteE said...

Thanks, Ken. I appreciate it. I want to do a native Linux version, but my development machine is 64-bit and I'm struggling to build the latest Euphoria from source. Is there a howto that explains step-by-step how to build 64-bit Euphoria? Or better yet, could someone build 64-bit Linux Eubins and post them somewhere?

I just had the same problem the other day.

http://openeuphoria.org/forum/126399.wc?last_id=126406

cargoan said...

You can download [4.1 eubins] here: http://openeuphoria.org/eubins/linux/4.1.0/64-bit/

-Greg

new topic     » goto parent     » topic index » view message » categorize

11. Re: WEE auto-complete

PeteE said...

Alright, got the auto expand working with if, while, for, loop and subroutine declarations.

When I type, for instance, "for<space>" and it auto-completes the structure, is there a key I can use (TAB would be nice) to move from spot to spot?

for x[tab] = 1[tab] to 10[tab] do 
   -- last tab comes here 
end for 
new topic     » goto parent     » topic index » view message » categorize

12. Re: WEE auto-complete

PeteE said...

Thanks, Ken. I appreciate it. I want to do a native Linux version, but my development machine is 64-bit and I'm struggling to build the latest Euphoria from source. Is there a howto that explains step-by-step how to build 64-bit Euphoria? Or better yet, could someone build 64-bit Linux Eubins and post them somewhere?

Pete,

I have been using Euphoria 4.1 Beta under 64-bit Linux. Downloading and building the binaries was a relatively painless process. First, Download the *tar.gz file:

http://sourceforge.net/projects/rapideuphoria/files/Euphoria/4.1.0/euphoria-4.1.0-Linux-ix86-64.tar.gz/download

Then extract the files to your root directory - I used xarchiver, but you can extract the files from the command line of any terminal with:

tar -xzv -f euphoria-4.1.0-Linux86-64.tar.gz

Actually, I think the file I have linked includes the binaries, as well as the source code. You will need to edit the eu.cfg files - and your bash .profile file. This is what my .profile looks like under Ubuntu Linux:

# ~/.profile: executed by the command interpreter for login shells. 
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login 
# exists. 
# see /usr/share/doc/bash/examples/startup-files for examples. 
# the files are located in the bash-doc package. 
 
# the default umask is set in /etc/profile; for setting the umask 
# for ssh logins, install and configure the libpam-umask package. 
#umask 022 
 
# if running bash 
if [ -n "$BASH_VERSION" ]; then 
    # include .bashrc if it exists 
    if [ -f "$HOME/.bashrc" ]; then 
    . "$HOME/.bashrc" 
    fi 
fi 
 
# set PATH so it includes user's private bin if it exists 
if [ -d "$HOME/bin" ] ; then 
      PATH="$HOME/bin:$PATH" 
fi 
 
PATH="$HOME/euphoria/bin:$HOME/MENU:$PATH" 
EUINC="$HOME/euphoria/include" 
EUDIR="$HOME/euphoria" 
export PATH EUINC EUDIR 

S.D. Pringle came up with a neat work around for several of the environment variables which might come in handy:

public function eudir() 
    sequence eudirectory 
    eudirectory = locate_file( eui, getenv("PATH") ) 
    eudirectory = eudirectory[1..length(eudirectory)-(length(eui)+4)] 
     
    -- returns /home/kenneth/euphoria/  -- note the trailing slash 
    return eudirectory 
end function 
 
public constant EUDIR   =  eudir() 
public constant EUINC   =  EUDIR & "include" 
public constant EUBIN   =  EUDIR & "bin" 
public constant EUDOCS  =  EUDIR & "docs" & SLASH & "html" 
public constant EUDEMO  =  EUDIR & "demo" 

I hope this helps.

Ken

new topic     » goto parent     » topic index » view message » categorize

13. Re: WEE auto-complete

Thanks Greg and Ken, for the useful information. I finally got it to build, the problem was my fault: I had an alias set to 32-bit Euphoria eui, and the build wasn't picking up the 64-bit Euphoria in my path.

Apologies for dragging the thread off-topic.

new topic     » goto parent     » topic index » view message » categorize

14. Re: WEE auto-complete

Just got the latest version.

It looks great!

Thanks, Pete!

- David

new topic     » goto parent     » topic index » view message » categorize

15. Re: WEE auto-complete

I've pushed version 0.13 to the repo, or you can use the updater to get the latest files.

The calltip popup will now appear when typing '(' after a function name, and highlight the argument you are typing in. The parser is used to count the arguments, so it can correctly handle commas in strings, sequence literals, and nested function calls. It might mess up if you have syntax errors though.

The include file is also inserted near the top of the file after selecting an autocomplete with an include. It will try to insert after comments, or after another group of include statements.

I also made it autocomplete closing [ ( { ' " characters, and you can type over the added character as long as you haven't used arrow keys to move the cursor. I got this idea from Xcode.

new topic     » goto parent     » topic index » view message » categorize

16. Re: WEE auto-complete

Great work! PeteE, i created a wiki page for WEE and added to the list of Projects based on Euphoria. Would you mind adding some content to it?

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu