{"action":"created","issue":{"url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1636","labels_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1636/labels{/name}","comments_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1636/comments","events_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1636/events","html_url":"https://github.com/Valloric/YouCompleteMe/pull/1636","id":101711432,"number":1636,"title":"Add required namespace in C# after completing","user":{"login":"mispencer","id":1434266,"avatar_url":"https://avatars.githubusercontent.com/u/1434266?v=3","gravatar_id":"","url":"https://api.github.com/users/mispencer","html_url":"https://github.com/mispencer","followers_url":"https://api.github.com/users/mispencer/followers","following_url":"https://api.github.com/users/mispencer/following{/other_user}","gists_url":"https://api.github.com/users/mispencer/gists{/gist_id}","starred_url":"https://api.github.com/users/mispencer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mispencer/subscriptions","organizations_url":"https://api.github.com/users/mispencer/orgs","repos_url":"https://api.github.com/users/mispencer/repos","events_url":"https://api.github.com/users/mispencer/events{/privacy}","received_events_url":"https://api.github.com/users/mispencer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":34,"created_at":"2015-08-18T17:49:21Z","updated_at":"2015-09-13T15:48:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Valloric/YouCompleteMe/pulls/1636","html_url":"https://github.com/Valloric/YouCompleteMe/pull/1636","diff_url":"https://github.com/Valloric/YouCompleteMe/pull/1636.diff","patch_url":"https://github.com/Valloric/YouCompleteMe/pull/1636.patch"},"body":"When forcing semantic completion with the keybind, C# completions can return a list of importable types. These types are from namespaces which havn't been imported, and thus are not valid to use without also adding their namespace's import statement. This change makes YCM automatically insert the necessary using statement to import that namespace on completion completion. In the case there are multiple possible namespaces, it prompts you to choose one.\r\n\r\nDemo:\r\n![c namespaceinsertdemo](https://cloud.githubusercontent.com/assets/1434266/9337289/b7994542-459b-11e5-8f52-e48af76a3aab.gif)\r\n\r\nBy default, the using statement is inserted after the last using statement. If there aren't any, it's inserted before the first line. This behavior is customization by setting a function to the vim global ``g:ycm_cs_insert_namespace_function``. I implemented this in pure vimscript largely so I could provide such customization...\r\n\r\nCaveats: vim does not provide a way to get which completion was inserted. To get this, we store the completions, hook the CompleteDone event, and check than if the preceding text matches any of the completions. This is imperfect, and sometimes matches when it shouldn't. Also, the CompleteDone event requires 7.3.598 or newer."},"comment":{"url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/comments/139889354","html_url":"https://github.com/Valloric/YouCompleteMe/pull/1636#issuecomment-139889354","issue_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1636","id":139889354,"user":{"login":"homu","id":10212162,"avatar_url":"https://avatars.githubusercontent.com/u/10212162?v=3","gravatar_id":"","url":"https://api.github.com/users/homu","html_url":"https://github.com/homu","followers_url":"https://api.github.com/users/homu/followers","following_url":"https://api.github.com/users/homu/following{/other_user}","gists_url":"https://api.github.com/users/homu/gists{/gist_id}","starred_url":"https://api.github.com/users/homu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/homu/subscriptions","organizations_url":"https://api.github.com/users/homu/orgs","repos_url":"https://api.github.com/users/homu/repos","events_url":"https://api.github.com/users/homu/events{/privacy}","received_events_url":"https://api.github.com/users/homu/received_events","type":"User","site_admin":false},"created_at":"2015-09-13T15:48:31Z","updated_at":"2015-09-13T15:48:31Z","body":":hourglass: Testing commit bb21150 with merge 0d426e4..."}}