MCPcopy Create free account
hub / github.com/csskit/csskit / enter_declaration

Method enter_declaration

crates/csskit_highlight/src/css.rs:122–131  ·  view source on GitHub ↗

Visit Declarations to mark the name and colon

(
		&mut self,
		property: &Declaration<'a, T, CssMetadata>,
		_query: css_ast::VisitNode,
	)

Source from the content-addressed store, hash-verified

120
121 // Visit Declarations to mark the name and colon
122 fn enter_declaration<'a, T: DeclarationValue<'a, CssMetadata>>(
123 &mut self,
124 property: &Declaration<'a, T, CssMetadata>,
125 _query: css_ast::VisitNode,
126 ) {
127 let metadata = property.metadata();
128 let modifier = SemanticModifier::from(&metadata);
129 self.insert(property.name.to_span(), SemanticKind::Declaration, modifier);
130 self.insert(property.colon.to_span(), SemanticKind::Punctuation, SemanticModifier::none());
131 }
132
133 // Visit PropertyRule to mark the AtKeyword and the Prelude
134 fn visit_property_rule<'a>(&mut self, property: &PropertyRule<'a>) {

Callers

nothing calls this directly

Calls 3

metadataMethod · 0.45
insertMethod · 0.45
to_spanMethod · 0.45

Tested by

no test coverage detected