{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/projectile/issues/626","labels_url":"https://api.github.com/repos/bbatsov/projectile/issues/626/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/projectile/issues/626/comments","events_url":"https://api.github.com/repos/bbatsov/projectile/issues/626/events","html_url":"https://github.com/bbatsov/projectile/pull/626","id":56160033,"number":626,"title":"projectile-find-other-file sort candidates","user":{"login":"LefterisJP","id":1658405,"avatar_url":"https://avatars.githubusercontent.com/u/1658405?v=3","gravatar_id":"","url":"https://api.github.com/users/LefterisJP","html_url":"https://github.com/LefterisJP","followers_url":"https://api.github.com/users/LefterisJP/followers","following_url":"https://api.github.com/users/LefterisJP/following{/other_user}","gists_url":"https://api.github.com/users/LefterisJP/gists{/gist_id}","starred_url":"https://api.github.com/users/LefterisJP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LefterisJP/subscriptions","organizations_url":"https://api.github.com/users/LefterisJP/orgs","repos_url":"https://api.github.com/users/LefterisJP/repos","events_url":"https://api.github.com/users/LefterisJP/events{/privacy}","received_events_url":"https://api.github.com/users/LefterisJP/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-02-01T10:58:46Z","updated_at":"2015-02-22T18:52:26Z","closed_at":"2015-02-22T18:52:20Z","pull_request":{"url":"https://api.github.com/repos/bbatsov/projectile/pulls/626","html_url":"https://github.com/bbatsov/projectile/pull/626","diff_url":"https://github.com/bbatsov/projectile/pull/626.diff","patch_url":"https://github.com/bbatsov/projectile/pull/626.patch"},"body":"In projects where there are multiple file names with the same\r\nheader/source combinations we can still provide more accurate results by\r\nsorting the candidates list to put the other-file under the same\r\ndirectory name as this file to the top of the list.\r\n\r\nSo now if we have a directory tree like this:\r\n```\r\n|-src-\r\n     |\r\n     moduleA-\r\n            |\r\n            filename.c\r\n     moduleB-\r\n            |\r\n            filename.c\r\n|-include-\r\n         |\r\n         moduleA-\r\n                |\r\n                filename.h\r\n          moduleB-\r\n                 |\r\n                 filename.h\r\n```\r\n\r\n`projectile-find-other-file` will always return the proper other file and there is no need to check the return list and choose which one it is that you actually wanted.\r\n\r\nI tested this in the projects I am working on and it seems to work perfectly.\r\n\r\nNote: In the sorting of the list the `other-file` is not used and as such there is a warning when you byte compile. So I suppose there is gotta be a better function to accomplish this. Any hints are more than welcome. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/bbatsov/projectile/issues/comments/75450771","html_url":"https://github.com/bbatsov/projectile/pull/626#issuecomment-75450771","issue_url":"https://api.github.com/repos/bbatsov/projectile/issues/626","id":75450771,"user":{"login":"bbatsov","id":103882,"avatar_url":"https://avatars.githubusercontent.com/u/103882?v=3","gravatar_id":"","url":"https://api.github.com/users/bbatsov","html_url":"https://github.com/bbatsov","followers_url":"https://api.github.com/users/bbatsov/followers","following_url":"https://api.github.com/users/bbatsov/following{/other_user}","gists_url":"https://api.github.com/users/bbatsov/gists{/gist_id}","starred_url":"https://api.github.com/users/bbatsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbatsov/subscriptions","organizations_url":"https://api.github.com/users/bbatsov/orgs","repos_url":"https://api.github.com/users/bbatsov/repos","events_url":"https://api.github.com/users/bbatsov/events{/privacy}","received_events_url":"https://api.github.com/users/bbatsov/received_events","type":"User","site_admin":false},"created_at":"2015-02-22T18:52:26Z","updated_at":"2015-02-22T18:52:26Z","body":":+1: "}}