{"action":"created","issue":{"url":"https://api.github.com/repos/BurntSushi/ripgrep/issues/236","repository_url":"https://api.github.com/repos/BurntSushi/ripgrep","labels_url":"https://api.github.com/repos/BurntSushi/ripgrep/issues/236/labels{/name}","comments_url":"https://api.github.com/repos/BurntSushi/ripgrep/issues/236/comments","events_url":"https://api.github.com/repos/BurntSushi/ripgrep/issues/236/events","html_url":"https://github.com/BurntSushi/ripgrep/issues/236","id":189679072,"number":236,"title":"limit search to specific namespaces and classes","user":{"login":"phipse","id":1436211,"avatar_url":"https://avatars.githubusercontent.com/u/1436211?v=3","gravatar_id":"","url":"https://api.github.com/users/phipse","html_url":"https://github.com/phipse","followers_url":"https://api.github.com/users/phipse/followers","following_url":"https://api.github.com/users/phipse/following{/other_user}","gists_url":"https://api.github.com/users/phipse/gists{/gist_id}","starred_url":"https://api.github.com/users/phipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phipse/subscriptions","organizations_url":"https://api.github.com/users/phipse/orgs","repos_url":"https://api.github.com/users/phipse/repos","events_url":"https://api.github.com/users/phipse/events{/privacy}","received_events_url":"https://api.github.com/users/phipse/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-16T11:44:24Z","updated_at":"2016-11-16T12:22:56Z","closed_at":"2016-11-16T11:50:55Z","body":"Hi,\r\nI'd like to be able to focus the search in a C++ code base to classes/functions in specific namespaces;\r\nMeaning, I'd like to do something like this:\r\n```sh\r\nrg ns::Foo ./path/\r\n```\r\n\r\nand get a result 'class Foo' defined in namespace 'ns' ; and no results of 'class Foo'  defined in other namespaces.\r\n\r\nOr if I am looking for a function 'fn' in class 'Bar', I'd like to do:\r\n```sh\r\nrg Bar::fn ./path/\r\n```\r\nand get not only a result for a member function definition outside the class declaration, which already contains the string \"Bar::fn\", e.g.:\r\n\r\n```c++\r\nvoid Bar::fn(int a, int b) { ... }\r\n```\r\n\r\nbut also results for a function definition 'fn' inside a class declaration e.g.:\r\n```c++\r\nclass Bar {\r\nvoid fn(int a, int b) { ... }\r\n};\r\n```\r\nIs something like this already possible?"},"comment":{"url":"https://api.github.com/repos/BurntSushi/ripgrep/issues/comments/260933462","html_url":"https://github.com/BurntSushi/ripgrep/issues/236#issuecomment-260933462","issue_url":"https://api.github.com/repos/BurntSushi/ripgrep/issues/236","id":260933462,"user":{"login":"phipse","id":1436211,"avatar_url":"https://avatars.githubusercontent.com/u/1436211?v=3","gravatar_id":"","url":"https://api.github.com/users/phipse","html_url":"https://github.com/phipse","followers_url":"https://api.github.com/users/phipse/followers","following_url":"https://api.github.com/users/phipse/following{/other_user}","gists_url":"https://api.github.com/users/phipse/gists{/gist_id}","starred_url":"https://api.github.com/users/phipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phipse/subscriptions","organizations_url":"https://api.github.com/users/phipse/orgs","repos_url":"https://api.github.com/users/phipse/repos","events_url":"https://api.github.com/users/phipse/events{/privacy}","received_events_url":"https://api.github.com/users/phipse/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T12:22:56Z","updated_at":"2016-11-16T12:22:56Z","body":"No, there isn't, unfortunately. Is there a way to match the corresponding closing brace using ripgrep,  such that I can search for \"namespace Foo \\{.*\\}\" ?\r\n\r\nIn my head it's basically this:\r\n```\r\nfor each file in `rg -l \"namespace Foo\"`:\r\ndo\r\nrg \"class Bar\" file\r\ndone;\r\n```\r\nand in between count the opening and closing braces to limit the content of `file` to the namespace.\r\nA language aware tokenizer would be nice to have, but I think for my use case this might also be a little bit over the top."}}
{"actor":{"display_login":"phipse"}}