Repository navigation
feat: emit SymbolInformation.kind and declare UTF-16 position encoding - #124
Merged
chrapkowski-sg merged 2 commits intoNov 2, 2026
Conversation
Refresh the vendored SCIP schema and C# binding to scip-code/scip@08b592d (the official bindings/dotnet/src/Scip.cs, unmodified) and bump Google.Protobuf to 3.34.2 to match its generator. - Set SymbolInformation.Kind for definitions from the Roslyn symbol: class, interface, struct, enum, delegate, VB module, constructor, method / static method, property / static property, enum member, constant, field / static field, event / static event. Every other symbol keeps UnspecifiedKind. - Declare Document.position_encoding as UTF16CodeUnitOffsetFromLineStart for C# and Visual Basic documents: ranges come from Roslyn LinePosition.Character, which counts UTF-16 code units. Ranges themselves are unchanged. - Add a symbol-kinds snapshot input and SymbolKindTests. Symbols, occurrences, ranges, relationships and documentation are unchanged; existing snapshots are byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preserve current dependencies and external-symbol definition accounting while integrating the symbol-kind and position-encoding changes. Cover C# and Visual Basic references following a non-BMP character with exact UTF-16 range assertions and updated fixture snapshots. Amp-Thread-ID: https://ampcode.com/threads/T-01a19c8e-324a-70a0-b7c8-0613ca8edc15 Co-authored-by: Amp <amp@ampcode.com>
chrapkowski-sg
approved these changes
Nov 2, 2026
Shashankss1205
pushed a commit
to CodeGraphContext/CodeGraphContext
that referenced
this pull request
Nov 16, 2026
…1885) * fix(scip): route scip-dotnet's explicit kinds and honour position encoding scip-dotnet now reports SymbolInformation.kind (sourcegraph/scip-dotnet#124). StaticMethod and Constructor definitions were dropped from the function graph, and Delegate / VB Module types from the class graph, together with the calls that ended at them. Route kinds through one table, keeping every previously handled kind and all kind-0 inference unchanged. Reference columns are converted to string indices by Document.position_encoding (UTF-8/16/32); scip-dotnet indexes that declare nothing are UTF-16. Calls after non-BMP characters on the same line were missed. Tests use real scip-dotnet v0.2.16 and a8d080c indexes of one C#/VB project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N3gqehK3G1NVjxEQ2UnopL * fix(scip): keep the implemented interfaces of enums With explicit SymbolInformation.kind (sourcegraph/scip-dotnet#124) C# enums reach the enums bucket, which never received bases, so their INHERITS edges to the interfaces scip-dotnet reports as is_implementation were lost. Give enums bases only when the producer reported such relationships, so enum nodes without them are unchanged, and keep Rust impl-symbol names out of enum bases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N3gqehK3G1NVjxEQ2UnopL * test(scip): check enum inheritance on Kuzu and Ladybug, and per-document encoding Write the real scip-dotnet fixture through GraphWriter and write_inheritance_links on Kuzu, and on Ladybug in a separate interpreter, and assert the INHERITS edges start at the Enum node. Also check that each document's position encoding is applied to its own references. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N3gqehK3G1NVjxEQ2UnopL --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change fixes ambiguous position encoding and adds symbol-kind metadata:
Document.position_encoding = UTF16CodeUnitOffsetFromLineStartfor C# and Visual Basic. Roslyn already emits UTF-16 code-unit offsets; the numeric ranges do not change.SymbolInformation.kindfor supported in-document definitions from their Roslyn symbols. Other kinds, including external-symbol kinds, remain unspecified.scip.protoand official C# binding, copied unmodified from scip-code/scip@08b592d.The update integrates current main, including #114, and preserves its dependency versions, including Google.Protobuf 3.36.2. It does not downgrade packages to the versions on this PR's original base.
Why declaring UTF-16 matters
The SCIP schema's default is unspecified encoding, not an implicit UTF-16 declaration. Consumers can interpret that default differently.
A reproduction using actual scip-dotnet indexes and unchanged Sourcegraph scipdiff range-parsing code demonstrates the problem:
class Café {}, main's index fails parsing withinvalid occurrence range: invalid UTF-8 column; this branch's index parses successfully.Targetafter a non-BMP character (🚀), that consumer selects; Targin C# and: Targin VB when encoding is unspecified. With the UTF-16 declaration, both selectTarget.This is an isolated execution of the consumer's actual parsing code, not a deployed Sourcegraph navigation test. It does not establish that all existing navigation paths were broken. scip-dotnet still does not emit enclosing ranges, so this change alone does not provide full scipdiff declaration support.
Symbol kinds
Records follow their Class / Struct
TypeKind. Extension-method declarations and VB module methods use StaticMethod. Unlisted constructs retain UnspecifiedKind; this is intentionally partial metadata enrichment, not a change to symbol identities.Compatibility and validation
Symbol strings, occurrences, numeric ranges, roles, relationships and documentation retain their existing behavior. The integration preserves #114's external-symbol collection and source-definition bookkeeping. External symbols remain excluded when a source definition exists, including with
--allow-global-symbol-definitions.Validation against main at
778d32ac36700d4a703d61380f200040706709c1:dotnet test -p:TargetFrameworks=net8.0,net9.0andnet10.0each passed all 10 tests, including feat/codeintel: Add hover documentation for dependencies #114's regressions. Main's net10.0 baseline passed all 8 tests.dotnet format --verify-no-changeschecks fromtest.ymlpassed: the root solution,syntax, andsyntax-slnx.SymbolKindTestschecks 20 kind mappings and both documents' encoding declarations. C#/VB fixture references after🚀also assert exact UTF-16 offsets, distinguishing them from UTF-8 byte and Unicode scalar offsets. Fixture snapshots were regenerated for all three frameworks; existing fixtures' snapshots remain unchanged.kindandposition_encoding, including 18 unchanged external symbols.Windows/macOS and deployed navigation have not been tested locally. Earlier author-reported all-fixture/all-framework index comparisons, lint equivalence, and the alternative NuGet binding experiment were not repeated against the updated base.
Scope
Occurrence.RangeandSuffix.Package, producing obsolete-API warnings in production and test code. Migrating to typed ranges is separate work.#linehandling remains based onGetMappedLineSpan(); declaring position encoding does not change mapped-line behavior.