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:
faumaray committed 2026-12-06 04:23:39 +03:00
1 parent 67ca5ea275
commit e4a68a3678
9 files changed
+41 -5

No files matched your search

@@ -874,7 +874,8 @@ void finish(void *, void *) {
std::fprintf(out, ",\"line\":%u,\"startByte\":%u,\"endByte\":%u},\"definition\":",
use.where.line, use.where.start, use.where.end);
if (known) {
std::fputs("{\"path\":", out);
std::fprintf(out, "{\"targetKind\":\"%s\",\"path\":",
body->definition ? "definition" : "declaration");
json_string(out, body->path);
std::fprintf(out, ",\"line\":%u,\"startByte\":%u,\"endByte\":%u", body->where.line,
body->where.start, body->where.end);