{"action":"created","comment":{"url":"https://api.github.com/repos/geany/geany/pulls/comments/50985317","id":50985317,"diff_hunk":"@@ -1254,40 +1256,90 @@ static void addOtherFields (tagEntryInfo* const tag, const tagType type,\n \t\tif (((TOKEN_NAME == st->firstToken->type) || isDataTypeKeyword(st->firstToken))\n \t\t\t&& (0 != strcmp(vStringValue(st->firstToken->name), tag->name)))\n \t\t{\n-\t\t\ttag->extensionFields.varType = getVarType(st);\n+\t\t\ttag->extensionFields.varType = getVarType(st, nameToken);\n \t\t}\n \t}\n }\n \n-static const char *getVarType (const statementInfo *const st)\n+static const char *getVarType (const statementInfo *const st,\n+\t\t\t\t\t\t\t   const tokenInfo *const nameToken)\n {\n \tstatic vString *vt = NULL;\n \tunsigned int i;\n+\tunsigned int end = st->tokenIndex;\n+\tboolean seenType = FALSE;\n \n-\tif (! st->gotArgs)\n-\t\treturn vStringValue(st->firstToken->name);\t/* ignore non-functions */\n+\tswitch (st->declaration) {\n+\t\tcase DECL_BASE:\n+\t\tcase DECL_FUNCTION:\n+\t\tcase DECL_FUNCTION_TEMPLATE:\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\treturn vStringValue(st->firstToken->name);\n+\t}\n \n \tif (vt == NULL)\n \t\tvt = vStringNew();\n \telse\n \t\tvStringClear(vt);\n \n+\t/* find the end of the type signature in the token list */\n \tfor (i = 0; i < st->tokenIndex; i++)\n \t{\n+\t\tconst tokenInfo *const t = st->token[i];\n+\n+\t\t/* stop if we find the token used to generate the tag name, or\n+\t\t * a name token in the middle yet not preceded by a scope separator */\n+\t\tif ((t == nameToken ||\n+\t\t     (t->type == nameToken->type &&\n+\t\t      t->keyword == nameToken->keyword &&\n+\t\t      t->lineNumber == nameToken->lineNumber &&\n+\t\t      strcmp(vStringValue(t->name), vStringValue(nameToken->name)) == 0)) ||\n+\t\t    (t->type == TOKEN_NAME && seenType &&\n+\t\t     (i > 0 && st->token[i - 1]->type != TOKEN_DOUBLE_COLON)))","path":"tagmanager/ctags/c.c","position":66,"original_position":66,"commit_id":"748137bd1dfa648948d9d127aa3e27b6857db764","original_commit_id":"748137bd1dfa648948d9d127aa3e27b6857db764","user":{"login":"techee","id":713965,"avatar_url":"https://avatars.githubusercontent.com/u/713965?v=3","gravatar_id":"","url":"https://api.github.com/users/techee","html_url":"https://github.com/techee","followers_url":"https://api.github.com/users/techee/followers","following_url":"https://api.github.com/users/techee/following{/other_user}","gists_url":"https://api.github.com/users/techee/gists{/gist_id}","starred_url":"https://api.github.com/users/techee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techee/subscriptions","organizations_url":"https://api.github.com/users/techee/orgs","repos_url":"https://api.github.com/users/techee/repos","events_url":"https://api.github.com/users/techee/events{/privacy}","received_events_url":"https://api.github.com/users/techee/received_events","type":"User","site_admin":false},"body":"@elextr I'm afraid that proper template parsing would double the c.c size and would take a really lot of time to develop. The only possibility to have templates in the type is to really just record the input string together with some reasonable begin/end type detection. But even this will probably require quite some work and the question is whether it's worth it.\r\n\r\nThe implementation in this patch is good enough IMO - at least for the scope completion where we'd have to remove the templates anyway.","created_at":"2016-01-27T13:52:44Z","updated_at":"2016-01-27T13:52:44Z","html_url":"https://github.com/geany/geany/pull/889#discussion_r50985317","pull_request_url":"https://api.github.com/repos/geany/geany/pulls/889","_links":{"self":{"href":"https://api.github.com/repos/geany/geany/pulls/comments/50985317"},"html":{"href":"https://github.com/geany/geany/pull/889#discussion_r50985317"},"pull_request":{"href":"https://api.github.com/repos/geany/geany/pulls/889"}}},"pull_request":{"url":"https://api.github.com/repos/geany/geany/pulls/889","id":57224306,"html_url":"https://github.com/geany/geany/pull/889","diff_url":"https://github.com/geany/geany/pull/889.diff","patch_url":"https://github.com/geany/geany/pull/889.patch","issue_url":"https://api.github.com/repos/geany/geany/issues/889","number":889,"state":"open","locked":false,"title":"C, C++, C#, D: Improve return type and var type recognition","user":{"login":"b4n","id":793526,"avatar_url":"https://avatars.githubusercontent.com/u/793526?v=3","gravatar_id":"","url":"https://api.github.com/users/b4n","html_url":"https://github.com/b4n","followers_url":"https://api.github.com/users/b4n/followers","following_url":"https://api.github.com/users/b4n/following{/other_user}","gists_url":"https://api.github.com/users/b4n/gists{/gist_id}","starred_url":"https://api.github.com/users/b4n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b4n/subscriptions","organizations_url":"https://api.github.com/users/b4n/orgs","repos_url":"https://api.github.com/users/b4n/repos","events_url":"https://api.github.com/users/b4n/events{/privacy}","received_events_url":"https://api.github.com/users/b4n/received_events","type":"User","site_admin":false},"body":"This is far from perfect and contains a lot of guessing.  It showed\r\ngood results based on our tests cases, fixing several issues and not\r\nintroducing any more issues (admittedly, after working around a subtle\r\none regarding D static ifs).\r\n\r\nCloses #845.","created_at":"2016-01-26T15:21:05Z","updated_at":"2016-01-27T13:52:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68e7141b0ee4c4c4169330d7880106ab227abb32","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/geany/geany/pulls/889/commits","review_comments_url":"https://api.github.com/repos/geany/geany/pulls/889/comments","review_comment_url":"https://api.github.com/repos/geany/geany/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geany/geany/issues/889/comments","statuses_url":"https://api.github.com/repos/geany/geany/statuses/748137bd1dfa648948d9d127aa3e27b6857db764","head":{"label":"b4n:c/return-type","ref":"c/return-type","sha":"748137bd1dfa648948d9d127aa3e27b6857db764","user":{"login":"b4n","id":793526,"avatar_url":"https://avatars.githubusercontent.com/u/793526?v=3","gravatar_id":"","url":"https://api.github.com/users/b4n","html_url":"https://github.com/b4n","followers_url":"https://api.github.com/users/b4n/followers","following_url":"https://api.github.com/users/b4n/following{/other_user}","gists_url":"https://api.github.com/users/b4n/gists{/gist_id}","starred_url":"https://api.github.com/users/b4n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b4n/subscriptions","organizations_url":"https://api.github.com/users/b4n/orgs","repos_url":"https://api.github.com/users/b4n/repos","events_url":"https://api.github.com/users/b4n/events{/privacy}","received_events_url":"https://api.github.com/users/b4n/received_events","type":"User","site_admin":false},"repo":{"id":2737453,"name":"geany","full_name":"b4n/geany","owner":{"login":"b4n","id":793526,"avatar_url":"https://avatars.githubusercontent.com/u/793526?v=3","gravatar_id":"","url":"https://api.github.com/users/b4n","html_url":"https://github.com/b4n","followers_url":"https://api.github.com/users/b4n/followers","following_url":"https://api.github.com/users/b4n/following{/other_user}","gists_url":"https://api.github.com/users/b4n/gists{/gist_id}","starred_url":"https://api.github.com/users/b4n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b4n/subscriptions","organizations_url":"https://api.github.com/users/b4n/orgs","repos_url":"https://api.github.com/users/b4n/repos","events_url":"https://api.github.com/users/b4n/events{/privacy}","received_events_url":"https://api.github.com/users/b4n/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/b4n/geany","description":"A fast and lightweight IDE","fork":true,"url":"https://api.github.com/repos/b4n/geany","forks_url":"https://api.github.com/repos/b4n/geany/forks","keys_url":"https://api.github.com/repos/b4n/geany/keys{/key_id}","collaborators_url":"https://api.github.com/repos/b4n/geany/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/b4n/geany/teams","hooks_url":"https://api.github.com/repos/b4n/geany/hooks","issue_events_url":"https://api.github.com/repos/b4n/geany/issues/events{/number}","events_url":"https://api.github.com/repos/b4n/geany/events","assignees_url":"https://api.github.com/repos/b4n/geany/assignees{/user}","branches_url":"https://api.github.com/repos/b4n/geany/branches{/branch}","tags_url":"https://api.github.com/repos/b4n/geany/tags","blobs_url":"https://api.github.com/repos/b4n/geany/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/b4n/geany/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/b4n/geany/git/refs{/sha}","trees_url":"https://api.github.com/repos/b4n/geany/git/trees{/sha}","statuses_url":"https://api.github.com/repos/b4n/geany/statuses/{sha}","languages_url":"https://api.github.com/repos/b4n/geany/languages","stargazers_url":"https://api.github.com/repos/b4n/geany/stargazers","contributors_url":"https://api.github.com/repos/b4n/geany/contributors","subscribers_url":"https://api.github.com/repos/b4n/geany/subscribers","subscription_url":"https://api.github.com/repos/b4n/geany/subscription","commits_url":"https://api.github.com/repos/b4n/geany/commits{/sha}","git_commits_url":"https://api.github.com/repos/b4n/geany/git/commits{/sha}","comments_url":"https://api.github.com/repos/b4n/geany/comments{/number}","issue_comment_url":"https://api.github.com/repos/b4n/geany/issues/comments{/number}","contents_url":"https://api.github.com/repos/b4n/geany/contents/{+path}","compare_url":"https://api.github.com/repos/b4n/geany/compare/{base}...{head}","merges_url":"https://api.github.com/repos/b4n/geany/merges","archive_url":"https://api.github.com/repos/b4n/geany/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/b4n/geany/downloads","issues_url":"https://api.github.com/repos/b4n/geany/issues{/number}","pulls_url":"https://api.github.com/repos/b4n/geany/pulls{/number}","milestones_url":"https://api.github.com/repos/b4n/geany/milestones{/number}","notifications_url":"https://api.github.com/repos/b4n/geany/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/b4n/geany/labels{/name}","releases_url":"https://api.github.com/repos/b4n/geany/releases{/id}","deployments_url":"https://api.github.com/repos/b4n/geany/deployments","created_at":"2011-11-08T21:50:08Z","updated_at":"2014-08-04T22:48:53Z","pushed_at":"2016-01-26T15:20:42Z","git_url":"git://github.com/b4n/geany.git","ssh_url":"git@github.com:b4n/geany.git","clone_url":"https://github.com/b4n/geany.git","svn_url":"https://github.com/b4n/geany","homepage":"http://www.geany.org","size":43165,"stargazers_count":6,"watchers_count":6,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":6,"default_branch":"master"}},"base":{"label":"geany:master","ref":"master","sha":"496d51210c2e3f8d83ddfdabc67c15a362c8d85c","user":{"login":"geany","id":1108795,"avatar_url":"https://avatars.githubusercontent.com/u/1108795?v=3","gravatar_id":"","url":"https://api.github.com/users/geany","html_url":"https://github.com/geany","followers_url":"https://api.github.com/users/geany/followers","following_url":"https://api.github.com/users/geany/following{/other_user}","gists_url":"https://api.github.com/users/geany/gists{/gist_id}","starred_url":"https://api.github.com/users/geany/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geany/subscriptions","organizations_url":"https://api.github.com/users/geany/orgs","repos_url":"https://api.github.com/users/geany/repos","events_url":"https://api.github.com/users/geany/events{/privacy}","received_events_url":"https://api.github.com/users/geany/received_events","type":"Organization","site_admin":false},"repo":{"id":2532922,"name":"geany","full_name":"geany/geany","owner":{"login":"geany","id":1108795,"avatar_url":"https://avatars.githubusercontent.com/u/1108795?v=3","gravatar_id":"","url":"https://api.github.com/users/geany","html_url":"https://github.com/geany","followers_url":"https://api.github.com/users/geany/followers","following_url":"https://api.github.com/users/geany/following{/other_user}","gists_url":"https://api.github.com/users/geany/gists{/gist_id}","starred_url":"https://api.github.com/users/geany/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geany/subscriptions","organizations_url":"https://api.github.com/users/geany/orgs","repos_url":"https://api.github.com/users/geany/repos","events_url":"https://api.github.com/users/geany/events{/privacy}","received_events_url":"https://api.github.com/users/geany/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geany/geany","description":"A fast and lightweight IDE","fork":false,"url":"https://api.github.com/repos/geany/geany","forks_url":"https://api.github.com/repos/geany/geany/forks","keys_url":"https://api.github.com/repos/geany/geany/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geany/geany/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geany/geany/teams","hooks_url":"https://api.github.com/repos/geany/geany/hooks","issue_events_url":"https://api.github.com/repos/geany/geany/issues/events{/number}","events_url":"https://api.github.com/repos/geany/geany/events","assignees_url":"https://api.github.com/repos/geany/geany/assignees{/user}","branches_url":"https://api.github.com/repos/geany/geany/branches{/branch}","tags_url":"https://api.github.com/repos/geany/geany/tags","blobs_url":"https://api.github.com/repos/geany/geany/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geany/geany/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geany/geany/git/refs{/sha}","trees_url":"https://api.github.com/repos/geany/geany/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geany/geany/statuses/{sha}","languages_url":"https://api.github.com/repos/geany/geany/languages","stargazers_url":"https://api.github.com/repos/geany/geany/stargazers","contributors_url":"https://api.github.com/repos/geany/geany/contributors","subscribers_url":"https://api.github.com/repos/geany/geany/subscribers","subscription_url":"https://api.github.com/repos/geany/geany/subscription","commits_url":"https://api.github.com/repos/geany/geany/commits{/sha}","git_commits_url":"https://api.github.com/repos/geany/geany/git/commits{/sha}","comments_url":"https://api.github.com/repos/geany/geany/comments{/number}","issue_comment_url":"https://api.github.com/repos/geany/geany/issues/comments{/number}","contents_url":"https://api.github.com/repos/geany/geany/contents/{+path}","compare_url":"https://api.github.com/repos/geany/geany/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geany/geany/merges","archive_url":"https://api.github.com/repos/geany/geany/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geany/geany/downloads","issues_url":"https://api.github.com/repos/geany/geany/issues{/number}","pulls_url":"https://api.github.com/repos/geany/geany/pulls{/number}","milestones_url":"https://api.github.com/repos/geany/geany/milestones{/number}","notifications_url":"https://api.github.com/repos/geany/geany/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geany/geany/labels{/name}","releases_url":"https://api.github.com/repos/geany/geany/releases{/id}","deployments_url":"https://api.github.com/repos/geany/geany/deployments","created_at":"2011-10-07T14:25:32Z","updated_at":"2016-01-26T14:25:11Z","pushed_at":"2016-01-27T00:07:22Z","git_url":"git://github.com/geany/geany.git","ssh_url":"git@github.com:geany/geany.git","clone_url":"https://github.com/geany/geany.git","svn_url":"https://github.com/geany/geany","homepage":"http://www.geany.org","size":46813,"stargazers_count":697,"watchers_count":697,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":249,"mirror_url":null,"open_issues_count":291,"forks":249,"open_issues":291,"watchers":697,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geany/geany/pulls/889"},"html":{"href":"https://github.com/geany/geany/pull/889"},"issue":{"href":"https://api.github.com/repos/geany/geany/issues/889"},"comments":{"href":"https://api.github.com/repos/geany/geany/issues/889/comments"},"review_comments":{"href":"https://api.github.com/repos/geany/geany/pulls/889/comments"},"review_comment":{"href":"https://api.github.com/repos/geany/geany/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geany/geany/pulls/889/commits"},"statuses":{"href":"https://api.github.com/repos/geany/geany/statuses/748137bd1dfa648948d9d127aa3e27b6857db764"}}}}