Distinguish definition tokens from declarations
The stock observer reports targetKind inside each proven target span, the decoder carries it, and semantic tokens apply the legend's definition modifier instead of always declaring. The observer verifier validates the field and the definition span parser ignores it as envelope metadata. A real stdio session showed modifier 2 on the factory definitions.
This commit is contained in:
1 parent
67ca5ea275
commit
e4a68a3678
9 files changed
+41
-5
No files matched your search
@@ -61,6 +61,10 @@ def compile(compiler, observer, work, main, flags=()):
|
||||
|
||||
|
||||
def read_span(span, name, label):
|
||||
if isinstance(span, dict) and "targetKind" in span:
|
||||
check(span["targetKind"] in ("definition", "declaration"),
|
||||
f"invalid {label} targetKind {span!r}")
|
||||
span = {key: value for key, value in span.items() if key != "targetKind"}
|
||||
check(isinstance(span, dict)
|
||||
and set(span) in ({"path", "line", "startByte", "endByte"},
|
||||
{"path", "line", "startByte", "endByte", "extent"}),
|
||||
|
||||
Reference in new issue
Block a user