getLocationForSelector method

Future<List<SourceRange>> getLocationForSelector(
  1. StyleSheetId styleSheetId,
  2. String selectorText
)

Given a CSS selector text and a style sheet ID, getLocationForSelector returns an array of locations of the CSS selector in the style sheet.

Implementation

Future<List<SourceRange>> getLocationForSelector(
    StyleSheetId styleSheetId, String selectorText) async {
  var result = await _client.send('CSS.getLocationForSelector', {
    'styleSheetId': styleSheetId,
    'selectorText': selectorText,
  });
  return (result['ranges'] as List)
      .map((e) => SourceRange.fromJson(e as Map<String, dynamic>))
      .toList();
}