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

Shape.Remove can leave a spanning annotation anchored to a removed end segment

Đang mở
#555 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

@johnml1135 đang làm issue này rồi.

Từ ngày 23/10/2026.

  • #556 của @johnml1135 — đang mở
  • #557 của @johnml1135 — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
62/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
backend

Hướng nghiên cứu

Start in Shape.Remove, follow the call to Shape.UpdateAnnotations, then inspect AnnotationList.Find for directional range boundaries. Use the deterministic reproduction in the issue as the first check, then add the requested single-span and tied-span controls for both endpoint directions, including last and interior segment removal. Done means surviving annotations have endpoints in the shape, payloads and unaffected annotations are preserved, and empty spans are removed.

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

Mô tả

Removing the rightmost segment of a shape can leave a spanning annotation pointing at the detached node instead of shrinking its end to the previous segment. A single spanning annotation is enough; this is separate from #506's tied-node skip-list fix and #554's equal-container descent.

I reran this minimal reproduction against the #506 candidate based on 259920414132bdd5a85542722d9af5509aed8943, with the first-match-in-search-direction change in BidirList.Find. No Shape.Remove or AnnotationList.Find(offset, direction) changes are included in that candidate.

Expected after removing nodes[3]: the annotation spans [nodes[1], nodes[2]], and none of its endpoints refers to nodes[3].

Observed:

singleSpanRightShrink=False; staleEndpoint=True

Reproduction (reference src/SIL.Machine/SIL.Machine.csproj; RNG seeding is confined to this test instance):

using System.Reflection;
using SIL.Machine.Annotations;
using SIL.Machine.DataStructures;
using SIL.Machine.FeatureModel;

var annotations = new AnnotationList<ShapeNode>();
typeof(BidirList<Annotation<ShapeNode>>)
    .GetField("_rand", BindingFlags.Instance | BindingFlags.NonPublic)!
    .SetValue(annotations, new Random(0));
var shape = new Shape(begin => new ShapeNode(FeatureStruct.New().Value), annotations);
ShapeNode[] nodes = Enumerable.Range(0, 4).Select(_ => shape.Add(FeatureStruct.New().Value)).ToArray();
var span = new Annotation<ShapeNode>(Range<ShapeNode>.Create(nodes[1], nodes[3]), FeatureStruct.New().Value);
shape.Annotations.Add(span, false);
shape.Remove(nodes[3]);

bool shrunk = shape.Annotations.Any(annotation => annotation.Range.Start == nodes[1] && annotation.Range.End == nodes[2]);
bool stale = shape.Annotations.Any(annotation => annotation.Range.Start == nodes[1] && annotation.Range.End == nodes[3]);
Console.WriteLine($"singleSpanRightShrink={shrunk}; staleEndpoint={stale}");

The source path is Shape.Remove → Shape.UpdateAnnotations → AnnotationList.Find for the directional range boundaries. The new #506 tests distinguish tie-boundary loss from this existing right-end range case; fixing tie equality alone does not repair it.

Acceptance criteria:

  • Correctly shrink a spanning annotation when its ending segment is removed, including the shape's last segment and an interior segment.
  • Preserve annotation payloads/children and unaffected annotations; remove only annotations whose span becomes empty.
  • Include deterministic single-span and tied-span controls, both endpoint directions, and verify actual endpoint membership in the surviving shape.
  • Keep this follow-up independently reviewable from #506 and #554. No HermitCrab grammar manifestation has been demonstrated by this reproduction.
Ngôn ngữ chính
C#
Star
29
Fork
16
Merge trung bình
6 ngày 17 giờ
Pull request đã merge (30 ngày)
11

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

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

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 sillsdev/machine

Tất cả issue của sillsdev/machine

Issue tương tự

Thêm issue về C#

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.