Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

API JSON: a source range on each element

Open
#654 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go

Research direction

Start in rdf_out.go, where e.offsets records node.Span().Offset and line regions are retained only for elements starting their own line. Trace the api-json encoder's syntax-node handling, including elements sharing a line with their owner. Done means every element, including nested same-line elements, has a sourceRange containing its file and start/end position information.

Written by the indexing model from the issue text.

Description

On develop (72081f8), the API JSON gives an element its lines as written (sysx:sourceText) but not where they are, and an element sharing a line with its owner gets no text at all. The service's symbols (SymbolInfo) carry no position either; only diagnostics have a Span.

package W {
    part a { attribute x; }
    part b { attribute x; }
}

sysml -convert api-json gives W::a and W::b a sysx:sourceText each (" part a { attribute x; }\n"), and W::a::x and W::b::x none. Nothing in the output says where either x is declared.

Request: a range per element, for example sysx:sourceRange with file, start and end (line and column, or byte offsets). The encoder already has each element's syntax node, and records its start offset (rdf_out.go, e.offsets[...] = node.Span().Offset); line regions are kept only for elements that start their own line.

A consumer needs this to go from an element to its declaration, or to edit a model in place by position.

Dominant language
Go
Stars
24
Forks
5
Avg merge
10h 11m
Merged PRs (30d)
572

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Open-MBEE/OpenSysML

All issues in Open-MBEE/OpenSysML

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.