<table><tr><td style="">ematirov created this revision.<br />ematirov added a project: KDevelop.<br />Restricted Application added a subscriber: kdevelop-devel.
</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/D6272" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Consider a following code:</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">package main

import "fmt"

func passFuncAsArgument(a interface{}) interface{} { return a }

func main() {
    a := func(test int) (int) { return test } // Declaring a local function literal  (1)
    func(test int) (int)  { return test } (5) // Calling a anonymous function  (2)
    passFuncAsArgument(func(test int) (int) {return test }) // Passing anonymous function as argument  (3)
    fmt.Println(a(5))
}</pre></div>

<p>Before this patch only in (1) case a function argument will be added as declaration.<br />
This patch extends that to (2) and (3) cases.</p>

<p>This has impact on semantic highlighting for example:<br />
Before<br />
<a href="https://phabricator.kde.org/F3787414" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">F3787414: function_arguments_before.png</a><br />
After<br />
<a href="https://phabricator.kde.org/F3787421" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">F3787421: function_arguments_after.png</a></p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Tests were added and are passing fine.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R59 KDevelop Go</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D6272" rel="noreferrer">https://phabricator.kde.org/D6272</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>duchain/builders/declarationbuilder.cpp<br />
duchain/builders/declarationbuilder.h<br />
duchain/tests/testduchain.cpp<br />
duchain/tests/testduchain.h</div></div></div><br /><div><strong>To: </strong>ematirov, brauch, apol<br /><strong>Cc: </strong>kdevelop-devel, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger<br /></div>