{"action":"created","issue":{"url":"https://api.github.com/repos/Valloric/ycmd/issues/922","repository_url":"https://api.github.com/repos/Valloric/ycmd","labels_url":"https://api.github.com/repos/Valloric/ycmd/issues/922/labels{/name}","comments_url":"https://api.github.com/repos/Valloric/ycmd/issues/922/comments","events_url":"https://api.github.com/repos/Valloric/ycmd/issues/922/events","html_url":"https://github.com/Valloric/ycmd/pull/922","id":296100147,"number":922,"title":"[READY] Support for unity-style builds by specifying the translation unit","user":{"login":"puremourning","id":10584846,"avatar_url":"https://avatars0.githubusercontent.com/u/10584846?v=4","gravatar_id":"","url":"https://api.github.com/users/puremourning","html_url":"https://github.com/puremourning","followers_url":"https://api.github.com/users/puremourning/followers","following_url":"https://api.github.com/users/puremourning/following{/other_user}","gists_url":"https://api.github.com/users/puremourning/gists{/gist_id}","starred_url":"https://api.github.com/users/puremourning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puremourning/subscriptions","organizations_url":"https://api.github.com/users/puremourning/orgs","repos_url":"https://api.github.com/users/puremourning/repos","events_url":"https://api.github.com/users/puremourning/events{/privacy}","received_events_url":"https://api.github.com/users/puremourning/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":32,"created_at":"2018-02-10T13:17:58Z","updated_at":"2018-03-08T21:47:04Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/Valloric/ycmd/pulls/922","html_url":"https://github.com/Valloric/ycmd/pull/922","diff_url":"https://github.com/Valloric/ycmd/pull/922.diff","patch_url":"https://github.com/Valloric/ycmd/pull/922.patch"},"body":"This allows for more elaborate project structures where the translation unit is not the current file name. We already have some concession to this concept when searching a compilation database for _flags_, but that does not allow for us to tell clang to use a specific file as the TU to parse.\r\n\r\nThis change allows the extra conf file to specify the translation unit to parse when editing a particular file. This essentially exposes the full flexibility available when executing the compiler from the command line. \r\n\r\nAn example scenario:\r\n\r\n* unit.cpp\r\n\r\n```c++\r\n#include <iostream>\r\n\r\nstruct Test { int a; int b; };\r\n\r\n#include \"file.cpp\"\r\n\r\nint main() {\r\n   Test t;\r\n   do_thing( t );\r\n}\r\n```\r\n\r\n* file.cpp\r\n\r\n```c++\r\nvoid do_thing( Test& t ) {\r\n   std::cout << \"Test: \" << t.a << '\\n';\r\n}\r\n```\r\n\r\n\r\nWhen editing `file.cpp` i actually want the translation unit that clang sees to be `unit.cpp` otherwise the file is not parseable. Clang understands this by splitting the concept of translation unit file name, and position filename. \r\n\r\nThis change replicates that separation in ycmd, allowing such scenarios.\r\n\r\nCloses https://github.com/Valloric/YouCompleteMe/issues/2796\r\nCloses https://github.com/Valloric/YouCompleteMe/issues/2795\r\n\r\n<!-- Reviewable:start -->\r\n---\r\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/valloric/ycmd/922)\r\n<!-- Reviewable:end -->"},"comment":{"url":"https://api.github.com/repos/Valloric/ycmd/issues/comments/371635522","html_url":"https://github.com/Valloric/ycmd/pull/922#issuecomment-371635522","issue_url":"https://api.github.com/repos/Valloric/ycmd/issues/922","id":371635522,"user":{"login":"zzbot","id":28640366,"avatar_url":"https://avatars1.githubusercontent.com/u/28640366?v=4","gravatar_id":"","url":"https://api.github.com/users/zzbot","html_url":"https://github.com/zzbot","followers_url":"https://api.github.com/users/zzbot/followers","following_url":"https://api.github.com/users/zzbot/following{/other_user}","gists_url":"https://api.github.com/users/zzbot/gists{/gist_id}","starred_url":"https://api.github.com/users/zzbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzbot/subscriptions","organizations_url":"https://api.github.com/users/zzbot/orgs","repos_url":"https://api.github.com/users/zzbot/repos","events_url":"https://api.github.com/users/zzbot/events{/privacy}","received_events_url":"https://api.github.com/users/zzbot/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T21:47:04Z","updated_at":"2018-03-08T21:47:04Z","author_association":"COLLABORATOR","body":":sunny: Test successful - [status-appveyor](https://ci.appveyor.com/project/Valloric/ycmd/build/3105), [status-travis](https://travis-ci.org/Valloric/ycmd/builds/350965299?utm_source=github_status&utm_medium=notification)\nApproved by: micbou\nPushing 03ea012dba688c0ef6c0571a18108316d819f528 to master..."}}
{"actor":{"display_login":"zzbot"}}