Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 5f7bfaa

Browse files
committed
SVG code hints cleanup
1 parent f9cd4f7 commit 5f7bfaa

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/extensions/default/SVGCodeHints/SVGAttributes.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@
1111
"animate/fill": {
1212
"attribOptions": ["freeze", "remove"]
1313
},
14+
"animateColor/fill": {
15+
"attribOptions": ["freeze", "remove"]
16+
},
17+
"animateMotion/fill": {
18+
"attribOptions": ["freeze", "remove"]
19+
},
20+
"animateTransform/fill": {
21+
"attribOptions": ["freeze", "remove"]
22+
},
1423
"animateTransform/type": {
1524
"attribOptions": ["rotate", "scale", "skewX", "skewY", "translate"]
1625
},
@@ -262,6 +271,9 @@
262271
"script/type": {
263272
"attribOptions": ["application/ecmascript", "application/javascript", "application/x-ecmascript", "application/x-javascript", "text/ecmascript", "text/javascript", "text/jscript", "text/livescript", "text/tcl", "text/x-ecmascript", "text/x-javascript"]
264273
},
274+
"set/fill": {
275+
"attribOptions": ["freeze", "remove"]
276+
},
265277
"shape-rendering": {
266278
"attribOptions": ["auto", "crispEdges", "geometricPrecision", "inherit", "optimizeSpeed"]
267279
},

src/extensions/default/SVGCodeHints/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ define(function (require, exports, module) {
3434
XMLUtils = brackets.getModule("language/XMLUtils"),
3535
StringMatch = brackets.getModule("utils/StringMatch"),
3636
ExtensionUtils = brackets.getModule("utils/ExtensionUtils"),
37+
_ = brackets.getModule("thirdparty/lodash"),
3738
SVGTags = require("text!SVGTags.json"),
3839
SVGAttributes = require("text!SVGAttributes.json"),
3940
cachedAttributes = {},
@@ -85,7 +86,7 @@ define(function (require, exports, module) {
8586
cachedAttributes[tagName] = cachedAttributes[tagName].concat(tagData.attributeGroups[group]);
8687
}
8788
});
88-
cachedAttributes[tagName].sort();
89+
cachedAttributes[tagName] = _.uniq(cachedAttributes[tagName].sort(), true);
8990
}
9091
return cachedAttributes[tagName];
9192
}
@@ -96,7 +97,7 @@ define(function (require, exports, module) {
9697
*
9798
* @param {Array.<Object>} hints - the list of hints to format
9899
* @param {string} query - querystring used for highlighting matched
99-
* poritions of each hint
100+
* portions of each hint
100101
* @return {Array.jQuery} sorted Array of jQuery DOM elements to insert
101102
*/
102103
function formatHints(hints, query) {

src/extensions/default/SVGCodeHints/styles/brackets-svg-hints.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
.brackets-svg-hints .matched-hint {
2525
font-weight: 500;
26-
color: #000;
2726
}
2827
.dark .brackets-svg-hints .matched-hint {
2928
color: #ccc;

0 commit comments

Comments
 (0)