<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/117922/">https://git.reviewboard.kde.org/r/117922/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On May 2nd, 2014, 10:01 p.m. UTC, <b>Kevin Funk</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/117922/diff/2/?file=271170#file271170line111" style="color: black; font-weight: bold; text-decoration: underline;">codegen/clangsignatureassistant.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">111</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="n">SimpleCursor</span> <span class="n">findDeclEnd</span><span class="p">(</span><span class="n">KTextEditor</span><span class="o">::</span><span class="n">Document</span> <span class="o">*</span><span class="n">targetDoc</span><span class="p">,</span> <span class="n">CXCursor</span> <span class="n">cursor</span><span class="p">)</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Why is that function needed? Isn't clang_getCursorExtend returning the correct range?

Sorry if I'm missing something.</pre>
 </blockquote>



 <p>On May 3rd, 2014, 12:16 a.m. UTC, <b>David Stevens</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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.</pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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. </pre>
<br />




<p>- Kevin</p>


<br />
<p>On May 3rd, 2014, 1:31 a.m. UTC, David Stevens wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for KDevelop.</div>
<div>By David Stevens.</div>


<p style="color: grey;"><i>Updated May 3, 2014, 1:31 a.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdev-clang
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>clangsupport.h <span style="color: grey">(1316f88)</span></li>

 <li>clangsupport.cpp <span style="color: grey">(5e3f464)</span></li>

 <li>codecompletion/completionhelper.cpp <span style="color: grey">(dfaf6b3)</span></li>

 <li>codegen/CMakeLists.txt <span style="color: grey">(0b913bd)</span></li>

 <li>codegen/clangsignatureassistant.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>codegen/clangsignatureassistant.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>codegen/codeassistant.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>codegen/codeassistant.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>duchain/clangtypes.h <span style="color: grey">(c7293a9)</span></li>

 <li>duchain/clangtypes.cpp <span style="color: grey">(11760c8)</span></li>

 <li>tests/CMakeLists.txt <span style="color: grey">(c2fd36d)</span></li>

 <li>util/clangutils.h <span style="color: grey">(3516821)</span></li>

 <li>util/clangutils.cpp <span style="color: grey">(a74017c)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/117922/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>