Skip to content

Sentence-based ExprLinters lack the caching support of Chunk-based ones. #2364

@hippietrail

Description

@hippietrail

In lint_group.rs we can add linters in three ways:

  • Call add() manually.
  • Call add_chunk_expr_linter().
  • Use the insert_struct_rule macro. This calls add()
  • Use the insert_expr_rule macro. This calls add_chunk_expr_linter()

Since add_chunk_expr_linter() specifically works only for the Chunk Unit and provides caching that ExprLinters use for efficieny, this leaves no way for an ExprLinter that uses Sentence to make use of caching.

At the moment there are no such linters but I'm exploring linters which look for semantic context by checking all words in the surrounding sentence context against a list of keywords.

This does work with add() but will not benefit from caching.

I briefly looked at adding it but it seems to be more involved than I expected, so filing this instead since I might move on to other problems.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions