{"id":3658,"date":"2014-01-16T14:37:59","date_gmt":"2014-01-16T22:37:59","guid":{"rendered":"http:\/\/blog.mozilla.org\/webdev\/?p=3658"},"modified":"2014-01-16T14:37:59","modified_gmt":"2014-01-16T22:37:59","slug":"dxr-gets-more-correct-less-case-sensitive","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/","title":{"rendered":"DXR gets more correct, less case-sensitive"},"content":{"rendered":"<p><a href=\"http:\/\/dxr.mozilla.org\/\">DXR<\/a>, Mozilla&#8217;s evolving codebase search engine, has been taking patches at a furious rate these last two months. A great deal of work has gone into a UI refit, still in progress, which will improve discoverability, consistency, and power. Meanwhile, we have kept pushing more immediately enjoyable enhancements into production.<\/p>\n<h3>Cleaning Out The Pipes<\/h3>\n<p>One of these is a complete rewrite of our HTML generation pipeline. DXR pulls metadata about code from a number of disparate sources: syntax coloring from Pygments, locations of functions and macros from clang, links to Bugzilla bugs from a glorified regex. It then encodes those as begin-end pairs of text offsets, which it stitches together to make the final markup. However, the stitching was previously handled by a teetering state machine, stuffed info a single monolithic function with zero test coverage, replete with terrible mystery. As it turned out, it had been generating grossly invalid markup for some time. Fortunately, modern browsers are equally replete with terrible mystery and managed to make some semblance of sense out of things like <code>&lt;\/a&gt;&lt;\/a&gt;&lt;\/a&gt;<\/code>.<\/p>\n<p>But now that&#8217;s gone away. The rewrite brings&#8230;<\/p>\n<li>Correct markup<\/li>\n<li>Support for line-spanning regions, as for multi-line comments or strings<\/li>\n<li>Support for Windows line-endings (of which we did have a few in mozilla-central)<\/li>\n<li>Full test coverage<\/li>\n<p>And, perhaps most importantly in the long term, it modernizes our plugin contract by supporting annotation regions which overlap. This lets us enjoy truly decoupled plugins which no longer have to care if they&#8217;re used with others that emit overlapping regions. We can add plugins that support more languages and more types of analysis without having to worry about whether they&#8217;ll play nicely with the existing ecosystem. It also makes development of plugins outside the DXR codebase more practical.<\/p>\n<h3>Other Improvements<\/h3>\n<p>Other user-visible improvements include&#8230;<\/p>\n<li>Case-insensitive searching for plain text. This is now the default.<\/li>\n<li>Exposing values of constants using tooltips<\/li>\n<li>Results now show in alphabetical order by path rather than in random order, so you can rule out entire directory trees more easily.<\/li>\n<li>Searching for <code>Layers.cpp:45<\/code> takes you straight to that line of the file.<\/li>\n<li>Lexing .h files as C++ rather than C means we now highlight all those pesky C++ keywords.<\/li>\n<li>We now syntax-color preprocessor directives in JS.<\/li>\n<li>We&#8217;ve introduced <code>override<\/code> and <code>overridden<\/code> queries.<\/li>\n<li>No more &#8220;l&#8221; in line-number anchors means no more mistaking them for &#8220;1&#8221;.<\/li>\n<li>Fixed an off-by-one in line annotation position.<\/li>\n<li>No longer consider uninitialized struct or class members to be var refs.<\/li>\n<li>Support non-UTF-8 encodings of source files.<\/li>\n<li>Distinguish identically named functions in different anonymous namespaces.<\/li>\n<p>Thanks to James Abbatiello for lots of analysis improvements, Nick Cameron for the handy line-number search and syntax coloring, jonasac for several great fixes, and Schalk Neethling for a huge amount of work toward getting the UI refit out the door. If you&#8217;d like to <a href=\"https:\/\/wiki.mozilla.org\/DXR\">join the DXR hacking community<\/a>, we&#8217;ve got a nice ramp-up paved out for you and some easy bugs tagged.<\/p>\n<h3>New UI Teasers<\/h3>\n<p>As for the upcoming UI refit, there&#8217;s plenty in store:<\/p>\n<li>A natural integration of the now fairly disjoint browse and search modes<\/li>\n<li>Easy discoverability of all 26-or-so search filters: no more figuring them out through hearsay or by spelunking through the code<\/li>\n<li>No more unpredictability of interface elements like the Advanced Search panel<\/li>\n<li>First-class support for multiple trees, to be followed by more actual trees<\/li>\n<li>A real query parser. You can express quotation marks without resorting to regexes, and you can use quoted strings as arguments to filters.<\/li>\n<li>No more astonishing, disappearing splash page<\/li>\n<p>Check out our <a href=\"https:\/\/wiki.mozilla.org\/DXR_UI_Refresh#Initial_Page\">mockups<\/a> and our sometimes-broken <a href=\"http:\/\/dxr.allizom.org\/\">staging site<\/a>, and do keep the feedback coming. All of the above work was motivated by <a href=\"https:\/\/wiki.mozilla.org\/DXR_UI_Refresh#Feedback\">the comments you&#8217;ve already given us<\/a>.<\/p>\n<p>Happy hacking!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DXR, Mozilla&#8217;s evolving codebase search engine, has been taking patches at a furious rate these last two months. A great deal of work has gone into a UI refit, still in progress, which will improve discoverability, consistency, and power. Meanwhile, &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/\">Continue reading<\/a><\/p>\n","protected":false},"author":213,"featured_media":3502,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4712,731,288],"tags":[20275,20274,91,610,625],"coauthors":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>DXR gets more correct, less case-sensitive - Mozilla Web Development<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Erik Rose\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/\",\"url\":\"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/\",\"name\":\"DXR gets more correct, less case-sensitive - Mozilla Web Development\",\"isPartOf\":{\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/blog.mozilla.org\/webdev\/files\/2013\/06\/Screen-Shot-2013-06-13-at-12.12.17-.png\",\"datePublished\":\"2014-01-16T22:37:59+00:00\",\"dateModified\":\"2014-01-16T22:37:59+00:00\",\"author\":{\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/#\/schema\/person\/e99c85edf86c46b46e5284384d5a7c12\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/#primaryimage\",\"url\":\"https:\/\/blog.mozilla.org\/webdev\/files\/2013\/06\/Screen-Shot-2013-06-13-at-12.12.17-.png\",\"contentUrl\":\"https:\/\/blog.mozilla.org\/webdev\/files\/2013\/06\/Screen-Shot-2013-06-13-at-12.12.17-.png\",\"width\":273,\"height\":209},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.mozilla.org\/webdev\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DXR gets more correct, less case-sensitive\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/#website\",\"url\":\"https:\/\/blog.mozilla.org\/webdev\/\",\"name\":\"Mozilla Web Development\",\"description\":\"For make benefit of glorious tubes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.mozilla.org\/webdev\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/#\/schema\/person\/e99c85edf86c46b46e5284384d5a7c12\",\"name\":\"Erik Rose\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/#\/schema\/person\/image\/1c7953cea7e690a9e31cf08a4d68d829\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/73bfa51d6f44afed026160b59299faf2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/73bfa51d6f44afed026160b59299faf2?s=96&d=mm&r=g\",\"caption\":\"Erik Rose\"},\"description\":\"Erik chips away at the barrier between human cognition and machine execution, through projects like DXR (search &amp; static analysis on Mozilla codebases), Fathom (semantic extraction from web pages), parsers, new languages, and a whole mess of Python libraries.\",\"sameAs\":[\"https:\/\/www.grinchcentral.com\/\",\"https:\/\/x.com\/ErikRose\"],\"url\":\"https:\/\/blog.mozilla.org\/webdev\/author\/erosemozilla-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"DXR gets more correct, less case-sensitive - Mozilla Web Development","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/","twitter_misc":{"Written by":"Erik Rose","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/","url":"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/","name":"DXR gets more correct, less case-sensitive - Mozilla Web Development","isPartOf":{"@id":"https:\/\/blog.mozilla.org\/webdev\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/#primaryimage"},"image":{"@id":"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.mozilla.org\/webdev\/files\/2013\/06\/Screen-Shot-2013-06-13-at-12.12.17-.png","datePublished":"2014-01-16T22:37:59+00:00","dateModified":"2014-01-16T22:37:59+00:00","author":{"@id":"https:\/\/blog.mozilla.org\/webdev\/#\/schema\/person\/e99c85edf86c46b46e5284384d5a7c12"},"breadcrumb":{"@id":"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/#primaryimage","url":"https:\/\/blog.mozilla.org\/webdev\/files\/2013\/06\/Screen-Shot-2013-06-13-at-12.12.17-.png","contentUrl":"https:\/\/blog.mozilla.org\/webdev\/files\/2013\/06\/Screen-Shot-2013-06-13-at-12.12.17-.png","width":273,"height":209},{"@type":"BreadcrumbList","@id":"https:\/\/blog.mozilla.org\/webdev\/2014\/01\/16\/dxr-gets-more-correct-less-case-sensitive\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.mozilla.org\/webdev\/"},{"@type":"ListItem","position":2,"name":"DXR gets more correct, less case-sensitive"}]},{"@type":"WebSite","@id":"https:\/\/blog.mozilla.org\/webdev\/#website","url":"https:\/\/blog.mozilla.org\/webdev\/","name":"Mozilla Web Development","description":"For make benefit of glorious tubes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.mozilla.org\/webdev\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.mozilla.org\/webdev\/#\/schema\/person\/e99c85edf86c46b46e5284384d5a7c12","name":"Erik Rose","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/webdev\/#\/schema\/person\/image\/1c7953cea7e690a9e31cf08a4d68d829","url":"https:\/\/secure.gravatar.com\/avatar\/73bfa51d6f44afed026160b59299faf2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/73bfa51d6f44afed026160b59299faf2?s=96&d=mm&r=g","caption":"Erik Rose"},"description":"Erik chips away at the barrier between human cognition and machine execution, through projects like DXR (search &amp; static analysis on Mozilla codebases), Fathom (semantic extraction from web pages), parsers, new languages, and a whole mess of Python libraries.","sameAs":["https:\/\/www.grinchcentral.com\/","https:\/\/x.com\/ErikRose"],"url":"https:\/\/blog.mozilla.org\/webdev\/author\/erosemozilla-com\/"}]}},"jetpack_featured_media_url":"https:\/\/blog.mozilla.org\/webdev\/files\/2013\/06\/Screen-Shot-2013-06-13-at-12.12.17-.png","_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/posts\/3658"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/users\/213"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/comments?post=3658"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/posts\/3658\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/media\/3502"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/media?parent=3658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/categories?post=3658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/tags?post=3658"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/coauthors?post=3658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}