VS Code: decoration-based matching, Ctrl+K bindings, README overhaul (from dev f84517152b7f)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-27 17:02:41 +02:00
parent 2eb16791d2
commit f84603ee19
10 changed files with 255 additions and 39 deletions

View File

@@ -211,6 +211,33 @@ def main():
'position': {'line': 0, 'character': 4}})
check('documentHighlight off-delimiter is null', off is None, repr(off))
# -- the custom matchInfo request (drives the VS Code decorations) --
hl2 = client.request('textDocument/documentHighlight',
{'textDocument': {'uri': uri},
'position': {'line': 0, 'character': 7}})
check('documentHighlight from the bare close',
hl2 is not None and len(hl2) == 2, repr(hl2))
mi = client.request('klammertext/matchInfo',
{'textDocument': {'uri': uri},
'position': {'line': 0, 'character': 7}})
check('matchInfo from the bare close',
mi is not None and not mi['mismatch']
and mi['matchToken']['start']['character'] == 0, repr(mi))
client.notify('textDocument/didChange',
{'textDocument': {'uri': uri, 'version': 6},
'contentChanges': [{'text': '@ol x ul@\n'}]})
client.wait_notification('textDocument/publishDiagnostics')
mi = client.request('klammertext/matchInfo',
{'textDocument': {'uri': uri},
'position': {'line': 0, 'character': 0}})
check('matchInfo reports a mismatch',
mi is not None and mi['mismatch'] and 'ul@' in (mi['message'] or ''),
repr(mi))
mi = client.request('klammertext/matchInfo',
{'textDocument': {'uri': uri},
'position': {'line': 0, 'character': 4}})
check('matchInfo off-delimiter is null', mi is None, repr(mi))
# -- alignTable via executeCommand -> applyEdit, on every align fixture --
align_fixtures = ['align_mixed', 'align_empty_cells', 'align_boundary',
'align_colspan', 'align_escapes']