Skip to content

Improve/refine syntax highlighter #1134

Closed
@gorhill

Description

@gorhill

Instead of having countless issues opened for every single improvements/refining that could be brought to the syntax highlighter, here is one meta issue to handle them all. I will list all the actionable items in the top comment. Feel free to report un-handled cases or suggest more refinements.

To do:

  • Add a filter list which purpose is to validate the static filtering parser
    • Done:
      • https://raw.githubusercontent.com/gorhill/uBlock/master/docs/tests/static-filtering-parser-checklist.txt
      • Subscribe to it and disable it after the list is imported, then use asset viewer to see the result.
  • *$xhr,empty should be reported as valid
  • The following redirect rules should be reported as invalid:
    • *$beacon,redirect-rule=empty
    • *$ping,redirect-rule=empty
    • *$websocket,redirect-rule=empty
  • Detect invalid !# directives
    • Support auto-completion for valid directives
  • Detect unmatched !#if-!#endif directives
  • Handle line continuation -- I need to read and wrap my mind around CodeMirror's state object
  • Detect and fix regex-based filters starting with /.*: they are inefficient and the leading .* accomplishes nothing.
  • Ambiguous option separator, see Improve/refine syntax highlighter #1134 (comment).

Nice to have:

  • Buttons to navigate to next/prev problematic filter in asset viewer and "My filters
  • Warn in gutter about untokenizable static network filters
  • Create clickable links for URLs present in comments
    • Implemented as follow: double clicking the URL will select whole URL, at which point you can use your browser's "Open in new tab" feature on the selection.
  • Code folding ability:
    • !#if ... / !#endif blocks
    • !#include blocks

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfixedissue has been addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions