Review Request: When declaration not found, look at the similar ones

Aleix Pol aleixpol at kde.org
Wed Aug 12 14:19:59 UTC 2009



> On 2009-08-12 13:20:54, David Nolden wrote:
> > The problem is that this only covers a very specific case: It only correctly searches for the name when doing a class-member access, and only searches within the topmost class of a class hierarchy(no base classes). It should either cover all (or at least most) cases, or it shouldn't be there at all, as it is frustrating if something doesn't work on many seeminly random occassions.
> > 
> > I was planning to change to work in all cases based on the code-completion engine on the hackathon, but didn't come to it. Actually it's not such a big thing: Just create a code-completion context in the specific position, and compare the names of its items using the levenshtein distance.

I don't think having a limited scope is that much of a problem since if we're using something too far away we just won't get the hint.

Even if I like that feature I won't fight to get it in. It was just a one-night patch anyway.


- Aleix


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/613/#review2004
-----------------------------------------------------------


On 2009-04-18 20:13:08, Aleix Pol wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/613/
> -----------------------------------------------------------
> 
> (Updated 2009-04-18 20:13:08)
> 
> 
> Review request for KDevelop.
> 
> 
> Summary
> -------
> 
> Haven't you ever mistyped a class member and got an error message for that?
> Well, this patch tries to help the user by searching similar names and giving a hint.
> 
> It also works for variables.
> 
> Hope you like it :)
> 
> The code used to get the difference was got from the wikipedia (was pseudocode i translated it into c++).
> 
> 
> Diffs
> -----
> 
>   trunk/KDE/kdevelop/languages/cpp/cppduchain/missingdeclarationassistant.cpp 955802 
> 
> Diff: http://reviewboard.kde.org/r/613/diff
> 
> 
> Testing
> -------
> 
> class MyClass
> {
> 	public:
> 		void aaa();
> };
> 
> int main()
> {
> 	MyClass c;
> 	c.aab(); //Here aaa is proposed
> 	
> 	int xxx;
> 	int k=xxy; //Here xxx is proposed
> 
> 	return 0;
> }
> 
> 
> Thanks,
> 
> Aleix
> 
>





More information about the KDevelop-devel mailing list