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>
This branch has not been deployed
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
scip-dotnet currently emits
SymbolInformation.kind = 0(UnspecifiedKind) for every symbol and leavesDocument.position_encodingunset, because the vendoredscip.protopredates both fields. Consumers therefore have toguess what a symbol is from the shape of its symbol string, and have to guess the unit of
characteroffsets.This PR:
scip-code/scip@08b592d—scip.protoand the officialbindings/dotnet/src/Scip.cs, copied unmodified — and bumpsGoogle.Protobufto 3.34.2 to match the generator;SymbolInformation.Kindfor definitions from the Roslyn symbol (table below); every other symbol keepsUnspecifiedKind;Document.position_encoding = UTF16CodeUnitOffsetFromLineStartfor C# and Visual Basic documents. Rangescome from Roslyn
LinePosition.Character, which counts UTF-16 code units; the ranges themselves are unchanged.Handwritten production change: +27 / −2 lines (
ScipDocumentIndexer.cs,ScipProjectIndexer.cs,ScipDotnet.csproj).INamedTypeSymbolTypeKind Class / Interface / Struct / Enum / Delegate / ModuleIMethodSymbolConstructor, StaticConstructorIMethodSymbolOrdinaryIsStatic(extension methods and VB module members included)IPropertySymbol(not an indexer)IsStaticIFieldSymbolIsConst, else Field / StaticFieldIEventSymbolIsStaticThe static variants follow the schema, which documents
StaticMethod,StaticField,StaticPropertyandStaticEventas intended for C#. Records map to Class / Struct through their
TypeKind.What does not change
Symbol strings, occurrences, ranges, roles, relationships and documentation. I checked this by indexing
snapshots/input/syntax,snapshots/input/syntax-slnxand the new fixture withmainand with this branch onnet8.0, net9.0 and net10.0, decoding both indexes with the pinned schema, clearing only
position_encodingandkind,and comparing the rest with
proto.Equal: identical in every case. The existing textual snapshots are byte-identical(the snapshot renderer does not print
kindorposition_encoding, so kinds are covered by a dedicated test).scip lintbuilt from the samescip-code/scipcommit reports no new diagnostics for this branch compared tomainonthe same inputs.
Tests
snapshots/input/symbol-kinds(a C# project and a VB project) with generated outputs fornet8.0 / net9.0 / net10.0.
SymbolKindTestsasserting the kind of each construct above and the UTF-16 position encoding of both documents.To reuse the indexing helper,
SnapshotTests.IndexDirectoryandSnapshotTests.RootDirectorychanged fromprivatetointernal. Printingkindin the snapshot renderer would be an alternative, but it would rewrite everyexisting snapshot, so I left the renderer alone; happy to switch if you prefer.
test.yml(dotnet format --verify-no-changes×3 anddotnet testfor net10.0 / net9.0 / net8.0)pass locally on Linux. I have not run them on Windows or macOS.
Notes
Occurrence.RangeandSuffix.Packageas obsolete, so the build now reports threeCS0612 warnings per target framework. The CI does not treat warnings as errors. Migrating to the typed range fields is
a separate change and is not part of this PR.
Scip0.10.0 NuGet package was also tested: same schemafingerprint, same generated index, builds on net8/net9/net10. I kept the existing vendored-binding model in this PR to
avoid changing dependency policy; happy to switch if maintainers prefer the package.
position_encodingdeclares the unit of thecharacteroffsets only. With#linedirectives, ranges still comefrom
GetMappedLineSpan()and keep their current behavior.Box<T>andBox<T1, T2>) currently share one symbol,which
scip lintreports as a repeatedSymbolInformation; andenclosing_rangeis not emitted. Both are separatechanges.
🤖 Generated with Claude Code