GREAT NEWS: Autocomplete working!!!

Discussion Forums discussion GREAT NEWS: Autocomplete working!!!

This topic contains 0 voices and has 11 replies.

Viewing 12 posts - 1 through 12 (of 12 total)
Author Posts
Author Posts
October 28, 2006 at 1:31 am #135

webmailusr-msn
Member

Hello Simon:

I made autocomplete work in PN!

I just added a couple of lines at:

textview.cpp

childfrm.cpp

jumpview.cpp

And appended some borrowed and adapted coded to:

ScintillaImpl.h

ScintillaImpl.cpp

It autocompletes with a list of keywords taken from the .schema file and with all tags you put in tags navigator. Also calltips are enabled. Still need to fix some details and bugs but it would be a major jump from v.2.0.7 to, maybe 2.1.0 !

If you want the files check your email!

Regards….

October 30, 2006 at 1:54 am #15170

webmailusr-msn
Member

I sent you a second email, with updated files. I hadn’t used the most recent version at svn, now I got them and also corrected some bugs for autocompletion.

Regards…

October 30, 2006 at 8:34 pm #15171

simon
Key Master

Thanks, I’ve got the e-mails and this looks good, I’m going to try merging the code now and have a better look at it. I really appreciate this and I’m sure the users will too!

October 31, 2006 at 11:34 am #15172

simon
Key Master

Ok, it looks pretty good. I think we need to think more about when autocomplete pops up. At the moment, it pops up as soon as I type the first letter, I found this quite annoying when writing code (especially with loop variables like i and j)!

I think maybe the best thing would be to post a build with this enabled and see what people think.

I’d also like to get the .api file functionality from SciTE in there.

October 31, 2006 at 8:49 pm #15173

webmailusr-msn
Member

Ok, Simon, I agree with the idea of posting a new build.

1) In fact, we can adjust the SCN_CHARADDED event, so the pop up is triggered only when at least 2 chars are in the current word, for example. But also I think the best idea is ask to the final users.

2) About Scite Api, what I don’t like is that it’s very limited, it only includes standard functions for C, php, and pl, but is missing win32, java and vb (and those are really big APIs). In the case of php and pl, there are frequent changes in the API, according to newer versions. C api is more stable but… now it’s deprecated (well, that’s what VC++ says about our loved fopen, strcmp… functions). So I don’t think it is a good idea. That’s why I only included keywords from the .scheme file and from CTags. But anyway, .api files are only lists of functions, so it’s not a problem adding them: after adding scheme keywords we can do:

CString ApiFileName(sch->GetName());

FILE* apifile=fopen(ApiFileName+”.api”,”r”);

while(line=readln(apifile))

{

AddSorting(m_KW, line)

}

fclose(apifile);

(Just improve AddSorting function: it currently doesn’t check if word is repeated)

3) Finally, I wonder if you checked out the differences between my files and yours, just to make sure I didn’t lose your most recent updates, and that you read some pending issues about the adaptation I made.

4) And also: I think ordering tags inside their owner classes is something important. I glanced the code, but didn’t dare to change it before you approved autocompleting.

Please let me know your oppinions. Thanks again.

October 31, 2006 at 9:15 pm #15174

simon
Key Master

2) For C and C++ you are right, but there are many languages like php that really benefit from the API file support (they have a limited size API that suits AutoComplete completely).

If I remember rightly the API files can contain parameter info and potentially a comment too?

3) Yes, I merged your changes using Beyond Compare to make sure nothing bad happened.

4) Completely agree, this definitely needs doing. If you want to look at it please feel free to go ahead.

October 31, 2006 at 10:28 pm #15175

webmailusr-msn
Member

About languages like php, well, if API is small, we can include it in .scheme file, like keywords-maybe we have to add a kind of parameter in the tag, so xml parser doesn’t split any parameter as a new keyword.

What we do need to add is in scheme files language specific information, like case sensitivity, comment and parameter delimiters and allowed characters in declarations.

As you can see in ScintillaImpl.cpp I just put default values, but I have access to that information through Scheme and SchemeDetails pointers. However, those classes don’t have that information available yet.

One more question: why did you put source in a svn and not in cvs?

October 31, 2006 at 10:39 pm #15176

simon
Key Master

Yes, more information needs to be included in the schemes as we add more advanced features.

The source is in svn and not cvs because I prefer subversion and also the Sourceforge svn repository is much more reliable than the cvs one.

November 1, 2006 at 7:06 am #15177

webmailusr-msn
Member

Humm, I was intrigued about sorting tags and I fixed it using recursivity.

Still has a little problem with java inner classes. They are properly displayed, but their names also appear inside in one of the inner classes. But it works in the other cases. Check your email for files…

November 2, 2006 at 11:48 pm #15178

webmailusr-msn
Member

Hey Simon!

I realized you have just posted some changes at the svn: However, You didn’t update the last jumpview.cpp/jumpview.h files, which fix the tags browser… didn’t you get the email or were they wrong?

November 3, 2006 at 9:18 am #15179

zennehoy
Member

I’m liking the AutoComplete concept a lot, but it still needs work ;)

Autocompleting 2-letter words is pretty useless (C: if, for; VHDL: is, in; etc…), and tends to mask longer words that would be interesting to AutoComplete.

Automatically inserting closing “braces” must definately be configurable to off. Also, try typing #include <stdio.h> in a C/C++ style… Does it think it’s XML?

How feasible would it be to use the AutoComplete extensions for including API information? E.g. typing “printf(” would display “const char *format, …”, similar to what MSVC does.

Keep up the good work!

Zen

November 3, 2006 at 11:48 am #15180

simon
Key Master

The API information is what we were discussing above with the .api files that SciTE uses. I think this would be a really good addition. I think autocomplete will need some configuration options because different users will find it useful in different ways – it also depends on the language I guess!

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.