Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(hover): at rules support & refactor #20

Merged
merged 1 commit into from
Dec 20, 2024
Merged

Conversation

goulvenclech
Copy link
Member

Fixes #17 and improves the logic.

What does this change?

  • crates/csslsrs/src/features/hover.rs: Added the support for at_rules.
  • crates/csslsrs/src/features/hover.rs: Removed the get_css_hover_content function and integrated its logic directly into the extract_hover_information function to reduce redundancy.
  • crates/csslsrs/src/features/hover.rs: Refactored the extract_hover_information function to streamline the process of finding relevant CSS nodes and generating hover content.

How is it tested?

Added two new tests for at-rules in crates/csslsrs/tests/hover.rs (technically one already existed and I just unskipped it but you get it)

How is it documented?

Matches the expected behaviour.

@goulvenclech goulvenclech self-assigned this Dec 20, 2024
@goulvenclech goulvenclech marked this pull request as ready for review December 20, 2024 13:46
@github-actions github-actions bot added the crt:csslsrs Changes in the CSSlsrs crate. label Dec 20, 2024
Copy link

codspeed-hq bot commented Dec 20, 2024

CodSpeed Performance Report

Merging #20 will degrade performances by 25.49%

Comparing add-at-rules-hover (ad7fa43) with main (3546cf3)

Summary

⚡ 1 improvements
❌ 1 regressions
✅ 13 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main add-at-rules-hover Change
weblsp - Color Presentation 671.1 µs 900.7 µs -25.49%
weblsp - Folding Ranges 1,967.8 µs 877 µs ×2.2

Copy link
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great

@goulvenclech goulvenclech merged commit ce5cdfc into main Dec 20, 2024
6 of 7 checks passed
@goulvenclech goulvenclech deleted the add-at-rules-hover branch December 20, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crt:csslsrs Changes in the CSSlsrs crate.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crates/csslsrs/src/features/hover.rs: at rules hover doesn't work
2 participants