Skip to content

refactor: simplify #6

@bartveneman

Description

@bartveneman

There's some heuristics that we might be able to use to simplify this whole thing:

  • ranges are always reported on entire blocks (but should check this statement for correctness)
  • atrules are also reported, but without the @media (at-sign + atrule name)

Simplify:

  • Take all the reported ranges
  • Create chunks for each range of covered and not-covered code ({ start_offset, end_offset, is_covered, css })
  • Adjust ranges with atrules so they include the @media prelude
  • Prettify each 'block' individually
  • Adjust the ranges after prettification (we know each start/end per chunk)
  • Done?

Benefits:

  • Determining line coverage becomes much simpler since for each chunk we know how many lines it has
  • Prettification becomes much simpler because we don't need to track tokens between before/after

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions