Review Request 117922: Preliminary implementation of adjust signature helper

David Stevens dgedstevens at gmail.com
Sun May 4 14:08:53 UTC 2014



> On May 2, 2014, 10:01 p.m., Kevin Funk wrote:
> > codegen/clangsignatureassistant.cpp, line 111
> > <https://git.reviewboard.kde.org/r/117922/diff/2/?file=271170#file271170line111>
> >
> >     Why is that function needed? Isn't clang_getCursorExtend returning the correct range?
> >     
> >     Sorry if I'm missing something.
> 
> David Stevens wrote:
>     For a function declaration, that works. But for a function definition, the cursor extend includes the function body. I agree that this isn't a very nice way of doing this, but I couldn't think of anything else that works.
> 
> Kevin Funk wrote:
>     Ah. I see.
>     
>     I just thought a bit about this. For a function definition 'clang-parser -a' yields the following:
>     
>     test.cpp:
>     
>     class Foo { void foo(int a) const; };
>     void Foo::foo(int a) const
>     {
>     }
>     
>     clang-parser -a test.cpp:
>     
>     (...)
>     decl: "void (int) const foo(int) " of kind CXXMethod (21) in /home/krf/test.cpp@[(2,1),(4,2)]
>       use: "Foo class Foo " of kind TypeRef (43) in /home/krf/test.cpp@[(2,6),(2,9)]
>       decl: "int a " of kind ParmDecl (10) in /home/krf/test.cpp@[(2,15),(2,20)]
>       "" of kind CompoundStmt (202) in /home/krf/test.cpp@[(3,1),(4,2)]
>     
>     Now, getting the cursor extent of the function definition sig is the range [CXXMethod.start, 
>     CompoundStmt.start[. Not sure if we can use this here, though.

I don't think that method would help. If we don't want to affect the whitespace, I think we would still have to search backwards from the start of the compound statement.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117922/#review57161
-----------------------------------------------------------


On May 3, 2014, 1:31 a.m., David Stevens wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117922/
> -----------------------------------------------------------
> 
> (Updated May 3, 2014, 1:31 a.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-clang
> 
> 
> Description
> -------
> 
> This is a preliminary implementation of the adjust signature helper. It works fairly well under normal usage, but it runs into problems if the user starts trying to use it at a high frequency. There are some rather fundamental issues both due to the different information organization (files vs translation units) and due to the discrepencies between what KDevelop has in the text editor and what clang has in the translation units. Hopefully I can get some feedback on the implementation.
> 
> 
> Diffs
> -----
> 
>   clangsupport.h 1316f88 
>   clangsupport.cpp 5e3f464 
>   codecompletion/completionhelper.cpp dfaf6b3 
>   codegen/CMakeLists.txt 0b913bd 
>   codegen/clangsignatureassistant.h PRE-CREATION 
>   codegen/clangsignatureassistant.cpp PRE-CREATION 
>   codegen/codeassistant.h PRE-CREATION 
>   codegen/codeassistant.cpp PRE-CREATION 
>   duchain/clangtypes.h c7293a9 
>   duchain/clangtypes.cpp 11760c8 
>   tests/CMakeLists.txt c2fd36d 
>   util/clangutils.h 3516821 
>   util/clangutils.cpp a74017c 
> 
> Diff: https://git.reviewboard.kde.org/r/117922/diff/
> 
> 
> Testing
> -------
> 
> Manual. Any unit tests would be deeply tied into the GUI, so I'm not sure how to go about writing those. The old c++ plugin unfortunately doesn't have any tests to work off of.
> 
> 
> Thanks,
> 
> David Stevens
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140504/47e2bb77/attachment.html>


More information about the KDevelop-devel mailing list