{"action":"created","comment":{"url":"https://api.github.com/repos/Valloric/ycmd/pulls/comments/38273715","id":38273715,"diff_hunk":"@@ -233,3 +235,81 @@ def EnvVar_Undefined_Garbage_3_test( self ):\n \n     os.environ.pop( 'YCM_TEST_td' )\n     eq_( [ ], data )\n+\n+\n+def WorkingDir_Use_File_Path_test( ):","path":"ycmd/completers/general/tests/filename_completer_test.py","position":68,"original_position":68,"commit_id":"141183e7e60ea59c7c954ee97035c345dc0dba42","original_commit_id":"141183e7e60ea59c7c954ee97035c345dc0dba42","user":{"login":"Valloric","id":919444,"avatar_url":"https://avatars.githubusercontent.com/u/919444?v=3","gravatar_id":"","url":"https://api.github.com/users/Valloric","html_url":"https://github.com/Valloric","followers_url":"https://api.github.com/users/Valloric/followers","following_url":"https://api.github.com/users/Valloric/following{/other_user}","gists_url":"https://api.github.com/users/Valloric/gists{/gist_id}","starred_url":"https://api.github.com/users/Valloric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Valloric/subscriptions","organizations_url":"https://api.github.com/users/Valloric/orgs","repos_url":"https://api.github.com/users/Valloric/repos","events_url":"https://api.github.com/users/Valloric/events{/privacy}","received_events_url":"https://api.github.com/users/Valloric/received_events","type":"User","site_admin":false},"body":"If parens are empty, there should be no space inside them.","created_at":"2015-08-30T17:14:16Z","updated_at":"2015-08-30T17:14:16Z","html_url":"https://github.com/Valloric/ycmd/pull/210#discussion_r38273715","pull_request_url":"https://api.github.com/repos/Valloric/ycmd/pulls/210","_links":{"self":{"href":"https://api.github.com/repos/Valloric/ycmd/pulls/comments/38273715"},"html":{"href":"https://github.com/Valloric/ycmd/pull/210#discussion_r38273715"},"pull_request":{"href":"https://api.github.com/repos/Valloric/ycmd/pulls/210"}}},"pull_request":{"url":"https://api.github.com/repos/Valloric/ycmd/pulls/210","id":43714793,"html_url":"https://github.com/Valloric/ycmd/pull/210","diff_url":"https://github.com/Valloric/ycmd/pull/210.diff","patch_url":"https://github.com/Valloric/ycmd/pull/210.patch","issue_url":"https://api.github.com/repos/Valloric/ycmd/issues/210","number":210,"state":"open","locked":false,"title":"Use client working directory if supplied for filename completer","user":{"login":"puremourning","id":10584846,"avatar_url":"https://avatars.githubusercontent.com/u/10584846?v=3","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},"body":"Background\r\n====\r\n\r\nFixes: https://github.com/Valloric/YouCompleteMe/issues/1655\r\n\r\nThe documentation for YouCompleteMe says:\r\n\r\n>The g:ycm_filepath_completion_use_working_dir option\r\n\r\n> By default, YCM's filepath completion will interpret relative paths like ../ as being relative to the folder of the file of the currently active buffer. Setting this option will force YCM to always interpret relative paths as being relative to Vim's current working directory.\r\n\r\n> Default: 0\r\n\r\n>  let g:ycm_filepath_completion_use_working_dir = 0\r\n\r\nBut previously, only the working directory of `ycmd` was used. This meant that operations like changing the working directory of the client were not reflected in completion suggestions.\r\n\r\nWhat this change does\r\n====\r\n\r\nThe client can now (optionally) pass a `working_dir` property to the '/completions' request which is respected by the filename completer (and potentially any other completer should it be useful). If `working_dir` is not supplied, the previous behaviour remains.\r\n\r\nAPI Changes\r\n====\r\n\r\nThe `/completions` request data now allows an optional `working_dir` parameter containing the _absolute path_ to the working directory of the client.\r\n\r\nTesting\r\n====\r\n\r\nAdded new tests to the `filename_completer_test`. See also trivial manual test cases on the linked issue. The one remaining question is about the performance of the `os.getcwd` call on each request, but it probably pales into insignificance compared to the performance of the vimscript, and in particular the IO operations performed by the filename completer itself.\r\n\r\nThis only addresses the 'standard' case for filename completer, as the 'include' case already has its own logic for relative paths and there are already auto tests for that.\r\n\r\nRelated\r\n====\r\n\r\nThere is a related (trivial) change to YouCompleteMe: https://github.com/Valloric/YouCompleteMe/pull/1659","created_at":"2015-08-30T15:14:55Z","updated_at":"2015-08-30T17:14:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87d6fa3386475956388c42a9210327cd18dec450","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Valloric/ycmd/pulls/210/commits","review_comments_url":"https://api.github.com/repos/Valloric/ycmd/pulls/210/comments","review_comment_url":"https://api.github.com/repos/Valloric/ycmd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Valloric/ycmd/issues/210/comments","statuses_url":"https://api.github.com/repos/Valloric/ycmd/statuses/141183e7e60ea59c7c954ee97035c345dc0dba42","head":{"label":"puremourning:cwd-filetype-completer","ref":"cwd-filetype-completer","sha":"141183e7e60ea59c7c954ee97035c345dc0dba42","user":{"login":"puremourning","id":10584846,"avatar_url":"https://avatars.githubusercontent.com/u/10584846?v=3","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},"repo":{"id":30490236,"name":"ycmd-1","full_name":"puremourning/ycmd-1","owner":{"login":"puremourning","id":10584846,"avatar_url":"https://avatars.githubusercontent.com/u/10584846?v=3","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},"private":false,"html_url":"https://github.com/puremourning/ycmd-1","description":"A code-completion & code-comprehension server","fork":true,"url":"https://api.github.com/repos/puremourning/ycmd-1","forks_url":"https://api.github.com/repos/puremourning/ycmd-1/forks","keys_url":"https://api.github.com/repos/puremourning/ycmd-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puremourning/ycmd-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puremourning/ycmd-1/teams","hooks_url":"https://api.github.com/repos/puremourning/ycmd-1/hooks","issue_events_url":"https://api.github.com/repos/puremourning/ycmd-1/issues/events{/number}","events_url":"https://api.github.com/repos/puremourning/ycmd-1/events","assignees_url":"https://api.github.com/repos/puremourning/ycmd-1/assignees{/user}","branches_url":"https://api.github.com/repos/puremourning/ycmd-1/branches{/branch}","tags_url":"https://api.github.com/repos/puremourning/ycmd-1/tags","blobs_url":"https://api.github.com/repos/puremourning/ycmd-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puremourning/ycmd-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puremourning/ycmd-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/puremourning/ycmd-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puremourning/ycmd-1/statuses/{sha}","languages_url":"https://api.github.com/repos/puremourning/ycmd-1/languages","stargazers_url":"https://api.github.com/repos/puremourning/ycmd-1/stargazers","contributors_url":"https://api.github.com/repos/puremourning/ycmd-1/contributors","subscribers_url":"https://api.github.com/repos/puremourning/ycmd-1/subscribers","subscription_url":"https://api.github.com/repos/puremourning/ycmd-1/subscription","commits_url":"https://api.github.com/repos/puremourning/ycmd-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/puremourning/ycmd-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/puremourning/ycmd-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/puremourning/ycmd-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/puremourning/ycmd-1/contents/{+path}","compare_url":"https://api.github.com/repos/puremourning/ycmd-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puremourning/ycmd-1/merges","archive_url":"https://api.github.com/repos/puremourning/ycmd-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puremourning/ycmd-1/downloads","issues_url":"https://api.github.com/repos/puremourning/ycmd-1/issues{/number}","pulls_url":"https://api.github.com/repos/puremourning/ycmd-1/pulls{/number}","milestones_url":"https://api.github.com/repos/puremourning/ycmd-1/milestones{/number}","notifications_url":"https://api.github.com/repos/puremourning/ycmd-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puremourning/ycmd-1/labels{/name}","releases_url":"https://api.github.com/repos/puremourning/ycmd-1/releases{/id}","created_at":"2015-02-08T12:23:27Z","updated_at":"2015-03-29T15:31:20Z","pushed_at":"2015-08-30T17:13:11Z","git_url":"git://github.com/puremourning/ycmd-1.git","ssh_url":"git@github.com:puremourning/ycmd-1.git","clone_url":"https://github.com/puremourning/ycmd-1.git","svn_url":"https://github.com/puremourning/ycmd-1","homepage":null,"size":6738,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Valloric:master","ref":"master","sha":"49cb5ac542748dac58635f458802095fc9e13542","user":{"login":"Valloric","id":919444,"avatar_url":"https://avatars.githubusercontent.com/u/919444?v=3","gravatar_id":"","url":"https://api.github.com/users/Valloric","html_url":"https://github.com/Valloric","followers_url":"https://api.github.com/users/Valloric/followers","following_url":"https://api.github.com/users/Valloric/following{/other_user}","gists_url":"https://api.github.com/users/Valloric/gists{/gist_id}","starred_url":"https://api.github.com/users/Valloric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Valloric/subscriptions","organizations_url":"https://api.github.com/users/Valloric/orgs","repos_url":"https://api.github.com/users/Valloric/repos","events_url":"https://api.github.com/users/Valloric/events{/privacy}","received_events_url":"https://api.github.com/users/Valloric/received_events","type":"User","site_admin":false},"repo":{"id":19832415,"name":"ycmd","full_name":"Valloric/ycmd","owner":{"login":"Valloric","id":919444,"avatar_url":"https://avatars.githubusercontent.com/u/919444?v=3","gravatar_id":"","url":"https://api.github.com/users/Valloric","html_url":"https://github.com/Valloric","followers_url":"https://api.github.com/users/Valloric/followers","following_url":"https://api.github.com/users/Valloric/following{/other_user}","gists_url":"https://api.github.com/users/Valloric/gists{/gist_id}","starred_url":"https://api.github.com/users/Valloric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Valloric/subscriptions","organizations_url":"https://api.github.com/users/Valloric/orgs","repos_url":"https://api.github.com/users/Valloric/repos","events_url":"https://api.github.com/users/Valloric/events{/privacy}","received_events_url":"https://api.github.com/users/Valloric/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Valloric/ycmd","description":"A code-completion & code-comprehension server","fork":false,"url":"https://api.github.com/repos/Valloric/ycmd","forks_url":"https://api.github.com/repos/Valloric/ycmd/forks","keys_url":"https://api.github.com/repos/Valloric/ycmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Valloric/ycmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Valloric/ycmd/teams","hooks_url":"https://api.github.com/repos/Valloric/ycmd/hooks","issue_events_url":"https://api.github.com/repos/Valloric/ycmd/issues/events{/number}","events_url":"https://api.github.com/repos/Valloric/ycmd/events","assignees_url":"https://api.github.com/repos/Valloric/ycmd/assignees{/user}","branches_url":"https://api.github.com/repos/Valloric/ycmd/branches{/branch}","tags_url":"https://api.github.com/repos/Valloric/ycmd/tags","blobs_url":"https://api.github.com/repos/Valloric/ycmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Valloric/ycmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Valloric/ycmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/Valloric/ycmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Valloric/ycmd/statuses/{sha}","languages_url":"https://api.github.com/repos/Valloric/ycmd/languages","stargazers_url":"https://api.github.com/repos/Valloric/ycmd/stargazers","contributors_url":"https://api.github.com/repos/Valloric/ycmd/contributors","subscribers_url":"https://api.github.com/repos/Valloric/ycmd/subscribers","subscription_url":"https://api.github.com/repos/Valloric/ycmd/subscription","commits_url":"https://api.github.com/repos/Valloric/ycmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/Valloric/ycmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/Valloric/ycmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/Valloric/ycmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/Valloric/ycmd/contents/{+path}","compare_url":"https://api.github.com/repos/Valloric/ycmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Valloric/ycmd/merges","archive_url":"https://api.github.com/repos/Valloric/ycmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Valloric/ycmd/downloads","issues_url":"https://api.github.com/repos/Valloric/ycmd/issues{/number}","pulls_url":"https://api.github.com/repos/Valloric/ycmd/pulls{/number}","milestones_url":"https://api.github.com/repos/Valloric/ycmd/milestones{/number}","notifications_url":"https://api.github.com/repos/Valloric/ycmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Valloric/ycmd/labels{/name}","releases_url":"https://api.github.com/repos/Valloric/ycmd/releases{/id}","created_at":"2014-05-15T19:30:17Z","updated_at":"2015-08-27T13:33:18Z","pushed_at":"2015-08-30T17:13:45Z","git_url":"git://github.com/Valloric/ycmd.git","ssh_url":"git@github.com:Valloric/ycmd.git","clone_url":"https://github.com/Valloric/ycmd.git","svn_url":"https://github.com/Valloric/ycmd","homepage":null,"size":9623,"stargazers_count":349,"watchers_count":349,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":187,"mirror_url":null,"open_issues_count":22,"forks":187,"open_issues":22,"watchers":349,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Valloric/ycmd/pulls/210"},"html":{"href":"https://github.com/Valloric/ycmd/pull/210"},"issue":{"href":"https://api.github.com/repos/Valloric/ycmd/issues/210"},"comments":{"href":"https://api.github.com/repos/Valloric/ycmd/issues/210/comments"},"review_comments":{"href":"https://api.github.com/repos/Valloric/ycmd/pulls/210/comments"},"review_comment":{"href":"https://api.github.com/repos/Valloric/ycmd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Valloric/ycmd/pulls/210/commits"},"statuses":{"href":"https://api.github.com/repos/Valloric/ycmd/statuses/141183e7e60ea59c7c954ee97035c345dc0dba42"}}}}