You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
List of all bracket pairs that is keyed by opening brackets, and the inverted listthat is keyed by closing brackets.
16
-
17
11
**Kind**: global variable
18
12
<aname="isCSSPreprocessorFile"></a>
19
13
@@ -43,13 +37,16 @@ Returns a context info object for the given cursor position
43
37
<aname="getInfoAtPos.._contextCM"></a>
44
38
45
39
### getInfoAtPos.\_contextCM
46
-
We will use this CM to cook css context in case of style attribute valueas CM in htmlmixed mode doesn't yet identify this as css context. We providea no-op display function to run CM without a DOM head.
40
+
We will use this CM to cook css context in case of style attribute value
41
+
as CM in htmlmixed mode doesn't yet identify this as css context. We provide
42
+
a no-op display function to run CM without a DOM head.
47
43
48
44
**Kind**: inner property of [<code>getInfoAtPos</code>](#getInfoAtPos)
Finds all instances of the specified selector in "text".Returns an Array of Objects with start and end properties.For now, we only support simple selectors. This function will need to changedramatically to support full selectors.FUTURE: (JRB) It would be nice to eventually use the browser/jquery to do the selector evaluation.One way to do this would be to take the user's HTML, add a special attribute to every tag with a UID,and then construct a DOM (using the commented out code above). Then, give this DOM and the selector tojquery and ask what matches. If the node that the user's cursor is in comes back from jquery, thenwe know the selector applies.
124
-
125
-
**Kind**: global function
126
-
**Returns**: <code>Object</code> - Array of objects containing the start and end line numbers (0-based, inclusive range) for each matched selector.
127
-
128
-
| Param | Type | Description |
129
-
| --- | --- | --- |
130
-
| text | <code>string</code> | CSS text to search |
131
-
| selector | <code>string</code> | selector to search for |
132
-
| mode | <code>string</code> | language mode of the document that text belongs to |
Converts the results of _findAllMatchingSelectorsInText() into a simpler bag of data andappends those new objects to the given 'resultSelectors' Array.
| lineOffset | <code>number</code> | Amount to offset all line number info by. Used if the first line of the parsed CSS text is not the first line of the sourceDoc. |
147
-
148
-
<aname="_findMatchingRulesInCSSFiles"></a>
149
-
150
-
## \_findMatchingRulesInCSSFiles()
151
-
Finds matching selectors in CSS files; adds them to 'resultSelectors'
152
-
153
-
**Kind**: global function
154
-
<aname="_findMatchingRulesInStyleBlocks"></a>
155
-
156
-
## \_findMatchingRulesInStyleBlocks()
157
-
Finds matching selectors in the 'style' block of a single HTML file; adds them to 'resultSelectors'
Return all rules matching the specified selector.For now, we only look at the rightmost simple selector. For example, searching for ".foo" willmatch these rules: .foo {} div .foo {} div.foo {} div .foo[bar="42"] {} div .foo:hovered {} div .foo::first-childbut will *not* match these rules: .foobar {} .foo .bar {} div .foo .bar {} .foo.bar {}
164
-
165
-
**Kind**: global function
166
-
**Returns**: <code>$.Promise</code> - that will be resolved with an Array of objects containing the source document, start line, and end line (0-based, inclusive range) for each matching declaration list. Does not addRef() the documents returned in the array.
99
+
Return all rules matching the specified selector.
100
+
For now, we only look at the rightmost simple selector. For example, searching for ".foo" will
101
+
match these rules:
102
+
.foo {}
103
+
div .foo {}
104
+
div.foo {}
105
+
div .foo[bar="42"] {}
106
+
div .foo:hovered {}
107
+
div .foo::first-child
108
+
but will *not* match these rules:
109
+
.foobar {}
110
+
.foo .bar {}
111
+
div .foo .bar {}
112
+
.foo.bar {}
113
+
114
+
**Kind**: global function
115
+
**Returns**: <code>$.Promise</code> - that will be resolved with an Array of objects containing the
116
+
source document, start line, and end line (0-based, inclusive range) for each matching declaration list.
117
+
Does not addRef() the documents returned in the array.
167
118
168
119
| Param | Type | Description |
169
120
| --- | --- | --- |
@@ -173,44 +124,24 @@ Return all rules matching the specified selector.For now, we only look at the r
Returns the selector(s) of the rule at the specified document pos, or "" if the position isis not within a style rule.
127
+
Returns the selector(s) of the rule at the specified document pos, or "" if the position is
128
+
is not within a style rule.
177
129
178
130
**Kind**: global function
179
-
**Returns**: <code>string</code> - Selector(s) for the rule at the specified position, or "" if the position is not within a style rule. If the rule has multiple selectors, a comma-separated selector string is returned.
131
+
**Returns**: <code>string</code> - Selector(s) for the rule at the specified position, or "" if the position
132
+
is not within a style rule. If the rule has multiple selectors, a comma-separated
133
+
selector string is returned.
180
134
181
135
| Param | Type | Description |
182
136
| --- | --- | --- |
183
137
| editor | <code>Editor</code> | Editor to search |
184
138
| pos | <code>Object</code> | Position to search |
Adds a new rule to the end of the given document, and returns the range of the added ruleand the position of the cursor on the indented blank line within it. Note that the range willnot include all the inserted text (we insert extra newlines before and after the rule).
156
+
Adds a new rule to the end of the given document, and returns the range of the added rule
157
+
and the position of the cursor on the indented blank line within it. Note that the range will
158
+
not include all the inserted text (we insert extra newlines before and after the rule).
226
159
227
160
**Kind**: global function
228
161
**Returns**: <code>Object</code> - The range of the inserted rule and the location where the cursor should be placed.
@@ -237,13 +170,17 @@ Adds a new rule to the end of the given document, and returns the range of the a
237
170
<aname="consolidateRules"></a>
238
171
239
172
## consolidateRules()
240
-
In the given rule array (as returned by `findMatchingRules()`), if multiple rules in a rowrefer to the same rule (because there were multiple matching selectors), eliminate the redundantrules. Also, always use the selector group if available instead of the original matching selector.
173
+
In the given rule array (as returned by `findMatchingRules()`), if multiple rules in a row
174
+
refer to the same rule (because there were multiple matching selectors), eliminate the redundant
175
+
rules. Also, always use the selector group if available instead of the original matching selector.
241
176
242
177
**Kind**: global function
243
178
<aname="getRangeSelectors"></a>
244
179
245
180
## getRangeSelectors(range) ⇒ <code>string</code>
246
-
Given a TextRange, extracts the selector(s) for the rule in the range and returns it.Assumes the range only contains one rule; if there's more than one, it will return theselector(s) for the first rule.
181
+
Given a TextRange, extracts the selector(s) for the rule in the range and returns it.
182
+
Assumes the range only contains one rule; if there's more than one, it will return the
183
+
selector(s) for the first rule.
247
184
248
185
**Kind**: global function
249
186
**Returns**: <code>string</code> - The selector(s) for the rule in the range.
0 commit comments