From b12a508ed9ae5b7ba42b207f68c1e9f4c9f90a78 Mon Sep 17 00:00:00 2001 From: Jaagup Averin Date: Thu, 28 Nov 2024 10:59:10 +0200 Subject: [PATCH] python: Fix highlighting for forward references (#20766) [PEP484](https://peps.python.org/pep-0484/) defines "Forward references" for undefined types. This PR treats such annotations as types rather than strings. Release Notes: - Added Python syntax highlighting for forward references. --- crates/languages/src/python/highlights.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/languages/src/python/highlights.scm b/crates/languages/src/python/highlights.scm index 98ed203969..3b318fe962 100644 --- a/crates/languages/src/python/highlights.scm +++ b/crates/languages/src/python/highlights.scm @@ -18,6 +18,12 @@ (tuple (identifier) @type) ) +; Forward references +(type + (string) @type +) + + ; Function calls (decorator