<p>I was looking for autocomplete support that would be aware of all relevant Go packages (in GOPATH, in project and vendor'd); I played a bit with ctags but couldn't get anything out of it.</p>
<p>So here I am proposing to add autocomplete support through <a href="https://github.com/nsf/gocode">gocode</a> which is pretty much what other editors use (although I find gocode buggy itself, but that is another topic).</p>
<h2>General idea of this PR</h2>
<ul>
<li>we would need an option to use gocode, either enabled or disabled by default; possibly gocode port too in case you're running multiple gocode daemons</li>
<li>once this feature is enabled, the <code>autocomplete_scope</code> radically changes behavior and instead of using <code>tm_workspace_find_scope_members</code> it would rely on a gocode CLI call for each autocomplete resolution request (yes, pricey, but useful)</li>
<li>the gocode CLI call receives the current buffer text via stdin and the results are parsed into <code>TMTag</code> structures</li>
<li>once tags are generated the autocomplete feature is pretty much unchanged (I am thinking of adding something for calltips, but not sure yet)</li>
</ul>
<p>By the way, nice work with the block folding feature, I just noticed by compiling master.</p>
<h2>Feedback request</h2>
<p>Please notice this is a few ours work (kind of a POC), but I would like to have early feedback.</p>
<h2>Known issues of this PR</h2>
<ul>
<li>the tag creation should be improved and possibly moved to tagmanager (please advise on that)</li>
<li>the feature should be configurable and better packaged</li>
<li>not much used to C/GTK, so I don't even know how many leaks I am introducing here (possibly need to check with proper debug options or valgrind)</li>
<li>will adjust to proper coding style (yes I noticed the style you are using)</li>
</ul>
<p>It works already (in this shaky version), see screenshot:<br>
<a href="https://cloud.githubusercontent.com/assets/7117866/24683195/e62fe3ac-199d-11e7-8422-4221aaf55c00.png" target="_blank"><img src="https://cloud.githubusercontent.com/assets/7117866/24683195/e62fe3ac-199d-11e7-8422-4221aaf55c00.png" alt="screen_geany1" style="max-width:100%;"></a></p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/geany/geany/pull/1457'>https://github.com/geany/geany/pull/1457</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Preliminary work to add gocode support for autocomplete</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1457/files#diff-0">src/editor.c</a>
    (242)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/geany/geany/pull/1457.patch'>https://github.com/geany/geany/pull/1457.patch</a></li>
  <li><a href='https://github.com/geany/geany/pull/1457.diff'>https://github.com/geany/geany/pull/1457.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/1457">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ_dUzb76e_qkDsc7JU-EMyCX3fWCks5rstAagaJpZM4MzjZB">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ9VnKLuFBSV_pMpg46CKKmeQgfzXks5rstAagaJpZM4MzjZB.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/1457"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"[WIP] Add gocode support for autocomplete (#1457)"}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany/pull/1457"}}}</script>