{"action":"created","issue":{"url":"https://api.github.com/repos/atom/bracket-matcher/issues/346","repository_url":"https://api.github.com/repos/atom/bracket-matcher","labels_url":"https://api.github.com/repos/atom/bracket-matcher/issues/346/labels{/name}","comments_url":"https://api.github.com/repos/atom/bracket-matcher/issues/346/comments","events_url":"https://api.github.com/repos/atom/bracket-matcher/issues/346/events","html_url":"https://github.com/atom/bracket-matcher/pull/346","id":306324153,"number":346,"title":"Eliminate uneccesary calls to isRangeCommentedOrString","user":{"login":"Doekeb","id":13689478,"avatar_url":"https://avatars0.githubusercontent.com/u/13689478?v=4","gravatar_id":"","url":"https://api.github.com/users/Doekeb","html_url":"https://github.com/Doekeb","followers_url":"https://api.github.com/users/Doekeb/followers","following_url":"https://api.github.com/users/Doekeb/following{/other_user}","gists_url":"https://api.github.com/users/Doekeb/gists{/gist_id}","starred_url":"https://api.github.com/users/Doekeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Doekeb/subscriptions","organizations_url":"https://api.github.com/users/Doekeb/orgs","repos_url":"https://api.github.com/users/Doekeb/repos","events_url":"https://api.github.com/users/Doekeb/events{/privacy}","received_events_url":"https://api.github.com/users/Doekeb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-19T03:42:56Z","updated_at":"2018-03-20T13:11:52Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/atom/bracket-matcher/pulls/346","html_url":"https://github.com/atom/bracket-matcher/pull/346","diff_url":"https://github.com/atom/bracket-matcher/pull/346.diff","patch_url":"https://github.com/atom/bracket-matcher/pull/346.patch"},"body":"### Requirements\r\n\r\n* Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.\r\n* All new code requires tests to ensure against regressions\r\n\r\n### Description of the Change\r\n\r\n<!--\r\n\r\nWe must be able to understand the design of your change from this description. If we can't get a good idea of what the code will be doing from the description here, the pull request may be closed at the maintainers' discretion. Keep in mind that the maintainer reviewing this PR may not be familiar with or have worked with the code here recently, so please walk us through the concepts.\r\n\r\n-->\r\n\r\nFixes #341.\r\n\r\nBy design, brackets inside strings or comments are not matched. The previous behavior was that when the cursor was next to any bracket, even a bracket inside a comment or string, a search was performed for that bracket's closing pair. That search passes over comment or string scopes, so if a line read `\"(example words [cursor here])\"`, bracket-manager would search the entire document and ultimately fail to find a match for the last `)`, even though it should not have performed the search in the first place. This PR simply stops bracket-manager from performing these searches when the bracket in question is in a comment or string scope.\r\n\r\n### Alternate Designs\r\n\r\n<!-- Explain what other alternates were considered and why the proposed version was selected -->\r\n\r\n_Do_ match brackets inside strings and comments. This has already been shown to be a bad idea.\r\n\r\n### Benefits\r\n\r\n<!-- What benefits will be realized by the code change? -->\r\n\r\nMuch faster performance in large files with many brackets. For instance, in [language-latex](https://github.com/area/language-latex), the following is considered a string scope: `$here is some math$` so in a long document with lots of braces (almost any medium/long math paper fits this description), either of the following, or anything similar, would cause significant lag:\r\n`$\\frac{numerator}{demonimator[cursor here]}$`\r\n`$\\sum_{n=1[cursor here]}^\\infty n$`.\r\n\r\n### Possible Drawbacks\r\n\r\n<!-- What are the possible side-effects or negative impacts of the code change? -->\r\n\r\nNone.\r\n\r\n### Applicable Issues\r\n\r\n<!-- Enter any applicable Issues here -->\r\n\r\n#341\r\nJames-Yu/Atom-LaTeX#131"},"comment":{"url":"https://api.github.com/repos/atom/bracket-matcher/issues/comments/374591824","html_url":"https://github.com/atom/bracket-matcher/pull/346#issuecomment-374591824","issue_url":"https://api.github.com/repos/atom/bracket-matcher/issues/346","id":374591824,"user":{"login":"smashwilson","id":17565,"avatar_url":"https://avatars2.githubusercontent.com/u/17565?v=4","gravatar_id":"","url":"https://api.github.com/users/smashwilson","html_url":"https://github.com/smashwilson","followers_url":"https://api.github.com/users/smashwilson/followers","following_url":"https://api.github.com/users/smashwilson/following{/other_user}","gists_url":"https://api.github.com/users/smashwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/smashwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smashwilson/subscriptions","organizations_url":"https://api.github.com/users/smashwilson/orgs","repos_url":"https://api.github.com/users/smashwilson/repos","events_url":"https://api.github.com/users/smashwilson/events{/privacy}","received_events_url":"https://api.github.com/users/smashwilson/received_events","type":"User","site_admin":true},"created_at":"2018-03-20T13:11:52Z","updated_at":"2018-03-20T13:11:52Z","author_association":"OWNER","body":"👍 Nice."}}
{"actor":{"display_login":"smashwilson"}}