{"action":"created","comment":{"url":"https://api.github.com/repos/adobe/brackets/pulls/comments/22438003","id":22438003,"diff_hunk":"@@ -0,0 +1,268 @@\n+/*\n+ * Copyright (c) 2015 Amin Ullah Khan. All rights reserved.\n+ *  \n+ * Permission is hereby granted, free of charge, to any person obtaining a\n+ * copy of this software and associated documentation files (the \"Software\"), \n+ * to deal in the Software without restriction, including without limitation \n+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, \n+ * and/or sell copies of the Software, and to permit persons to whom the \n+ * Software is furnished to do so, subject to the following conditions:\n+ *  \n+ * The above copyright notice and this permission notice shall be included in\n+ * all copies or substantial portions of the Software.\n+ *  \n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \n+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER \n+ * DEALINGS IN THE SOFTWARE.\n+ * \n+ */\n+\n+/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */\n+/*global define, brackets */\n+\n+define(function (require, exports, module) {\n+    \"use strict\";\n+    \n+    // Load dependencies.\n+    var AppInit             = brackets.getModule(\"utils/AppInit\"),\n+        CodeHintManager     = brackets.getModule(\"editor/CodeHintManager\"),\n+        PreferencesManager  = brackets.getModule(\"preferences/PreferencesManager\"),\n+        SVGUtils            = require(\"./SVGUtils\"),\n+        SVGTags             = require(\"text!SVGTags.json\"),\n+        SVGAttributes       = require(\"text!SVGAttributes.json\"),\n+        tagData,\n+        attributeData,\n+        isSVGEnabled;\n+\n+    // Define our own pref for hinting.\n+    PreferencesManager.definePreference(\"codehint.SVGHints\", \"boolean\", true);\n+    \n+    // Preferences to control hint.\n+    function _isSVGHintsEnabled() {\n+        return (PreferencesManager.get(\"codehint.SVGHints\") !== false &&\n+                PreferencesManager.get(\"showCodeHints\") !== false);\n+    }\n+    \n+    /**\n+     * Returns a list of attributes used by a tag.\n+     * \n+     * @param {string} tagName name of the SVG tag.\n+     * @return {Array.<string>} list of attributes.\n+     */\n+    function getTagAttributes(tagName) {\n+        var attributes = [], tag;\n+        \n+        tag = tagData.tags[tagName];\n+        if (tag.attributes) {\n+            attributes = attributes.concat(tag.attributes);\n+        }\n+        \n+        tag.groups.forEach(function (group) {\n+            attributes = attributes.concat(tagData.groups[group]);\n+        });","path":"src/extensions/default/SVGCodeHints/main.js","position":66,"original_position":66,"commit_id":"e65fd3fe2f1f27f1b4ec580301df6234ea9f4cbd","original_commit_id":"e65fd3fe2f1f27f1b4ec580301df6234ea9f4cbd","user":{"login":"sprintr","id":3390089,"avatar_url":"https://avatars.githubusercontent.com/u/3390089?v=3","gravatar_id":"","url":"https://api.github.com/users/sprintr","html_url":"https://github.com/sprintr","followers_url":"https://api.github.com/users/sprintr/followers","following_url":"https://api.github.com/users/sprintr/following{/other_user}","gists_url":"https://api.github.com/users/sprintr/gists{/gist_id}","starred_url":"https://api.github.com/users/sprintr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sprintr/subscriptions","organizations_url":"https://api.github.com/users/sprintr/orgs","repos_url":"https://api.github.com/users/sprintr/repos","events_url":"https://api.github.com/users/sprintr/events{/privacy}","received_events_url":"https://api.github.com/users/sprintr/received_events","type":"User","site_admin":false},"body":"@MarcelGerber I changed the format of SVGTags.json, so its makes this function more shorter and easy to read.","created_at":"2015-01-04T09:54:47Z","updated_at":"2015-01-04T09:54:47Z","html_url":"https://github.com/adobe/brackets/pull/10294#discussion_r22438003","pull_request_url":"https://api.github.com/repos/adobe/brackets/pulls/10294","_links":{"self":{"href":"https://api.github.com/repos/adobe/brackets/pulls/comments/22438003"},"html":{"href":"https://github.com/adobe/brackets/pull/10294#discussion_r22438003"},"pull_request":{"href":"https://api.github.com/repos/adobe/brackets/pulls/10294"}}},"pull_request":{"url":"https://api.github.com/repos/adobe/brackets/pulls/10294","id":26742563,"html_url":"https://github.com/adobe/brackets/pull/10294","diff_url":"https://github.com/adobe/brackets/pull/10294.diff","patch_url":"https://github.com/adobe/brackets/pull/10294.patch","issue_url":"https://api.github.com/repos/adobe/brackets/issues/10294","number":10294,"state":"open","locked":false,"title":"[REVIEW ONLY] SVG Code Hints","user":{"login":"sprintr","id":3390089,"avatar_url":"https://avatars.githubusercontent.com/u/3390089?v=3","gravatar_id":"","url":"https://api.github.com/users/sprintr","html_url":"https://github.com/sprintr","followers_url":"https://api.github.com/users/sprintr/followers","following_url":"https://api.github.com/users/sprintr/following{/other_user}","gists_url":"https://api.github.com/users/sprintr/gists{/gist_id}","starred_url":"https://api.github.com/users/sprintr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sprintr/subscriptions","organizations_url":"https://api.github.com/users/sprintr/orgs","repos_url":"https://api.github.com/users/sprintr/repos","events_url":"https://api.github.com/users/sprintr/events{/privacy}","received_events_url":"https://api.github.com/users/sprintr/received_events","type":"User","site_admin":false},"body":"This is a follow up of #10084, adds Code Hints for SVG.\r\n\r\nCC: @redmunds","created_at":"2015-01-01T11:58:35Z","updated_at":"2015-01-04T09:54:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9015826d6bec87c51a9beb9959a4bba8f1ef5b1","assignee":{"login":"redmunds","id":1197144,"avatar_url":"https://avatars.githubusercontent.com/u/1197144?v=3","gravatar_id":"","url":"https://api.github.com/users/redmunds","html_url":"https://github.com/redmunds","followers_url":"https://api.github.com/users/redmunds/followers","following_url":"https://api.github.com/users/redmunds/following{/other_user}","gists_url":"https://api.github.com/users/redmunds/gists{/gist_id}","starred_url":"https://api.github.com/users/redmunds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redmunds/subscriptions","organizations_url":"https://api.github.com/users/redmunds/orgs","repos_url":"https://api.github.com/users/redmunds/repos","events_url":"https://api.github.com/users/redmunds/events{/privacy}","received_events_url":"https://api.github.com/users/redmunds/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/adobe/brackets/pulls/10294/commits","review_comments_url":"https://api.github.com/repos/adobe/brackets/pulls/10294/comments","review_comment_url":"https://api.github.com/repos/adobe/brackets/pulls/comments/{number}","comments_url":"https://api.github.com/repos/adobe/brackets/issues/10294/comments","statuses_url":"https://api.github.com/repos/adobe/brackets/statuses/e65fd3fe2f1f27f1b4ec580301df6234ea9f4cbd","head":{"label":"sprintr:master","ref":"master","sha":"e65fd3fe2f1f27f1b4ec580301df6234ea9f4cbd","user":{"login":"sprintr","id":3390089,"avatar_url":"https://avatars.githubusercontent.com/u/3390089?v=3","gravatar_id":"","url":"https://api.github.com/users/sprintr","html_url":"https://github.com/sprintr","followers_url":"https://api.github.com/users/sprintr/followers","following_url":"https://api.github.com/users/sprintr/following{/other_user}","gists_url":"https://api.github.com/users/sprintr/gists{/gist_id}","starred_url":"https://api.github.com/users/sprintr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sprintr/subscriptions","organizations_url":"https://api.github.com/users/sprintr/orgs","repos_url":"https://api.github.com/users/sprintr/repos","events_url":"https://api.github.com/users/sprintr/events{/privacy}","received_events_url":"https://api.github.com/users/sprintr/received_events","type":"User","site_admin":false},"repo":{"id":28557649,"name":"brackets","full_name":"sprintr/brackets","owner":{"login":"sprintr","id":3390089,"avatar_url":"https://avatars.githubusercontent.com/u/3390089?v=3","gravatar_id":"","url":"https://api.github.com/users/sprintr","html_url":"https://github.com/sprintr","followers_url":"https://api.github.com/users/sprintr/followers","following_url":"https://api.github.com/users/sprintr/following{/other_user}","gists_url":"https://api.github.com/users/sprintr/gists{/gist_id}","starred_url":"https://api.github.com/users/sprintr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sprintr/subscriptions","organizations_url":"https://api.github.com/users/sprintr/orgs","repos_url":"https://api.github.com/users/sprintr/repos","events_url":"https://api.github.com/users/sprintr/events{/privacy}","received_events_url":"https://api.github.com/users/sprintr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sprintr/brackets","description":"An open source code editor for the web, written in JavaScript, HTML and CSS.","fork":true,"url":"https://api.github.com/repos/sprintr/brackets","forks_url":"https://api.github.com/repos/sprintr/brackets/forks","keys_url":"https://api.github.com/repos/sprintr/brackets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sprintr/brackets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sprintr/brackets/teams","hooks_url":"https://api.github.com/repos/sprintr/brackets/hooks","issue_events_url":"https://api.github.com/repos/sprintr/brackets/issues/events{/number}","events_url":"https://api.github.com/repos/sprintr/brackets/events","assignees_url":"https://api.github.com/repos/sprintr/brackets/assignees{/user}","branches_url":"https://api.github.com/repos/sprintr/brackets/branches{/branch}","tags_url":"https://api.github.com/repos/sprintr/brackets/tags","blobs_url":"https://api.github.com/repos/sprintr/brackets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sprintr/brackets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sprintr/brackets/git/refs{/sha}","trees_url":"https://api.github.com/repos/sprintr/brackets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sprintr/brackets/statuses/{sha}","languages_url":"https://api.github.com/repos/sprintr/brackets/languages","stargazers_url":"https://api.github.com/repos/sprintr/brackets/stargazers","contributors_url":"https://api.github.com/repos/sprintr/brackets/contributors","subscribers_url":"https://api.github.com/repos/sprintr/brackets/subscribers","subscription_url":"https://api.github.com/repos/sprintr/brackets/subscription","commits_url":"https://api.github.com/repos/sprintr/brackets/commits{/sha}","git_commits_url":"https://api.github.com/repos/sprintr/brackets/git/commits{/sha}","comments_url":"https://api.github.com/repos/sprintr/brackets/comments{/number}","issue_comment_url":"https://api.github.com/repos/sprintr/brackets/issues/comments/{number}","contents_url":"https://api.github.com/repos/sprintr/brackets/contents/{+path}","compare_url":"https://api.github.com/repos/sprintr/brackets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sprintr/brackets/merges","archive_url":"https://api.github.com/repos/sprintr/brackets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sprintr/brackets/downloads","issues_url":"https://api.github.com/repos/sprintr/brackets/issues{/number}","pulls_url":"https://api.github.com/repos/sprintr/brackets/pulls{/number}","milestones_url":"https://api.github.com/repos/sprintr/brackets/milestones{/number}","notifications_url":"https://api.github.com/repos/sprintr/brackets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sprintr/brackets/labels{/name}","releases_url":"https://api.github.com/repos/sprintr/brackets/releases{/id}","created_at":"2014-12-28T08:46:04Z","updated_at":"2015-01-04T09:43:14Z","pushed_at":"2015-01-04T09:43:14Z","git_url":"git://github.com/sprintr/brackets.git","ssh_url":"git@github.com:sprintr/brackets.git","clone_url":"https://github.com/sprintr/brackets.git","svn_url":"https://github.com/sprintr/brackets","homepage":"http://brackets.io","size":75523,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"adobe:master","ref":"master","sha":"5e7fd6031b8f72dc0e688b5d8ee176a87787edd3","user":{"login":"adobe","id":476009,"avatar_url":"https://avatars.githubusercontent.com/u/476009?v=3","gravatar_id":"","url":"https://api.github.com/users/adobe","html_url":"https://github.com/adobe","followers_url":"https://api.github.com/users/adobe/followers","following_url":"https://api.github.com/users/adobe/following{/other_user}","gists_url":"https://api.github.com/users/adobe/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe/subscriptions","organizations_url":"https://api.github.com/users/adobe/orgs","repos_url":"https://api.github.com/users/adobe/repos","events_url":"https://api.github.com/users/adobe/events{/privacy}","received_events_url":"https://api.github.com/users/adobe/received_events","type":"Organization","site_admin":false},"repo":{"id":2935735,"name":"brackets","full_name":"adobe/brackets","owner":{"login":"adobe","id":476009,"avatar_url":"https://avatars.githubusercontent.com/u/476009?v=3","gravatar_id":"","url":"https://api.github.com/users/adobe","html_url":"https://github.com/adobe","followers_url":"https://api.github.com/users/adobe/followers","following_url":"https://api.github.com/users/adobe/following{/other_user}","gists_url":"https://api.github.com/users/adobe/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe/subscriptions","organizations_url":"https://api.github.com/users/adobe/orgs","repos_url":"https://api.github.com/users/adobe/repos","events_url":"https://api.github.com/users/adobe/events{/privacy}","received_events_url":"https://api.github.com/users/adobe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/adobe/brackets","description":"An open source code editor for the web, written in JavaScript, HTML and CSS.","fork":false,"url":"https://api.github.com/repos/adobe/brackets","forks_url":"https://api.github.com/repos/adobe/brackets/forks","keys_url":"https://api.github.com/repos/adobe/brackets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adobe/brackets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adobe/brackets/teams","hooks_url":"https://api.github.com/repos/adobe/brackets/hooks","issue_events_url":"https://api.github.com/repos/adobe/brackets/issues/events{/number}","events_url":"https://api.github.com/repos/adobe/brackets/events","assignees_url":"https://api.github.com/repos/adobe/brackets/assignees{/user}","branches_url":"https://api.github.com/repos/adobe/brackets/branches{/branch}","tags_url":"https://api.github.com/repos/adobe/brackets/tags","blobs_url":"https://api.github.com/repos/adobe/brackets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adobe/brackets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adobe/brackets/git/refs{/sha}","trees_url":"https://api.github.com/repos/adobe/brackets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adobe/brackets/statuses/{sha}","languages_url":"https://api.github.com/repos/adobe/brackets/languages","stargazers_url":"https://api.github.com/repos/adobe/brackets/stargazers","contributors_url":"https://api.github.com/repos/adobe/brackets/contributors","subscribers_url":"https://api.github.com/repos/adobe/brackets/subscribers","subscription_url":"https://api.github.com/repos/adobe/brackets/subscription","commits_url":"https://api.github.com/repos/adobe/brackets/commits{/sha}","git_commits_url":"https://api.github.com/repos/adobe/brackets/git/commits{/sha}","comments_url":"https://api.github.com/repos/adobe/brackets/comments{/number}","issue_comment_url":"https://api.github.com/repos/adobe/brackets/issues/comments/{number}","contents_url":"https://api.github.com/repos/adobe/brackets/contents/{+path}","compare_url":"https://api.github.com/repos/adobe/brackets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adobe/brackets/merges","archive_url":"https://api.github.com/repos/adobe/brackets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adobe/brackets/downloads","issues_url":"https://api.github.com/repos/adobe/brackets/issues{/number}","pulls_url":"https://api.github.com/repos/adobe/brackets/pulls{/number}","milestones_url":"https://api.github.com/repos/adobe/brackets/milestones{/number}","notifications_url":"https://api.github.com/repos/adobe/brackets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adobe/brackets/labels{/name}","releases_url":"https://api.github.com/repos/adobe/brackets/releases{/id}","created_at":"2011-12-07T21:14:40Z","updated_at":"2015-01-04T06:45:26Z","pushed_at":"2015-01-04T00:46:25Z","git_url":"git://github.com/adobe/brackets.git","ssh_url":"git@github.com:adobe/brackets.git","clone_url":"https://github.com/adobe/brackets.git","svn_url":"https://github.com/adobe/brackets","homepage":"http://brackets.io","size":301452,"stargazers_count":20452,"watchers_count":20452,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4247,"mirror_url":null,"open_issues_count":1134,"forks":4247,"open_issues":1134,"watchers":20452,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adobe/brackets/pulls/10294"},"html":{"href":"https://github.com/adobe/brackets/pull/10294"},"issue":{"href":"https://api.github.com/repos/adobe/brackets/issues/10294"},"comments":{"href":"https://api.github.com/repos/adobe/brackets/issues/10294/comments"},"review_comments":{"href":"https://api.github.com/repos/adobe/brackets/pulls/10294/comments"},"review_comment":{"href":"https://api.github.com/repos/adobe/brackets/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/adobe/brackets/pulls/10294/commits"},"statuses":{"href":"https://api.github.com/repos/adobe/brackets/statuses/e65fd3fe2f1f27f1b4ec580301df6234ea9f4cbd"}}}}