User: Guest


Please use the
Bug Report Form
if you think you found a software defect.

Use the Contact Form
to send a personal message to Wolfgang.

RSS Feed RSS Feed

Other boards:
Raduga (English)
Song Requester

Suggestion on Text-Autocomplete

Posted on: SuperEdi

From Message


2004-05-18 08:47:49

Suggestion on Text-Autocomplete

Hy, I got a small suggestion for further releases :)
I've to say I use SuperEdi a very long time now (iirc since v1.1) and I love it, but I'm missing one thing, a customizable text auto complete function like syntax color. I'm working on a shell replacment project as Themer and sometimes it's annoying to search through all the module docs to find the right syntax, so it would be fantastic if I can paste the whole settings in a file and I can use it for standart auto complete (ctrl+space).

thanks for reading this :)

Wolfgang Loch

2004-05-18 18:54:46

Re: Suggestion on Text-Autocomplete

Do you already have a configuration file for auto-completion which I could use as an example?


2004-05-18 20:29:38

Re: Suggestion on Text-Autocomplete

no, I don't have for now, but it's no problem to create, if I know how you want this file.
I think it's much moe better if the "settings" (doesn't matter if perl, php, html or what else) have their own line, but if it's not possible for you, no problem, tell me how you want me to do :)

Wolfgang Loch

2004-05-18 21:12:46

Re: Suggestion on Text-Autocomplete

Maybe it doesn't need an extra configuration file. SuperEdi could just use the keywords that are defined in the syntax definition file (*.syn). For example, if you edit a .vbs file it will use the keywords defined in VBScript.syn.

Now when you enter "enump{ctrl}{space}" it will expand this string to "EnumPrinterConnections". Or if there are multiple matching keywords, it will display a select list to choose from. Do you think this could work?


2004-05-19 07:56:06

Re: Suggestion on Text-Autocomplete

it would work great I think and it's a nice idea to use the existing syn files :D


2004-05-19 08:55:01

Re: Suggestion on Text-Autocomplete

ahh... another thing, if you took this as auto complete, will it be possible to set a new [Keyword int] that has non colors?

ok I'll try again:
As I said, I Theme for a Shell replacemnt, so there are many modules with damn many settings. also there are so called !bang commands. I Customized SuperEdi that charStart a ! are green. but what will happen if I make a new Keyword and set these bangs to color black?

so could it be possible to set an escape code in the *.col file like:
that SuperEdi uses the allready set chars, strings, escape, codes or what else...

:) sorry for bugging you :)

Wolfgang Loch

2004-05-19 19:36:35

Re: Suggestion on Text-Autocomplete

Sorry, but I don't fully understand what you're trying to say. Maybe I will understand it better if you send me your .col and .syn file and some example theme files.

I'm still investigating the requirements for an auto completion feature. I'm sure it will never be as sophisticated as JBuilder or Visual Studio, which generate suggestions for auto-completion based on parsed source code. I try to figure out whether something that's less sophisticated could still be useful.


2004-05-20 08:32:22

Re: Suggestion on Text-Autocomplete

ach verdammt *lol* ich hab gerade gesehen das ihr aus deutschland kommt, dann versuche ich es mal so :)

also es gibt ja in der *.col datei
[Keyword int]

und es ist ja nun so, das man diese color angeben muß/sollte, da diese [Keywords int] die dort beschrieben sind dann auch coloriert werden. nun verhällt es sich aber so, das ich keywörter habe (oder noch mache wenn das autocomplete fertiggestellt sein sollte) die die regeln der anderen [keywords] oder escape sequenzen nutzt. als beispiel nutze ich:
CharStart = !
CharEnd =
CharEsc =
was bedeutet, das die ganze zeile nach dem ! grün wird. dennoch bräuchte ich in eine eigene Keyword klasse um meine AutoComplete Settings einzufügen:
wenn ich diese nun unter [keywords 7] mit einer color 00000 versehe, ist dann nicht genau der teil auch schwarz und übergeht den CharStart=! ??
oder ist CharStart aussagekräftiger als keywords?
das muß ich gestehen habe ich noch nicht versucht, aber wenn dem so ist, müßte es in der *.col eine interne escape sequenz geben die eben nichts macht, das heißt nicht coloriert, sondern den text ausgibt, aber die vorherigen regeln verwendet (bsp: CharStart). das meinte ich mit TextColor=.none ... war auch nur als ein Beispiel gedacht, vielleicht könnte man auch in der *.col nur eine neue Klasse errichten die keine colorierungs regeln nutzt wie... erm.. [AutoComplete].

ich kann die datei zwar schicken, aber es nutzt nicht viel, da ich bisher nur "wichitige" sachen drin habe für meine zwecke, sachen wie, If, Else, ElseIf, $var$, true, false.... ich habe noch nicht von allen Existierenden modulen alle settings herausgeschrieben und in eine eigene klasse gesetzt :(

So, ich hoffe das es nun verständlicher ist was ich meinte :D, ansonsten mach ich mal ein wenig anschauungsmaterial und lasse es per email zukommen (problem ist nur, ich hab sie nicht gefunden, deshalb schreibe ich nochmals in das forum :))

und, es muß ja auch nicht so sein wie bei msvc, warum auch, ein einfaches reicht, denke ich, vollkommen.
Ich finde es ja schon tierisch nett das vorschläge überhaupt angenommen werden :) vielen dank nochmal :)

und achja... fällt mir gerade so ein, es gibt bei codeproject ganz nette klassen für das autocomplete :)


2004-10-14 20:15:35

Re: Suggestion on Text-Autocomplete

I just downloaded Superedi and I love the configurability of the syntax highlighting! I have already made a JScript and Updated VBScript syn and color files in one day! I would love to see autocomplete! A suggestion I have would be to Restructure the syntax file to define objects. Have [Object] sections and put all of the members under it. Then have [sub object] sections and relate them through the name. Example:

This would name:

This would make the color file more complicated but not much more complicated, just use more sections.

This way you associate all of the subobjects to their parent object. Then you could make the drop down appear as soon as it has a few letters.

My other suggestion which would probably be better would be to use an XML file for the autocomplete functionality. XML is a much more efficient way to define an Object with properties, methods, and child objects. Create an autocomplete XML file for object libraries and have a multi selection text box in the options to be able to attach several 'autocomplete libraries' to one file type. A good example is VBScript files, you could have language autocomplete from the syn file and an XML 'library' for the WScript object, another for the FileSystemObject, another for ADSI objects, etc all attached to the file type. That way users can create their own XML libraries of the objects they use.

I know its not exactly simple to add this feature but if you could you would have a text editor every bit as good as the commercial ones.

Wolfgang Loch

2004-10-19 16:18:01

Re: Suggestion on Text-Autocomplete

There is an experimental form of auto-completion built into SuperEdi 3.4.2. When you press Ctrl+Space SuperEdi tries to complete the word on the left side of the cursor using words that appear somewhere in the rest of the text. If there is exactly one match, the word is completed immediately. If there are multiple matches it displays a menu to choose from.

Plese tell me if you find the current implementation useful or not.

If you want to improve the generated suggestions, you can implement a C++ function with this interface:

void CSuperEdiDoc::SuggestAutoComplete(
LPCTSTR leftWord, // the word left of the cursor position
LPCTSTR wholeWord, // the complete word around the cursor position
CStringList& suggestions // fill this list with suggestions

If I get good suggestions, I will add them to the next version of SuperEdi.

Post a reply to this message: