{"action":"created","issue":{"url":"https://api.github.com/repos/atom/atom/issues/9513","labels_url":"https://api.github.com/repos/atom/atom/issues/9513/labels{/name}","comments_url":"https://api.github.com/repos/atom/atom/issues/9513/comments","events_url":"https://api.github.com/repos/atom/atom/issues/9513/events","html_url":"https://github.com/atom/atom/pull/9513","id":116182589,"number":9513,"title":"Prioritize file type matching over first line matching in grammar scoring system","user":{"login":"Ingramz","id":1017132,"avatar_url":"https://avatars.githubusercontent.com/u/1017132?v=3","gravatar_id":"","url":"https://api.github.com/users/Ingramz","html_url":"https://github.com/Ingramz","followers_url":"https://api.github.com/users/Ingramz/followers","following_url":"https://api.github.com/users/Ingramz/following{/other_user}","gists_url":"https://api.github.com/users/Ingramz/gists{/gist_id}","starred_url":"https://api.github.com/users/Ingramz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ingramz/subscriptions","organizations_url":"https://api.github.com/users/Ingramz/orgs","repos_url":"https://api.github.com/users/Ingramz/repos","events_url":"https://api.github.com/users/Ingramz/events{/privacy}","received_events_url":"https://api.github.com/users/Ingramz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-11-10T19:24:36Z","updated_at":"2015-11-12T23:12:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/atom/atom/pulls/9513","html_url":"https://github.com/atom/atom/pull/9513","diff_url":"https://github.com/atom/atom/pull/9513.diff","patch_url":"https://github.com/atom/atom/pull/9513.patch"},"body":"Fixes atom/atom#2734\r\n\r\nThis is a pull request version of https://github.com/atom/atom/issues/2734#issuecomment-155230824 in order to work together on solving the currently unfair grammar scoring system. The main problem with the current system is that it gives a higher score to HTML grammar for any file that begins with HTML doctype, but the file might be using PHP or some other (templating) language that utilizes HTML syntax (with a different file type, eg `php`).\r\n\r\n@nathansobo suggested adding an option to fall back to using the old system in case the new one breaks something, but I am not sure how to do that exactly. Also another question would be whether this transition period is needed at all, because all it \"breaks\" right now is grammar selection for files, for which there is a known file type, but the first line is matched from some other grammar. A fix for that case would be just adding the file type via user configuration, to override the known type from the other language."},"comment":{"url":"https://api.github.com/repos/atom/atom/issues/comments/156266583","html_url":"https://github.com/atom/atom/pull/9513#issuecomment-156266583","issue_url":"https://api.github.com/repos/atom/atom/issues/9513","id":156266583,"user":{"login":"nathansobo","id":1789,"avatar_url":"https://avatars.githubusercontent.com/u/1789?v=3","gravatar_id":"","url":"https://api.github.com/users/nathansobo","html_url":"https://github.com/nathansobo","followers_url":"https://api.github.com/users/nathansobo/followers","following_url":"https://api.github.com/users/nathansobo/following{/other_user}","gists_url":"https://api.github.com/users/nathansobo/gists{/gist_id}","starred_url":"https://api.github.com/users/nathansobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathansobo/subscriptions","organizations_url":"https://api.github.com/users/nathansobo/orgs","repos_url":"https://api.github.com/users/nathansobo/repos","events_url":"https://api.github.com/users/nathansobo/events{/privacy}","received_events_url":"https://api.github.com/users/nathansobo/received_events","type":"User","site_admin":true},"created_at":"2015-11-12T23:12:25Z","updated_at":"2015-11-12T23:12:25Z","body":"Okay. I'm a bit nervous that I'm not thinking through some implication but this is why we have a beta phase. Merging. Thanks @Ingramz for the thoughtful implementation here. Awesome work."}}