Packages icon indicating copy to clipboard operation
Packages copied to clipboard

[reST] refactor

Open jrappen opened this issue 8 months ago • 34 comments

[!NOTE]

⚠️ This PR is a work-in-progress. If you have suggestions for stuff that should be fixed, leave a comment below.

Additions:

  • correctly hightlight directive options and their values as mapping.pair while checking value format
  • default keymap
  • symbol index now lists explicit and implicit hyperlink targets (sections, footnotes, citations)
  • highlight embedded python and raw-code directives (css, js, json, jsonc, html, python, toml, yaml), compare #3158
  • explicit hyperlink targets and anonymous explicit hyperlink targets
  • correctly highlight grid tables with optional inline markup
  • correctly highlight inline interpreted text, optionally with roles
  • correctly highlight substitution definitions
  • completions with strict scope limits
  • indentation settings based upon official docs
  • neg. tests for comments
  • highlight empty comments and section separators between empty lines
  • add metadata to enable folding
  • added window command to make selections a literal command
  • added window command to make selections an interpreted text role

Fixes:

  • line blocks (with optional inline markup)
  • footnotes and citations
  • pop explicit markup blocks before the next explicit markup block
  • correctly highlight (valid) comments as block comments
  • do not highlight paragraphs starting with ... as comments
  • include inline markup within block quotes
  • allowed symbols for heading markers, compare #2894
  • inline internal targets may contain symbol characters, compare #1204
  • inline hyperlink references
  • section headings:
    • with overline and underline
    • with underline only
    • optional inset when with overline and underline
  • literal blocks:
    • meta scope
    • literal blocks with expanded form
    • literal blocks with partially minimized form
    • literal blocks with fully minimized form
    • literal blocks with quoted form
  • enumerated lists
  • field lists
  • punctuation of inline substitution references
  • tests for embedded python
  • inline literal for single backtick

Changes:

  • the syntax file now uses branching to correctly highlight section headings and their punctuation
  • scope names have been adjusted with regard to the syntax scope naming guide
  • match punctuation.definition.end rules for inline items before invalid.illegal.newline
  • pop line blocks on empty line
  • pop explicit markup blocks before next explicit markup block
  • moved some rules from block-quote-block context to literal-block
  • removed inline markup from literal blocks
  • updated list of allowed characters for internal link labels, compare #793
  • changed auto_complete_selector default
  • re-ordered test file to match order of syntax file
  • include linebreak in match for first line of directives
  • differentiate known (constant.language) and unknown (constant.other) directive names

BREAKING CHANGES:

  • this pull request requires py3.13 and Sublime Text v4201+

References:

  • fixes #793
  • fixes #1204
  • fixes #2894
  • fixes #3158
  • duplicate the work @deathaxe had done in #4047, so his changes to the syntax don't get lost

Thanks to these contributors:

jrappen avatar Apr 09 '25 11:04 jrappen