Autocompletion
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Autocompletion
Hey there, vibrant and helpful community
I am thinking about buying community +
I have a question about Autocompletion :
Does it show you the identifiers you declared/used above or before in the stack ?
If i remember well, visual studio code did it.
I am thinking about buying community +
I have a question about Autocompletion :
Does it show you the identifiers you declared/used above or before in the stack ?
If i remember well, visual studio code did it.
-
- VIP Livecode Opensource Backer
- Posts: 9646
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Autocompletion
Hi.
Do you mean the "Options" submenu in the "Edit" menu, while the SE is in front?
And by "identifiers", do you mean variables?
Craig
Do you mean the "Options" submenu in the "Edit" menu, while the SE is in front?
And by "identifiers", do you mean variables?
Craig
-
- Livecode Opensource Backer
- Posts: 9358
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Autocompletion
I suppose Autocompletion may be a good thing.
Personally I have turned it off in all the Apps on both my Android phone and my Android tablet,
and anywhere else: it is almost as bad as spelling correxion that forces me to use either American
spelling or "British" English spelling.
Also those double speech marks that keep doubling all over the place just stick in my
craw.
Personally I have turned it off in all the Apps on both my Android phone and my Android tablet,
and anywhere else: it is almost as bad as spelling correxion that forces me to use either American
spelling or "British" English spelling.
Also those double speech marks that keep doubling all over the place just stick in my
craw.
-
- VIP Livecode Opensource Backer
- Posts: 9646
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Autocompletion
Is "autoCompletion" really the right word? LC has automatic SE aids, like "bracket completion", and "control structure completion", all in that "Options" subMenu, but gilgmi, is that what you meant?
Craig
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9646
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Autocompletion
And I am much with Richmond here. I only use "Live Errors", "Control structure completion" and "autoFormat".
NEVER the others.
Craig
NEVER the others.
Craig
-
- Livecode Opensource Backer
- Posts: 9358
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Autocompletion
Be careful, you may get blacklisted.I am much with Richmond here
Re: Autocompletion
Hello !
Sorry for keeping you waiting because i thought i was Email notified, and was not.
If it is a source of trouble, i will double check, but about identifiers i meant variable names yes, and command and function names.
IMHO, this is were it becomes really handy.
Sorry for keeping you waiting because i thought i was Email notified, and was not.
If it is a source of trouble, i will double check, but about identifiers i meant variable names yes, and command and function names.
IMHO, this is were it becomes really handy.
-
- VIP Livecode Opensource Backer
- Posts: 9646
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Autocompletion
Hi.
So if you check "variable checking"in the Option menu wihile the SE is in front, or select "strict compilation mode" in the SE preferences, then if you do NOT declare your variables, the SE will not let you proceed.
But that is still different from autoCompletion, or at least what I think that word actually means.
Craig
So if you check "variable checking"in the Option menu wihile the SE is in front, or select "strict compilation mode" in the SE preferences, then if you do NOT declare your variables, the SE will not let you proceed.
But that is still different from autoCompletion, or at least what I think that word actually means.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Autocompletion
I don't use autocomplete either, but if I remember right it did complete variable names if they were used in the same handler. I'm not sure if it also completes variables anywhere in the same script.
Command and function handler declarations are automatically completed with the "end" statement, also control structures and paired characters like parentheses, quotation marks, brackets, etc. You can disable any of these features if you don't want them.
Command and function handler declarations are automatically completed with the "end" statement, also control structures and paired characters like parentheses, quotation marks, brackets, etc. You can disable any of these features if you don't want them.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Autocompletion
Thank you.
I was wondering for variable autocompletion, if possible across handlers, and anywhere in the same script.
And also command and function names.
Thank you jacque, i noticed the very handy 'pairing' of brackets and etc and control structures.
Not worth the price, so.
I was wondering for variable autocompletion, if possible across handlers, and anywhere in the same script.
And also command and function names.
Thank you jacque, i noticed the very handy 'pairing' of brackets and etc and control structures.
Not worth the price, so.
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Autocompletion
I just tried it. Auto-completion depends on the scope of the variable. That means that global variables and script-local variables complete anywhere if they are declared in the script. Variables that occur only within a handler will auto-complete within that handler, but are removed from memory when the handler completes.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Autocompletion
Besides, that is it good practice, even "best practice", to declare all variables, the autocompletion so much goes in the way for a fast typist (such as me) so that I turn it off my default. I can write faster than I can think...
But I have another question regarding autocomplete: I want to autocomplete tags (labels) that users enter for a given subject. Once completed, they form a group that contains this one phrase or word and receive colors and are in a box. They appear usually in one row horizontally, eventually create new rows. Each of them can be clicked away and the list can be reordered through drag and drop by the user. Maybe someone has already done something like this? (So far, I am using a type-forward list field, but it is not such a good solution in this specific case).
Roland
But I have another question regarding autocomplete: I want to autocomplete tags (labels) that users enter for a given subject. Once completed, they form a group that contains this one phrase or word and receive colors and are in a box. They appear usually in one row horizontally, eventually create new rows. Each of them can be clicked away and the list can be reordered through drag and drop by the user. Maybe someone has already done something like this? (So far, I am using a type-forward list field, but it is not such a good solution in this specific case).
Roland
-
- VIP Livecode Opensource Backer
- Posts: 9646
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Autocompletion
Hi.
It sounds like what you want is far outside the capabilities of any type of built-in autoComplete.
But it can be scripted easily. Please give an example of some initial text, and the resultant text your want after the user has gotten hold of it.
The drag and drop gadget you describe has been done in several ways by several people here. I can give you an example of the way I have done it, but let us do the tag/label thing first.
Craig
It sounds like what you want is far outside the capabilities of any type of built-in autoComplete.
But it can be scripted easily. Please give an example of some initial text, and the resultant text your want after the user has gotten hold of it.
The drag and drop gadget you describe has been done in several ways by several people here. I can give you an example of the way I have done it, but let us do the tag/label thing first.
Craig
Re: Autocompletion
@: dunbarx on 29 Aug 2021, 23:27
Thank you dubarx
Well, the list is for example "LiveCode Builder, LIveCode Script, Private, Business school".
These are items, and the items will be tags. If the tag exists, it is autocompleted, otherwise it is added to the tag list.
So, users would enter words and phrases. It is easy to separate the items as long as there is a comma delimiter. But I currently do not have the handler to autocomplete when the user start typing.
Items that have been identified (new or existing) will be a group with a checkbox that allows the user to click them away. Deletion is just another variant, desired, or not. Items appear one after the other. Also not a problem. This is clear.
But how to make autocomplete work nicely without obstructing the work flow of the user while typing... ? So, let the user start when more than 3 characters were typed... rawkeydown, closefield, backspace, ... find one or more phrases that would autocomplete the word/phrase and let the user select without obstructing...
I can work on it, but if there is a slick solution already, why do the work twice?
Thank you dubarx
Well, the list is for example "LiveCode Builder, LIveCode Script, Private, Business school".
These are items, and the items will be tags. If the tag exists, it is autocompleted, otherwise it is added to the tag list.
So, users would enter words and phrases. It is easy to separate the items as long as there is a comma delimiter. But I currently do not have the handler to autocomplete when the user start typing.
Items that have been identified (new or existing) will be a group with a checkbox that allows the user to click them away. Deletion is just another variant, desired, or not. Items appear one after the other. Also not a problem. This is clear.
But how to make autocomplete work nicely without obstructing the work flow of the user while typing... ? So, let the user start when more than 3 characters were typed... rawkeydown, closefield, backspace, ... find one or more phrases that would autocomplete the word/phrase and let the user select without obstructing...
I can work on it, but if there is a slick solution already, why do the work twice?
-
- VIP Livecode Opensource Backer
- Posts: 9646
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Autocompletion
Fun, fun fun.
Here are two experiments I made that autoComplete text. Both work. A textChanged handler in the yellow fields does the work. Click on one of the buttons, and start typing in the yellow field that gains focus. Any word in the "source" field above that field will autoComplete at three chars.
The problem is when a compound word lives within an item. To be able to discriminate between, say, "LiveCode builder" and "LiveCode Script", using only a few characters as a seed is the issue. You can always change the "3' in the "compound" "textChanged" handler to "10". But that makes general usage far less valuable.
I can think of several kludges that will solve this, perhaps by temporarily combining all compound words within each item into a single word and then restoring the space(s). Want to tackle that?
Craig
Here are two experiments I made that autoComplete text. Both work. A textChanged handler in the yellow fields does the work. Click on one of the buttons, and start typing in the yellow field that gains focus. Any word in the "source" field above that field will autoComplete at three chars.
The problem is when a compound word lives within an item. To be able to discriminate between, say, "LiveCode builder" and "LiveCode Script", using only a few characters as a seed is the issue. You can always change the "3' in the "compound" "textChanged" handler to "10". But that makes general usage far less valuable.
I can think of several kludges that will solve this, perhaps by temporarily combining all compound words within each item into a single word and then restoring the space(s). Want to tackle that?
Craig