Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

API JSON: a source range on each element

Đang mở
#654 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
api, backend-api-design

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
24
Fork
5
Merge trung bình
10 giờ 11 phút
Pull request đã merge (30 ngày)
572

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Open-MBEE/OpenSysML

Tất cả issue của Open-MBEE/OpenSysML

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.