diff --git a/crates/csslsrs/src/service.rs b/crates/csslsrs/src/service.rs index 9c466c3..33f1321 100644 --- a/crates/csslsrs/src/service.rs +++ b/crates/csslsrs/src/service.rs @@ -80,29 +80,26 @@ impl LanguageService { /// use csslsrs::service::{LanguageService, LanguageServiceOptions}; /// use csslsrs::css_data::CssCustomData; /// use csslsrs::converters::PositionEncoding; - /// use csslsrs::css_data::{CssSection, AtDirectives, PseudoClasses, PseudoElements, Properties, PropertyEntry, PropertyAttributes}; + /// use csslsrs::css_data::{PropertyEntry}; /// /// let mut language_service = LanguageService::new(LanguageServiceOptions::default()); /// /// let custom_data = CssCustomData { - /// css: CssSection { - /// at_directives: AtDirectives { entry: vec![] }, - /// pseudo_classes: PseudoClasses { entry: vec![] }, - /// pseudo_elements: PseudoElements { entry: vec![] }, - /// properties: Properties { entry: vec![ + /// at_directives: vec![], + /// pseudo_classes: vec![], + /// pseudo_elements: vec![], + /// properties: vec![ /// PropertyEntry { - /// attributes: PropertyAttributes { - /// name: "my-custom-property".to_string(), - /// restriction: None, - /// version: None, - /// browsers: None, - /// ref_: None, - /// syntax: None, - /// }, - /// desc: None, + /// name: "my-custom-property".to_string(), + /// restrictions: None, + /// browsers: None, + /// references: None, + /// at_rule: None, + /// relevance: None, + /// syntax: None, + /// description: None, /// } - /// ] } - /// } + /// ] /// }; /// /// language_service.add_css_custom_data(custom_data); diff --git a/crates/csslsrs/tests/hover.rs b/crates/csslsrs/tests/hover.rs index 65b7a8b..c15ecb4 100644 --- a/crates/csslsrs/tests/hover.rs +++ b/crates/csslsrs/tests/hover.rs @@ -63,13 +63,12 @@ fn test_hover_over_color_property_inline() { let expected_hover = Hover { contents: HoverContents::Markup(MarkupContent { kind: MarkupKind::Markdown, - value: "**color**\n\nSets the color of an element's text\n\n**Syntax**: `body { $(name): red; }`\n\n**Restriction**: color\n\n**Supported Browsers**:\n- all\n\n**Reference**:\n- [color](http://www.w3.org/TR/css3-color/#foreground)\n\n".to_string(), + value: "**color**\n\nSets the color of an element's text\n\n**Syntax**: ``\n\n**Restriction**:\n- color\n**Supported Browsers**:\n- E12\n- FF1\n- S1\n- C1\n- IE3\n- O3.5\n\n**Reference**:\n- [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/color)\n\n".to_owned() }), range: Some(Range { start: Position { line: 0, character: 8 }, - end: Position { line: 0, character: 13 }, - }), - }; + end: Position { line: 0, character: 13 } + }) }; assert_hover(css_text, expected_hover); } @@ -80,13 +79,12 @@ fn test_hover_over_color_property() { let expected_hover = Hover { contents: HoverContents::Markup(MarkupContent { kind: MarkupKind::Markdown, - value: "**color**\n\nSets the color of an element's text\n\n**Syntax**: `body { $(name): red; }`\n\n**Restriction**: color\n\n**Supported Browsers**:\n- all\n\n**Reference**:\n- [color](http://www.w3.org/TR/css3-color/#foreground)\n\n".to_string(), + value: "**color**\n\nSets the color of an element's text\n\n**Syntax**: ``\n\n**Restriction**:\n- color\n**Supported Browsers**:\n- E12\n- FF1\n- S1\n- C1\n- IE3\n- O3.5\n\n**Reference**:\n- [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/color)\n\n".to_owned() }), range: Some(Range { start: Position { line: 1, character: 2 }, - end: Position { line: 1, character: 7 }, - }), - }; + end: Position { line: 1, character: 7 } + }) }; assert_hover(css_text, expected_hover); }