Skip to content

Commit 81b1f9a

Browse files
Mazyodclaude
andcommitted
docs: update semantic tokens verified versions and add version output to extraction script
Update verified backend versions (Pyrefly 0.48.2→0.51.2, ty 0.0.12→0.0.15). The extraction script now prints each LSP server's version from serverInfo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d7f0be0 commit 81b1f9a

3 files changed

Lines changed: 125 additions & 97 deletions

File tree

docs/SEMANTIC_TOKENS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ See `examples/extract_semantic_legends.py` for a complete working example.
9191

9292
### Pyrefly
9393

94-
> Last verified: Pyrefly 0.48.2
94+
> Last verified: Pyrefly 0.51.2
9595
> Legend source: [semantic_tokens.rs](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/state/semantic_tokens.rs)
9696
9797
Pyrefly does not advertise its legend via LSP initialization, but the token mappings are defined in source code.
@@ -143,7 +143,7 @@ Pyrefly does not advertise its legend via LSP initialization, but the token mapp
143143

144144
### ty
145145

146-
> Last verified: ty 0.0.12
146+
> Last verified: ty 0.0.15
147147
148148
#### Token Types
149149

examples/extract_semantic_legends.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ async def extract_legend(
5959
# Send initialized notification (required by LSP spec)
6060
await process.notify.initialized({})
6161

62+
# Extract server version info
63+
server_info = init_result.get("serverInfo", {})
64+
server_version = server_info.get("version", "unknown")
65+
6266
# Extract semantic tokens provider from server capabilities
6367
server_caps = init_result.get("capabilities", {})
6468
semantic_provider = server_caps.get("semanticTokensProvider")
@@ -87,6 +91,7 @@ async def extract_legend(
8791
)
8892
else:
8993
print(f" {backend_name}: No semantic tokens provider")
94+
print(f" {backend_name}: version {server_version}")
9095
return None
9196

9297
legend = semantic_provider.get("legend")
@@ -96,6 +101,7 @@ async def extract_legend(
96101

97102
return {
98103
"backend": backend_name,
104+
"version": server_version,
99105
"tokenTypes": legend.get("tokenTypes", []),
100106
"tokenModifiers": legend.get("tokenModifiers", []),
101107
}
@@ -112,10 +118,12 @@ async def extract_legend(
112118
def print_legend_table(legend: dict) -> None:
113119
"""Print a legend as markdown tables."""
114120
backend = legend["backend"]
121+
version = legend["version"]
115122
token_types = legend["tokenTypes"]
116123
token_modifiers = legend["tokenModifiers"]
117124

118125
print(f"\n### {backend}\n")
126+
print(f"> Version: {version}\n")
119127

120128
# Token Types table
121129
print("#### Token Types\n")
@@ -159,7 +167,7 @@ async def main() -> None:
159167
if legend:
160168
legends.append(legend)
161169
print(
162-
f" {name}: {len(legend['tokenTypes'])} types, {len(legend['tokenModifiers'])} modifiers"
170+
f" {name}: version {legend['version']}, {len(legend['tokenTypes'])} types, {len(legend['tokenModifiers'])} modifiers"
163171
)
164172

165173
print("\n" + "=" * 60)

0 commit comments

Comments
 (0)