Editor: Autocomplete for variables

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
THCM
Enthusiast
Enthusiast
Posts: 276
Joined: Fri Apr 25, 2003 5:06 pm
Location: Gummersbach - Germany
Contact:

Editor: Autocomplete for variables

Post by THCM »

Would be nice to have this included. At least all variables ending with .b .w .l .f etc. I don't want to use Deftype or Global to use autocompletion.
The Human Code Machine / Masters' Design Group
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

AutoComplete

Post by Michael Vogel »

Yes, agree to that!

There is an option (in preferences/editor/autocomplete/displayeditems) to include variables, but it does not work!

I do not understand, why absolutely nothing happens, when "autocomplete" is enabled, but "automatically popup" is disabled?!

I'd like to have the following two things:

* "silent autocomplete": no popup, but automatically change to the first matching word of a list when pressing (shift) space after some characters

* "auto case": the first occurence of a variable defines how it will be seen in the whole source code - BigVar.w=1 means BigVar is everytime BigVar and not bigvar or bIgvaR
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: AutoComplete

Post by DarkDragon »

Michael Vogel wrote:I do not understand, why absolutely nothing happens, when "autocomplete" is enabled, but "automatically popup" is disabled?!
My Shortcut: Ctrl+Space. That's normal in many IDEs, including eclipse and I like it like that.
bye,
Daniel
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

This have been wished twice already :) Once for an earlier version of PB, and again for PB4 :) Reference link found @ viewtopic.php?t=18723
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Autocomplete for variables (and AutoCase)

Post by Michael Vogel »

Hi

Autocomplete would help also to avoid typos! A AutoCase function would be also great to see problems very fast, e.g. you enter...

myvariable

...and while you are typing it changes to, let's say...

MyVariable

...you just feel on the right way...
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Autocomplete for variables (and AutoCase)

Post by PB »

If you have Global MyVariable and then type myv and hit Tab, you do get MyVariable.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Uhm sorry, but a good coding style always has lower cased variables.
bye,
Daniel
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

DarkDragon wrote:Uhm sorry, but a good coding style always has lower cased variables.
definitely not!
Good programmers don't comment their code. It was hard to write, should be hard to read.
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

traumatic wrote:
DarkDragon wrote:Uhm sorry, but a good coding style always has lower cased variables.
definitely not!
I know, but I just wanted to post the opinion of my teacher ;) .
bye,
Daniel
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

AutoComplete variants...

Post by Michael Vogel »

Hi, just, if you like to do your own AutoComplete, you can do this with the freeware AutoHotkey and a script I wrote:

viewtopic.php?p=128768#128768

Definitely not perfect, but maybe useful to change the behaviour of the inernal AutoComplete

Michael
Jan Vooijs
Enthusiast
Enthusiast
Posts: 196
Joined: Tue Sep 30, 2003 4:32 pm
Location: The Netherlands

Post by Jan Vooijs »

DarkDragon wrote:
traumatic wrote:
DarkDragon wrote:Uhm sorry, but a good coding style always has lower cased variables.
definitely not!
I know, but I just wanted to post the opinion of my teacher ;) .
Find a beter teacher yours is off his bonkers (or as the americans say: "He is missing one of his six-pack")

Totaly outmode, so yesteryears dear!!!

Variables MUST have mixedcase like MyVar and NOT myvar, bonkers he is...

[But on topic]
AutoComplete for variables is almost a must!! And Case change offcourse!!
[/But on topic]

Jan V.
Life goes to Fast, Enjoy!!

PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!

AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
Jan Vooijs
Enthusiast
Enthusiast
Posts: 196
Joined: Tue Sep 30, 2003 4:32 pm
Location: The Netherlands

Re: Autocomplete for variables (and AutoCase)

Post by Jan Vooijs »

PB wrote:If you have Global MyVariable and then type myv and hit Tab, you do get MyVariable.
In what version of PB is that?? PB4b4 does not!! Or is it a switch somewhere???

Thanks,

Jan V.
Life goes to Fast, Enjoy!!

PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!

AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

I am wondering this myself, for I know for a fact that does not exist in PB4B3. And since his post was out before Beta 4 came out ... maybe Beta 4 supports this.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Autocomplete for variables (and AutoCase)

Post by PB »

>> If you have Global MyVariable and then type myv and hit Tab,
>> you do get MyVariable.
>
> In what version of PB is that?

Since v3.94. :)

> is it a switch somewhere?

Preferences -> AutoComplete -> Displayed Items -> Variables of the current source.

> I know for a fact that does not exist in PB4B3

Hehe, you just need to explore the Preferences more. ;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Autocomplete for variables (and AutoCase)

Post by Michael Vogel »

PB wrote:>> If you have Global MyVariable and then type myv and hit Tab,
>> you do get MyVariable.

Preferences -> AutoComplete -> Displayed Items -> Variables of the current source.

Hehe, you just need to explore the Preferences more. ;)
Does work only with the time consuming popup menu (which sometimes offers a lot of alternatives also), without activating the popup also in the preferences it does not work (honestly)
Post Reply