Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#555 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@johnml1135 がすでに取り組んでいます。

2026年10月23日 から。

  • #556 @johnml1135 による — オープン
  • #557 @johnml1135 による — オープン

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
C#
スター
29
フォーク
16
平均マージ
6日 13時間
マージ済み PR(30日)
12

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sillsdev/machine のほかの issue

sillsdev/machine の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。