{"issue":{"state":"open","created_at":"2011-11-30T20:02:29Z","updated_at":"2011-12-01T06:52:22Z","comments":1,"user":{"gravatar_id":"befd819b3fced8c6bd3dba7e633dd068","id":64050,"url":"https://api.github.com/users/gjtorikian","avatar_url":"https://secure.gravatar.com/avatar/befd819b3fced8c6bd3dba7e633dd068?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"gjtorikian"},"body":"Noticed markdown was missing from the selected choices.\r\n\r\nAlso, I tried to add [d:maxreached] as a variable in <a:caption> but that didn't seem to work--so I had to hardcode the value in there. The user should know what the limit is.","assignee":null,"id":2406451,"labels":[],"pull_request":{"patch_url":"https://github.com/ajaxorg/cloud9/pull/593.patch","html_url":"https://github.com/ajaxorg/cloud9/pull/593","diff_url":"https://github.com/ajaxorg/cloud9/pull/593.diff"},"number":593,"title":"Add markdown files option; notify user of max search count","html_url":"https://github.com/ajaxorg/cloud9/issues/593","closed_at":null,"url":"https://api.github.com/repos/ajaxorg/cloud9/issues/593","milestone":null},"action":"created","comment":{"created_at":"2011-12-01T06:52:22Z","updated_at":"2011-12-01T06:52:22Z","user":{"gravatar_id":"c35489faf0667a209d76d72123622e81","id":437535,"url":"https://api.github.com/users/mattpardee","avatar_url":"https://secure.gravatar.com/avatar/c35489faf0667a209d76d72123622e81?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"mattpardee"},"body":"Some interesting points to note about the code search:\r\n\r\n1. On the server it limits by size, not by # of results. You can see in the codesearch plugin in jsDAV:\r\n\r\njsDAV_Codesearch_Plugin.MAXSIZE = 2097152; //2MB\r\n\r\n...and when the child process is searching and aggregating data, it checks:\r\n\r\nout += data;\r\nif (out.length >= jsDAV_Codesearch_Plugin.MAXSIZE)\r\n    grep.kill();\r\n\r\n@mike will have something to say about this, I'm not fully understanding why the client side code is checking at 50 results. Maybe there is some performance concern on the client side for parsing results?\r\n\r\n2. The maxreached XML that jsDAV creates:\r\n\r\naXml.push('<d:maxreached/>');\r\n\r\nYou can see here aren't any attributes in the maxreached XML, just the tag itself. As an aside, elsewhere in searchinfiles.xml you see\r\n\r\n<a:caption match=\"[d:response]\">[@path] (#[d:excerpt])</a:caption>\r\n\r\nIn this case for each <d:response> there's an attribute @path that you can access ('<d:response path=\"client/ext/path/blah.js\">'), and with #[d:excerpt] this is just counting the number of <d:excerpt> children of that <d:response> element.\r\n\r\nI'm not up to speed on the shorthand for #[tag] here, I think APF must be using the XPath count() method for child elements?\r\n\r\nRegardless the XML structure that jsDAV codesearch returns looks partially like:\r\n\r\n<d:response path=\"blah/path/to.js\">\r\n    <d:excerpt line=\"70\">some code from line 70</d:excerpt>\r\n</d:response>\r\n\r\nSo to be even more verbose about this, referencing...\r\n\r\n[d:maxreached]\r\n\r\n...doesn't really mean anything useful, it's just an element with no information and all you know is that it's there :)","id":2971662,"url":"https://api.github.com/repos/ajaxorg/cloud9/issues/comments/2971662"}}