Query: add `symbolKind` and requirement `text` to the queryable property set

未关闭
#2,339 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
56/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
go, grpc

调研方向

Start with internal/semantic/query/properties.go and the query property tests to see how row properties are resolved; then check internal/frontend/grpc/query_test.go and docs/reference/wire-contract.md. Add tests for requirement text, symbolKind on a transition and anonymous action, and continued rejection of unknown properties. Done means the query results and documented closed property list match the acceptance criteria.

由索引模型根据 Issue 内容生成。

描述

Disclaimer, this issue was detected and written by an AI

Summary

Two browsing/metrics projections are forced onto N+1 work or text scraping because
the query property set is closed and lacks them:

  1. no symbolKind, so a listing that has a row's @type (the metaclass) still
    needs one LookupSymbol per row to learn the symbol kind, and a positional
    …::@1 id cannot be looked up at all;
  2. no requirement text, so sentence metrics parse report output instead of
    querying the requirement's own text feature.

documentation and textualRepresentation are not substitutes: they are the
KerML doc/rep bodies, not RequirementUsage::text.

Current state

  • internal/semantic/query/properties.go has no symbolKind and no text case.
  • docs/reference/wire-contract.md:1044 states the closed set:
    @id, @type, body, declaredName, declaredShortName, documentation, elementId, general, isAbstract, isIndividual, language, locale, multiplicityLower, multiplicityUpper, name, owner, payloadArgument, qualifiedName, receiverArgument, satisfiedRequirement, satisfyingFeature, senderArgument, shortName, textualRepresentation, type.
  • SymbolInfo.Kind exists on GetSymbol (api.md:491), so the fact is known;
    only the query projection is missing.

Proposal

  • symbolKind — the SymbolKind name a GetSymbol answers (PartDefinition,
    StateUsage, …), for every row @type cannot distinguish (a TransitionUsage,
    an anonymous ActionUsage). Same value for every metaclass; empty only where the
    service genuinely has no symbol.
  • text — the requirement's declared text value as a string, on
    RequirementDefinition/RequirementUsage rows; absent when the requirement
    states none. Keep documentation/textualRepresentation unchanged.

Both are additive: the closed list grows, unknown property answers stay for
everything else.

Tests

  • internal/semantic/query property tests: a requirement with
    text = "…" and one without; a transition and an anonymous action in a
    state machine answer symbolKind (TransitionUsage/ActionUsage) without a
    LookupSymbol.
  • internal/frontend/grpc/query_test.go: the two properties over a fixture,
    and unknown property still refuses a name not in the set.
  • docs/reference/wire-contract.md: extend the closed list.

Acceptance

  • A scoped query selecting symbolKind names every row's kind, including
    rows whose id is positional.
  • text answers requirement text and is absent otherwise.
  • The wire-contract property list and its refusal test match the code.
主要语言
Go
星标
59
派生
20
平均合并
10 小时 23 分钟
30 天内合并 PR
897

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Open-MBEE/OpenSysML 的其他 Issue

查看 Open-MBEE/OpenSysML 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。