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:
@@ -283,6 +283,26 @@ class Server:
|
||||
'kind': 1})
|
||||
self.reply(msg_id, highlights)
|
||||
|
||||
def on_klammertext_matchInfo(self, msg_id, params):
|
||||
"""Custom request: the full matching story for a cursor position —
|
||||
token, matching token, and whether the pair mismatches. The VS Code
|
||||
extension draws its live match/mismatch decorations from this
|
||||
(documentHighlight is word-gated in VS Code, so a bare @ close would
|
||||
never trigger it; and it cannot carry the mismatch flag)."""
|
||||
uri = params['textDocument']['uri']
|
||||
text = self.docs.get(uri, '')
|
||||
m = KE.match_at(text, pos_to_offset(text, params['position']))
|
||||
if m is None:
|
||||
self.reply(msg_id, None)
|
||||
return
|
||||
self.reply(msg_id, {
|
||||
'token': offsets_to_range(text, *m['token']),
|
||||
'matchToken': (offsets_to_range(text, *m['match_token'])
|
||||
if m['match_token'] is not None else None),
|
||||
'mismatch': m['mismatch'],
|
||||
'message': m['message'],
|
||||
})
|
||||
|
||||
def on_textDocument_definition(self, msg_id, params):
|
||||
uri = params['textDocument']['uri']
|
||||
text = self.docs.get(uri, '')
|
||||
|
||||
Reference in New Issue
Block a user