Skip to content

Support case-insensitive pattern matching #4

@srbdev

Description

@srbdev

Problem

Currently, patterns are matched with exact case only. For example, TODO: is highlighted but todo: and Todo: are not.

Different codebases and developers use varying conventions:

  • TODO: (uppercase - most common)
  • todo: (lowercase)
  • Todo: (title case)

Proposed Solution

Replace indexOf with a case-insensitive regex match:

const regex = new RegExp(value.pattern, 'gi');
let match;
while ((match = regex.exec(line)) \!== null) {
    // create range using match.index and match[0].length
}

This would match all case variations while preserving the original text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions