<table><tr><td style="">brauch added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D6316" rel="noreferrer">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>After some lookup I found that there are 2 declarations added somehow with same qualifiedIdentifier.<br />
 Also, looks like it my added test visitTypeSpec is somehow called twice thus in first call declaration is present once and it doesn't  contain internal context and in second call there is 2 declarations where first one still doesn't have internal context and second have one.</p></blockquote>

<p>I will have to look closer later, but typically the builders run twice per pass, and in the second pass the declaration created by the first pass should be *re-used*, i.e. openDeclaration() figures out which declaration was created by the first pass and re-uses that. It uses the scope identifier and the range to do that lookup. It might be that this fails. It definitely fails in some cases -- that is why your completion items sometimes disappear while the popup is visible.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R59 KDevelop Go</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D6316" rel="noreferrer">https://phabricator.kde.org/D6316</a></div></div><br /><div><strong>To: </strong>ematirov, apol, brauch<br /><strong>Cc: </strong>kdevelop-devel, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger<br /></div>