From 46663a703f4b9cf54536cf75724e9411e6e3b7d6 Mon Sep 17 00:00:00 2001 From: PhysShell <45852143+PhysShell@users.noreply.github.com> Date: Mon, 28 Sep 2026 02:07:14 +0000 Subject: [PATCH] feat: emit SymbolInformation.kind and declare UTF-16 position encoding 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 --- ScipDotnet.Tests/SnapshotTests.cs | 4 +- ScipDotnet.Tests/SymbolKindTests.cs | 53 + ScipDotnet/Scip.cs | 2798 ++++++++++++++--- ScipDotnet/ScipDocumentIndexer.cs | 26 +- ScipDotnet/ScipDotnet.csproj | 2 +- ScipDotnet/ScipProjectIndexer.cs | 1 + scip.proto | 509 ++- .../CSharpKinds/CSharpKinds.csproj | 8 + .../input/symbol-kinds/CSharpKinds/Kinds.cs | 49 + snapshots/input/symbol-kinds/VBKinds/Kinds.vb | 9 + .../input/symbol-kinds/VBKinds/VBKinds.vbproj | 8 + snapshots/input/symbol-kinds/symbol-kinds.sln | 48 + .../symbol-kinds/CSharpKinds/Kinds.cs | 99 + .../symbol-kinds/VBKinds/Kinds.vb | 16 + .../symbol-kinds/CSharpKinds/Kinds.cs | 99 + .../symbol-kinds/VBKinds/Kinds.vb | 16 + .../symbol-kinds/CSharpKinds/Kinds.cs | 99 + .../symbol-kinds/VBKinds/Kinds.vb | 16 + 18 files changed, 3424 insertions(+), 436 deletions(-) create mode 100644 ScipDotnet.Tests/SymbolKindTests.cs create mode 100644 snapshots/input/symbol-kinds/CSharpKinds/CSharpKinds.csproj create mode 100644 snapshots/input/symbol-kinds/CSharpKinds/Kinds.cs create mode 100644 snapshots/input/symbol-kinds/VBKinds/Kinds.vb create mode 100644 snapshots/input/symbol-kinds/VBKinds/VBKinds.vbproj create mode 100644 snapshots/input/symbol-kinds/symbol-kinds.sln create mode 100644 snapshots/output-net10.0/symbol-kinds/CSharpKinds/Kinds.cs create mode 100644 snapshots/output-net10.0/symbol-kinds/VBKinds/Kinds.vb create mode 100644 snapshots/output-net8.0/symbol-kinds/CSharpKinds/Kinds.cs create mode 100644 snapshots/output-net8.0/symbol-kinds/VBKinds/Kinds.vb create mode 100644 snapshots/output-net9.0/symbol-kinds/CSharpKinds/Kinds.cs create mode 100644 snapshots/output-net9.0/symbol-kinds/VBKinds/Kinds.vb diff --git a/ScipDotnet.Tests/SnapshotTests.cs b/ScipDotnet.Tests/SnapshotTests.cs index fc66e41..01cf4ae 100644 --- a/ScipDotnet.Tests/SnapshotTests.cs +++ b/ScipDotnet.Tests/SnapshotTests.cs @@ -138,7 +138,7 @@ private static string[] ListSnapshotInputDirectories() #endif } - private static string IndexDirectory(string directory) + internal static string IndexDirectory(string directory) { var include = Environment.GetEnvironmentVariable("SCIP_INCLUDE"); var framework = $"net{Environment.Version.Major}.0"; @@ -182,7 +182,7 @@ private static string[] GitLsFiles(string directory) return process.StandardOutput.ReadToEnd().Trim().Split("\n"); } - private static string RootDirectory() + internal static string RootDirectory() { var process = new Process() { diff --git a/ScipDotnet.Tests/SymbolKindTests.cs b/ScipDotnet.Tests/SymbolKindTests.cs new file mode 100644 index 0000000..3d0364f --- /dev/null +++ b/ScipDotnet.Tests/SymbolKindTests.cs @@ -0,0 +1,53 @@ +using Scip; +using Index = Scip.Index; +using Kind = Scip.SymbolInformation.Types.Kind; + +namespace ScipDotnet.Tests; + +[TestFixture] +public class SymbolKindTests +{ + private static readonly Dictionary ExpectedKinds = new() + { + ["SymbolKinds/IShape#"] = Kind.Interface, + ["SymbolKinds/Point#"] = Kind.Struct, + ["SymbolKinds/Color#"] = Kind.Enum, + ["SymbolKinds/Color#Red."] = Kind.EnumMember, + ["SymbolKinds/Handler#"] = Kind.Delegate, + ["SymbolKinds/Kinds#"] = Kind.Class, + ["SymbolKinds/Kinds#Constant."] = Kind.Constant, + ["SymbolKinds/Kinds#Field."] = Kind.Field, + ["SymbolKinds/Kinds#StaticField."] = Kind.StaticField, + ["SymbolKinds/Kinds#`.ctor`()."] = Kind.Constructor, + ["SymbolKinds/Kinds#Property."] = Kind.Property, + ["SymbolKinds/Kinds#StaticProperty."] = Kind.StaticProperty, + ["SymbolKinds/Kinds#Event#"] = Kind.Event, + ["SymbolKinds/Kinds#StaticEvent#"] = Kind.StaticEvent, + ["SymbolKinds/Kinds#Method()."] = Kind.Method, + ["SymbolKinds/Kinds#StaticMethod()."] = Kind.StaticMethod, + ["SymbolKinds/KindsExtensions#"] = Kind.Class, + ["SymbolKinds/KindsExtensions#Extension()."] = Kind.StaticMethod, + ["SymbolKinds/VBClass#"] = Kind.Class, + ["SymbolKinds/VBModule#"] = Kind.Module, + }; + + [Test] + public void DefinitionsCarrySymbolKindAndDocumentsDeclareUtf16() + { + var directory = Path.Join(SnapshotTests.RootDirectory(), "snapshots", "input", "symbol-kinds"); + var index = Index.Parser.ParseFrom(File.ReadAllBytes(SnapshotTests.IndexDirectory(directory))); + + var kinds = index.Documents.SelectMany(document => document.Symbols).ToList(); + foreach (var (suffix, expected) in ExpectedKinds) + { + var matches = kinds.Where(info => info.Symbol.EndsWith(" " + suffix)).Select(info => info.Kind).ToList(); + Assert.That(matches, Has.Count.EqualTo(1), suffix); + Assert.That(matches[0], Is.EqualTo(expected), suffix); + } + + Assert.That(index.Documents.Select(document => document.Language).Distinct(), + Is.EquivalentTo(new[] { "C#", "Visual Basic" })); + Assert.That(index.Documents.Select(document => document.PositionEncoding), + Has.All.EqualTo(PositionEncoding.Utf16CodeUnitOffsetFromLineStart)); + } +} diff --git a/ScipDotnet/Scip.cs b/ScipDotnet/Scip.cs index 41a814e..6bf0c3c 100644 --- a/ScipDotnet/Scip.cs +++ b/ScipDotnet/Scip.cs @@ -24,107 +24,182 @@ public static partial class ScipReflection { static ScipReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CgpzY2lwLnByb3RvEgRzY2lwIn8KBUluZGV4EiAKCG1ldGFkYXRhGAEgASgL", - "Mg4uc2NpcC5NZXRhZGF0YRIhCglkb2N1bWVudHMYAiADKAsyDi5zY2lwLkRv", - "Y3VtZW50EjEKEGV4dGVybmFsX3N5bWJvbHMYAyADKAsyFy5zY2lwLlN5bWJv", - "bEluZm9ybWF0aW9uIp8BCghNZXRhZGF0YRImCgd2ZXJzaW9uGAEgASgOMhUu", - "c2NpcC5Qcm90b2NvbFZlcnNpb24SIQoJdG9vbF9pbmZvGAIgASgLMg4uc2Np", - "cC5Ub29sSW5mbxIUCgxwcm9qZWN0X3Jvb3QYAyABKAkSMgoWdGV4dF9kb2N1", - "bWVudF9lbmNvZGluZxgEIAEoDjISLnNjaXAuVGV4dEVuY29kaW5nIjwKCFRv", - "b2xJbmZvEgwKBG5hbWUYASABKAkSDwoHdmVyc2lvbhgCIAEoCRIRCglhcmd1", - "bWVudHMYAyADKAkihAEKCERvY3VtZW50EhAKCGxhbmd1YWdlGAQgASgJEhUK", - "DXJlbGF0aXZlX3BhdGgYASABKAkSJQoLb2NjdXJyZW5jZXMYAiADKAsyEC5z", - "Y2lwLk9jY3VycmVuY2USKAoHc3ltYm9scxgDIAMoCzIXLnNjaXAuU3ltYm9s", - "SW5mb3JtYXRpb24iZQoGU3ltYm9sEg4KBnNjaGVtZRgBIAEoCRIeCgdwYWNr", - "YWdlGAIgASgLMg0uc2NpcC5QYWNrYWdlEisKC2Rlc2NyaXB0b3JzGAMgAygL", - "MhYuc2NpcC5TeW1ib2xEZXNjcmlwdG9yIjkKB1BhY2thZ2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pdHkYASABKA4yDi5zY2lw", - "LlNldmVyaXR5EgwKBGNvZGUYAiABKAkSDwoHbWVzc2FnZRgDIAEoCRIOCgZz", - "b3VyY2UYBCABKAkSIQoEdGFncxgFIAMoDjITLnNjaXAuRGlhZ25vc3RpY1Rh", - "ZyoxCg9Qcm90b2NvbFZlcnNpb24SHgoaVW5zcGVjaWZpZWRQcm90b2NvbFZl", - "cnNpb24QACpACgxUZXh0RW5jb2RpbmcSGwoXVW5zcGVjaWZpZWRUZXh0RW5j", - "b2RpbmcQABIICgRVVEY4EAESCQoFVVRGMTYQAip9CgpTeW1ib2xSb2xlEhkK", - "FVVuc3BlY2lmaWVkU3ltYm9sUm9sZRAAEg4KCkRlZmluaXRpb24QARIKCgZJ", - "bXBvcnQQAhIPCgtXcml0ZUFjY2VzcxAEEg4KClJlYWRBY2Nlc3MQCBINCglH", - "ZW5lcmF0ZWQQEBIICgRUZXN0ECAq6gYKClN5bnRheEtpbmQSGQoVVW5zcGVj", - "aWZpZWRTeW50YXhLaW5kEAASCwoHQ29tbWVudBABEhgKFFB1bmN0dWF0aW9u", - "RGVsaW1pdGVyEAISFgoSUHVuY3R1YXRpb25CcmFja2V0EAMSCwoHS2V5d29y", - "ZBAEEhkKEUlkZW50aWZpZXJLZXl3b3JkEAQaAggBEhYKEklkZW50aWZpZXJP", - "cGVyYXRvchAFEg4KCklkZW50aWZpZXIQBhIVChFJZGVudGlmaWVyQnVpbHRp", - "bhAHEhIKDklkZW50aWZpZXJOdWxsEAgSFgoSSWRlbnRpZmllckNvbnN0YW50", - "EAkSGwoXSWRlbnRpZmllck11dGFibGVHbG9iYWwQChIXChNJZGVudGlmaWVy", - "UGFyYW1ldGVyEAsSEwoPSWRlbnRpZmllckxvY2FsEAwSFgoSSWRlbnRpZmll", - "clNoYWRvd2VkEA0SFwoTSWRlbnRpZmllck5hbWVzcGFjZRAOEhgKEElkZW50", - "aWZpZXJNb2R1bGUQDhoCCAESFgoSSWRlbnRpZmllckZ1bmN0a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HbWVzc2FnZRIWCgZzb3VyY2UYBCABKAlSBnNvdXJjZRInCgR0", + "YWdzGAUgAygOMhMuc2NpcC5EaWFnbm9zdGljVGFnUgR0YWdzKjEKD1Byb3Rv", + "Y29sVmVyc2lvbhIeChpVbnNwZWNpZmllZFByb3RvY29sVmVyc2lvbhAAKkAK", + "DFRleHRFbmNvZGluZxIbChdVbnNwZWNpZmllZFRleHRFbmNvZGluZxAAEggK", + "BFVURjgQARIJCgVVVEYxNhACKqQBChBQb3NpdGlvbkVuY29kaW5nEh8KG1Vu", + "c3BlY2lmaWVkUG9zaXRpb25FbmNvZGluZxAAEiMKH1VURjhDb2RlVW5pdE9m", + "ZnNldEZyb21MaW5lU3RhcnQQARIkCiBVVEYxNkNvZGVVbml0T2Zmc2V0RnJv", + "bUxpbmVTdGFydBACEiQKIFVURjMyQ29kZVVuaXRPZmZzZXRGcm9tTGluZVN0", + "YXJ0EAMqlAEKClN5bWJvbFJvbGUSGQoVVW5zcGVjaWZpZWRTeW1ib2xSb2xl", + "EAASDgoKRGVmaW5pdGlvbhABEgoKBkltcG9ydBACEg8KC1dyaXRlQWNjZXNz", + "EAQSDgoKUmVhZEFjY2VzcxAIEg0KCUdlbmVyYXRlZBAQEggKBFRlc3QQIBIV", + "ChFGb3J3YXJkRGVmaW5pdGlvbhBAKuoGCgpTeW50YXhLaW5kEhkKFVVuc3Bl", + "Y2lmaWVkU3ludGF4S2luZBAAEgsKB0NvbW1lbnQQARIYChRQdW5jdHVhdGlv", + "bkRlbGltaXRlchACEhYKElB1bmN0dWF0aW9uQnJhY2tldBADEgsKB0tleXdv", + "cmQQBBIZChFJZGVudGlmaWVyS2V5d29yZBAEGgIIARIWChJJZGVudGlmaWVy", + "T3BlcmF0b3IQBRIOCgpJZGVudGlmaWVyEAYSFQoRSWRlbnRpZmllckJ1aWx0", + "aW4QBxISCg5JZGVudGlmaWVyTnVsbBAIEhYKEklkZW50aWZpZXJDb25zdGFu", + "dBAJEhsKF0lkZW50aWZp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CgZN", + "YXRsYWIQNBIKCgZOaWNrZWwQbhIHCgNOaXgQTRIJCgVPQ2FtbBApEg8KC09i", + "amVjdGl2ZV9DECQSEQoNT2JqZWN0aXZlX0NQUBAlEggKBE9kaW4QbxIKCgZQ", + "YXNjYWwQYxIHCgNQSFAQExIJCgVQTFNRTBBGEggKBFBlcmwQDRIOCgpQb3dl", + "clNoZWxsEEMSCgoGUHJvbG9nEEcSDAoIUHJvdG9idWYQZBIKCgZQeXRob24Q", + "DxIFCgFSEDYSCgoGUmFja2V0EAsSCAoEUmFrdRAOEgkKBVJhem9yED4SCQoF", + "UmVwcm8QZhIICgRSZVNUEFUSCAoEUnVieRAQEggKBFJ1c3QQKBIHCgNTQVMQ", + "PRIICgRTQ1NTEB0SBwoDU01MECsSBwoDU1FMEEUSCAoEU2FzcxAcEgkKBVNj", + "YWxhEAUSCgoGU2NoZW1lEAoSDwoLU2hlbGxTY3JpcHQQQBILCgdTa3lsYXJr", + "EE4SCQoFU2xhbmcQaxIMCghTb2xpZGl0eRBfEgoKBlN2ZWx0ZRBqEgkKBVN3", + "aWZ0EAISBwoDVGNsEGUSCAoEVE9NTBBJEgcKA1RlWBBSEgoKBlRocmlmdBBn", + "Eg4KClR5cGVTY3JpcHQQFxITCg9UeXBlU2NyaXB0UmVhY3QQXhILCgdWZXJp", + "bG9nEGgSCAoEVkhETBBpEg8KC1Zpc3VhbEJhc2ljED8SBwoDVnVlEBkSCwoH", + "V29sZnJhbRA1EgcKA1hNTBAfEgcKA1hTTBAgEggKBFlBTUwQShIHCgNaaWcQ", + "JkJOChJvcmcuc2NpcF9jb2RlLnNjaXBCCVNjaXBQcm90b1ABWitnaXRodWIu", + "Y29tL3NjaXAtY29kZS9zY2lwL2JpbmRpbmdzL2dvL3NjaXAvYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Scip.ProtocolVersion), typeof(global::Scip.TextEncoding), typeof(global::Scip.SymbolRole), typeof(global::Scip.SyntaxKind), typeof(global::Scip.Severity), typeof(global::Scip.DiagnosticTag), typeof(global::Scip.Language), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Scip.ProtocolVersion), typeof(global::Scip.TextEncoding), typeof(global::Scip.PositionEncoding), typeof(global::Scip.SymbolRole), typeof(global::Scip.SyntaxKind), typeof(global::Scip.Severity), typeof(global::Scip.DiagnosticTag), typeof(global::Scip.Language), }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Scip.Index), global::Scip.Index.Parser, new[]{ "Metadata", "Documents", "ExternalSymbols" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Scip.Metadata), global::Scip.Metadata.Parser, new[]{ "Version", "ToolInfo", "ProjectRoot", "TextDocumentEncoding" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Scip.ToolInfo), global::Scip.ToolInfo.Parser, new[]{ "Name", "Version", "Arguments" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Scip.Document), global::Scip.Document.Parser, new[]{ "Language", "RelativePath", "Occurrences", "Symbols" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Scip.Document), global::Scip.Document.Parser, new[]{ "Language", "RelativePath", "Occurrences", "Symbols", "Text", "PositionEncoding" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Scip.Symbol), global::Scip.Symbol.Parser, new[]{ "Scheme", "Package", "Descriptors" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Scip.Package), global::Scip.Package.Parser, new[]{ "Manager", "Name", "Version" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Scip.SymbolDescriptor), global::Scip.SymbolDescriptor.Parser, new[]{ "Name", "Disambiguator", "Suffix" }, null, new[]{ typeof(global::Scip.SymbolDescriptor.Types.Suffix) }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Scip.SymbolInformation), global::Scip.SymbolInformation.Parser, new[]{ "Symbol", "Documentation", "Relationships" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Scip.Signature), global::Scip.Signature.Parser, new[]{ "Language", "Text", "Occurrences" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Scip.SymbolInformation), global::Scip.SymbolInformation.Parser, new[]{ "Symbol", "Documentation", "Relationships", "Kind", "DisplayName", "SignatureDocumentation", "EnclosingSymbol" }, null, new[]{ typeof(global::Scip.SymbolInformation.Types.Kind) }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Scip.Relationship), global::Scip.Relationship.Parser, new[]{ "Symbol", "IsReference", "IsImplementation", "IsTypeDefinition", "IsDefinition" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Scip.Occurrence), global::Scip.Occurrence.Parser, new[]{ "Range", "Symbol", "SymbolRoles", "OverrideDocumentation", "SyntaxKind", "Diagnostics" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Scip.SingleLineRange), global::Scip.SingleLineRange.Parser, new[]{ "Line", "StartCharacter", "EndCharacter" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Scip.MultiLineRange), global::Scip.MultiLineRange.Parser, new[]{ "StartLine", "StartCharacter", "EndLine", "EndCharacter" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Scip.Occurrence), global::Scip.Occurrence.Parser, new[]{ "Range", "SingleLineRange", "MultiLineRange", "Symbol", "SymbolRoles", "OverrideDocumentation", "SyntaxKind", "Diagnostics", "EnclosingRange", "SingleLineEnclosingRange", "MultiLineEnclosingRange" }, new[]{ "TypedRange", "TypedEnclosingRange" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Scip.Diagnostic), global::Scip.Diagnostic.Parser, new[]{ "Severity", "Code", "Message", "Source", "Tags" }, null, null, null, null) })); } @@ -143,7 +218,44 @@ public enum TextEncoding { } /// - /// SymbolRole declares what "role" a symbol has in an occurrence. A role is + /// Encoding used to interpret the 'character' value in source ranges. + /// + public enum PositionEncoding { + /// + /// Default value. This value should not be used by new SCIP indexers + /// so that a consumer can process the SCIP index without ambiguity. + /// + [pbr::OriginalName("UnspecifiedPositionEncoding")] UnspecifiedPositionEncoding = 0, + /// + /// The 'character' value is interpreted as an offset in terms + /// of UTF-8 code units (i.e. bytes). + /// + /// Example: For the string "🚀 Woo" in UTF-8, the bytes are + /// [240, 159, 154, 128, 32, 87, 111, 111], so the offset for 'W' + /// would be 5. + /// + [pbr::OriginalName("UTF8CodeUnitOffsetFromLineStart")] Utf8CodeUnitOffsetFromLineStart = 1, + /// + /// The 'character' value is interpreted as an offset in terms + /// of UTF-16 code units (each is 2 bytes). + /// + /// Example: For the string "🚀 Woo", the UTF-16 code units are + /// ['\ud83d', '\ude80', ' ', 'W', 'o', 'o'], so the offset for 'W' + /// would be 3. + /// + [pbr::OriginalName("UTF16CodeUnitOffsetFromLineStart")] Utf16CodeUnitOffsetFromLineStart = 2, + /// + /// The 'character' value is interpreted as an offset in terms + /// of UTF-32 code units (each is 4 bytes). + /// + /// Example: For the string "🚀 Woo", the UTF-32 code units are + /// ['🚀', ' ', 'W', 'o', 'o'], so the offset for 'W' would be 2. + /// + [pbr::OriginalName("UTF32CodeUnitOffsetFromLineStart")] Utf32CodeUnitOffsetFromLineStart = 3, + } + + /// + /// SymbolRole declares what "role" a symbol has in an occurrence. A role is /// encoded as a bitset where each bit represents a different role. For example, /// to determine if the `Import` role is set, test whether the second bit of the /// enum value is defined. In pseudocode, this can be implemented with the @@ -179,6 +291,14 @@ public enum SymbolRole { /// Is the symbol in test code? /// [pbr::OriginalName("Test")] Test = 32, + /// + /// Is this a signature for a symbol that is defined elsewhere? + /// + /// Applies to forward declarations for languages like C, C++ + /// and Objective-C, as well as `val` declarations in interface + /// files in languages like SML and OCaml. + /// + [pbr::OriginalName("ForwardDefinition")] ForwardDefinition = 64, } public enum SyntaxKind { @@ -199,6 +319,7 @@ public enum SyntaxKind { /// `if`, `else`, `return`, `class`, etc. /// [pbr::OriginalName("Keyword")] Keyword = 4, + [global::System.ObsoleteAttribute] [pbr::OriginalName("IdentifierKeyword", PreferredAlias = false)] IdentifierKeyword = 4, /// /// `+`, `*`, etc. @@ -243,6 +364,7 @@ public enum SyntaxKind { /// and a module in languages like Python and JavaScript. /// [pbr::OriginalName("IdentifierNamespace")] IdentifierNamespace = 14, + [global::System.ObsoleteAttribute] [pbr::OriginalName("IdentifierModule", PreferredAlias = false)] IdentifierModule = 14, /// /// Function references, including calls @@ -353,12 +475,13 @@ public enum DiagnosticTag { /// for the `Document.language` field. The primary purpose of this enum is to /// prevent a situation where we have a single programming language ends up with /// multiple string representations. For example, the C++ language uses the name - /// "CPlusPlus" in this enum and other names such as "cpp" are incompatible. + /// "CPP" in this enum and other names such as "cpp" are incompatible. /// Feel free to send a pull-request to add missing programming languages. /// public enum Language { [pbr::OriginalName("UnspecifiedLanguage")] UnspecifiedLanguage = 0, [pbr::OriginalName("ABAP")] Abap = 60, + [pbr::OriginalName("Apex")] Apex = 96, [pbr::OriginalName("APL")] Apl = 49, [pbr::OriginalName("Ada")] Ada = 39, [pbr::OriginalName("Agda")] Agda = 45, @@ -379,6 +502,7 @@ public enum Language { [pbr::OriginalName("Coffeescript")] Coffeescript = 21, [pbr::OriginalName("CommonLisp")] CommonLisp = 9, [pbr::OriginalName("Coq")] Coq = 47, + [pbr::OriginalName("CUDA")] Cuda = 97, [pbr::OriginalName("Dart")] Dart = 3, [pbr::OriginalName("Delphi")] Delphi = 57, [pbr::OriginalName("Diff")] Diff = 88, @@ -394,6 +518,7 @@ public enum Language { [pbr::OriginalName("Git_Config")] GitConfig = 89, [pbr::OriginalName("Git_Rebase")] GitRebase = 92, [pbr::OriginalName("Go")] Go = 33, + [pbr::OriginalName("GraphQL")] GraphQl = 98, [pbr::OriginalName("Groovy")] Groovy = 7, [pbr::OriginalName("HTML")] Html = 30, [pbr::OriginalName("Hack")] Hack = 20, @@ -408,28 +533,44 @@ public enum Language { [pbr::OriginalName("JavaScriptReact")] JavaScriptReact = 93, [pbr::OriginalName("Jsonnet")] Jsonnet = 76, [pbr::OriginalName("Julia")] Julia = 55, + [pbr::OriginalName("Justfile")] Justfile = 109, [pbr::OriginalName("Kotlin")] Kotlin = 4, [pbr::OriginalName("LaTeX")] LaTeX = 83, [pbr::OriginalName("Lean")] Lean = 48, [pbr::OriginalName("Less")] Less = 27, [pbr::OriginalName("Lua")] Lua = 12, + [pbr::OriginalName("Luau")] Luau = 108, [pbr::OriginalName("Makefile")] Makefile = 79, [pbr::OriginalName("Markdown")] Markdown = 84, [pbr::OriginalName("Matlab")] Matlab = 52, + /// + /// https://nickel-lang.org/ + /// + [pbr::OriginalName("Nickel")] Nickel = 110, [pbr::OriginalName("Nix")] Nix = 77, [pbr::OriginalName("OCaml")] Ocaml = 41, [pbr::OriginalName("Objective_C")] ObjectiveC = 36, [pbr::OriginalName("Objective_CPP")] ObjectiveCpp = 37, + /// + /// https://odin-lang.org/ + /// + [pbr::OriginalName("Odin")] Odin = 111, + [pbr::OriginalName("Pascal")] Pascal = 99, [pbr::OriginalName("PHP")] Php = 19, [pbr::OriginalName("PLSQL")] Plsql = 70, [pbr::OriginalName("Perl")] Perl = 13, [pbr::OriginalName("PowerShell")] PowerShell = 67, [pbr::OriginalName("Prolog")] Prolog = 71, + [pbr::OriginalName("Protobuf")] Protobuf = 100, [pbr::OriginalName("Python")] Python = 15, [pbr::OriginalName("R")] R = 54, [pbr::OriginalName("Racket")] Racket = 11, [pbr::OriginalName("Raku")] Raku = 14, [pbr::OriginalName("Razor")] Razor = 62, + /// + /// Internal language for testing SCIP + /// + [pbr::OriginalName("Repro")] Repro = 102, [pbr::OriginalName("ReST")] ReSt = 85, [pbr::OriginalName("Ruby")] Ruby = 16, [pbr::OriginalName("Rust")] Rust = 40, @@ -445,11 +586,18 @@ public enum Language { /// [pbr::OriginalName("ShellScript")] ShellScript = 64, [pbr::OriginalName("Skylark")] Skylark = 78, + [pbr::OriginalName("Slang")] Slang = 107, + [pbr::OriginalName("Solidity")] Solidity = 95, + [pbr::OriginalName("Svelte")] Svelte = 106, [pbr::OriginalName("Swift")] Swift = 2, + [pbr::OriginalName("Tcl")] Tcl = 101, [pbr::OriginalName("TOML")] Toml = 73, [pbr::OriginalName("TeX")] TeX = 82, + [pbr::OriginalName("Thrift")] Thrift = 103, [pbr::OriginalName("TypeScript")] TypeScript = 23, [pbr::OriginalName("TypeScriptReact")] TypeScriptReact = 94, + [pbr::OriginalName("Verilog")] Verilog = 104, + [pbr::OriginalName("VHDL")] Vhdl = 105, [pbr::OriginalName("VisualBasic")] VisualBasic = 63, [pbr::OriginalName("Vue")] Vue = 25, [pbr::OriginalName("Wolfram")] Wolfram = 53, @@ -457,7 +605,7 @@ public enum Language { [pbr::OriginalName("XSL")] Xsl = 32, [pbr::OriginalName("YAML")] Yaml = 74, /// - /// NextLanguage = 95; + /// NextLanguage = 112; /// Steps add a new language: /// 1. Copy-paste the "NextLanguage = N" line above /// 2. Increment "NextLanguage = N" to "NextLanguage = N+1" @@ -479,6 +627,7 @@ public enum Language { /// `metadata` field must appear at the start of the stream and must only appear /// once in the stream. Other field values may appear in any order. /// + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Index : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -686,7 +835,11 @@ public void MergeFrom(pb::CodedInputStream input) { #else uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; @@ -716,7 +869,11 @@ public void MergeFrom(pb::CodedInputStream input) { void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; @@ -742,6 +899,7 @@ public void MergeFrom(pb::CodedInputStream input) { } + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Metadata : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -841,7 +999,8 @@ public string ProjectRoot { private global::Scip.TextEncoding textDocumentEncoding_ = global::Scip.TextEncoding.UnspecifiedTextEncoding; /// /// Text encoding of the source files on disk that are referenced from - /// `Document.relative_path`. + /// `Document.relative_path`. This value is unrelated to the `Document.text` + /// field, which is a Protobuf string and hence must be UTF-8 encoded. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -1002,7 +1161,11 @@ public void MergeFrom(pb::CodedInputStream input) { #else uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; @@ -1036,7 +1199,11 @@ public void MergeFrom(pb::CodedInputStream input) { void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; @@ -1066,6 +1233,7 @@ public void MergeFrom(pb::CodedInputStream input) { } + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class ToolInfo : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1277,7 +1445,11 @@ public void MergeFrom(pb::CodedInputStream input) { #else uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; @@ -1304,7 +1476,11 @@ public void MergeFrom(pb::CodedInputStream input) { void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; @@ -1330,6 +1506,7 @@ public void MergeFrom(pb::CodedInputStream input) { /// /// Document defines the metadata about a source file on disk. /// + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Document : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1368,6 +1545,8 @@ public Document(Document other) : this() { relativePath_ = other.relativePath_; occurrences_ = other.occurrences_.Clone(); symbols_ = other.symbols_.Clone(); + text_ = other.text_; + positionEncoding_ = other.positionEncoding_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -1383,7 +1562,7 @@ public Document Clone() { /// /// The string ID for the programming language this file is written in. /// The `Language` enum contains the names of most common programming languages. - /// This field is typed as a string to permit any programming langauge, including + /// This field is typed as a string to permit any programming language, including /// ones that are not specified by the `Language` enum. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1450,6 +1629,49 @@ public string RelativePath { get { return symbols_; } } + /// Field number for the "text" field. + public const int TextFieldNumber = 5; + private string text_ = ""; + /// + /// (optional) Text contents of this document. Indexers are not expected to + /// include the text by default. It's preferable that clients read the text + /// contents from the file system by resolving the absolute path from joining + /// `Index.metadata.project_root` and `Document.relative_path`. This field + /// can be useful for testing or when working with virtual/in-memory documents. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Text { + get { return text_; } + set { + text_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "position_encoding" field. + public const int PositionEncodingFieldNumber = 6; + private global::Scip.PositionEncoding positionEncoding_ = global::Scip.PositionEncoding.UnspecifiedPositionEncoding; + /// + /// Specifies the encoding used for source ranges in this Document. + /// + /// Usually, this will match the type used to index the string type + /// in the indexer's implementation language in O(1) time. + /// - For an indexer implemented in JVM/.NET language or JavaScript/TypeScript, + /// use UTF16CodeUnitOffsetFromLineStart. + /// - For an indexer implemented in Python, + /// use UTF32CodeUnitOffsetFromLineStart. + /// - For an indexer implemented in Go, Rust or C++, + /// use UTF8ByteOffsetFromLineStart. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Scip.PositionEncoding PositionEncoding { + get { return positionEncoding_; } + set { + positionEncoding_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { @@ -1469,6 +1691,8 @@ public bool Equals(Document other) { if (RelativePath != other.RelativePath) return false; if(!occurrences_.Equals(other.occurrences_)) return false; if(!symbols_.Equals(other.symbols_)) return false; + if (Text != other.Text) return false; + if (PositionEncoding != other.PositionEncoding) return false; return Equals(_unknownFields, other._unknownFields); } @@ -1480,6 +1704,8 @@ public override int GetHashCode() { if (RelativePath.Length != 0) hash ^= RelativePath.GetHashCode(); hash ^= occurrences_.GetHashCode(); hash ^= symbols_.GetHashCode(); + if (Text.Length != 0) hash ^= Text.GetHashCode(); + if (PositionEncoding != global::Scip.PositionEncoding.UnspecifiedPositionEncoding) hash ^= PositionEncoding.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1508,6 +1734,14 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(34); output.WriteString(Language); } + if (Text.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Text); + } + if (PositionEncoding != global::Scip.PositionEncoding.UnspecifiedPositionEncoding) { + output.WriteRawTag(48); + output.WriteEnum((int) PositionEncoding); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -1528,6 +1762,14 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(34); output.WriteString(Language); } + if (Text.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Text); + } + if (PositionEncoding != global::Scip.PositionEncoding.UnspecifiedPositionEncoding) { + output.WriteRawTag(48); + output.WriteEnum((int) PositionEncoding); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -1546,6 +1788,12 @@ public int CalculateSize() { } size += occurrences_.CalculateSize(_repeated_occurrences_codec); size += symbols_.CalculateSize(_repeated_symbols_codec); + if (Text.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Text); + } + if (PositionEncoding != global::Scip.PositionEncoding.UnspecifiedPositionEncoding) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PositionEncoding); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -1566,6 +1814,12 @@ public void MergeFrom(Document other) { } occurrences_.Add(other.occurrences_); symbols_.Add(other.symbols_); + if (other.Text.Length != 0) { + Text = other.Text; + } + if (other.PositionEncoding != global::Scip.PositionEncoding.UnspecifiedPositionEncoding) { + PositionEncoding = other.PositionEncoding; + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1577,7 +1831,11 @@ public void MergeFrom(pb::CodedInputStream input) { #else uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; @@ -1597,6 +1855,14 @@ public void MergeFrom(pb::CodedInputStream input) { Language = input.ReadString(); break; } + case 42: { + Text = input.ReadString(); + break; + } + case 48: { + PositionEncoding = (global::Scip.PositionEncoding) input.ReadEnum(); + break; + } } } #endif @@ -1608,7 +1874,11 @@ public void MergeFrom(pb::CodedInputStream input) { void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; @@ -1628,6 +1898,14 @@ public void MergeFrom(pb::CodedInputStream input) { Language = input.ReadString(); break; } + case 42: { + Text = input.ReadString(); + break; + } + case 48: { + PositionEncoding = (global::Scip.PositionEncoding) input.ReadEnum(); + break; + } } } } @@ -1644,18 +1922,20 @@ public void MergeFrom(pb::CodedInputStream input) { /// interchangeably with `Symbol`. The syntax for Symbol is the following: /// ``` /// # (<x>)+ stands for one or more repetitions of <x> + /// # (<x>)? stands for zero or one occurrence of <x> /// <symbol> ::= <scheme> ' ' <package> ' ' (<descriptor>)+ | 'local ' <local-id> /// <package> ::= <manager> ' ' <package-name> ' ' <version> - /// <scheme> ::= any UTF-8, escape spaces with double space. - /// <manager> ::= same as above, use the placeholder '.' to indicate an empty value + /// <scheme> ::= any UTF-8, escape spaces with double space. Must not be empty nor start with 'local' + /// <manager> ::= any UTF-8, escape spaces with double space. Use the placeholder '.' to indicate an empty value /// <package-name> ::= same as above /// <version> ::= same as above - /// <descriptor> ::= <namespace> | <type> | <term> | <method> | <type-parameter> | <parameter> | <meta> + /// <descriptor> ::= <namespace> | <type> | <term> | <method> | <type-parameter> | <parameter> | <meta> | <macro> /// <namespace> ::= <name> '/' /// <type> ::= <name> '#' /// <term> ::= <name> '.' /// <meta> ::= <name> ':' - /// <method> ::= <name> '(' <method-disambiguator> ').' + /// <macro> ::= <name> '!' + /// <method> ::= <name> '(' (<method-disambiguator>)? ').' /// <type-parameter> ::= '[' <name> ']' /// <parameter> ::= '(' <name> ')' /// <name> ::= <identifier> @@ -1663,8 +1943,9 @@ public void MergeFrom(pb::CodedInputStream input) { /// <identifier> ::= <simple-identifier> | <escaped-identifier> /// <simple-identifier> ::= (<identifier-character>)+ /// <identifier-character> ::= '_' | '+' | '-' | '$' | ASCII letter or digit - /// <escaped-identifier> ::= '`' (<escaped-character>)+ '`' - /// <escaped-characters> ::= any UTF-8 character, escape backticks with double backtick. + /// <escaped-identifier> ::= '`' (<escaped-character>)+ '`', must contain at least one non-<identifier-character> + /// <escaped-characters> ::= any UTF-8, escape backticks with double backtick. + /// <local-id> ::= <simple-identifier> /// ``` /// /// The list of descriptors for a symbol should together form a fully @@ -1672,7 +1953,11 @@ public void MergeFrom(pb::CodedInputStream input) { /// identifier across the package. Typically, it will include one descriptor /// for every node in the AST (along the ancestry path) between the root of /// the file and the node corresponding to the symbol. + /// + /// Local symbols MUST only be used for entities which are local to a Document, + /// and cannot be accessed from outside the Document. /// + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Symbol : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1878,7 +2163,11 @@ public void MergeFrom(pb::CodedInputStream input) { #else uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; @@ -1908,7 +2197,11 @@ public void MergeFrom(pb::CodedInputStream input) { void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; @@ -1939,6 +2232,7 @@ public void MergeFrom(pb::CodedInputStream input) { /// /// NOTE: This corresponds to a module in Go and JVM languages. /// + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Package : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2152,7 +2446,11 @@ public void MergeFrom(pb::CodedInputStream input) { #else uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; @@ -2179,7 +2477,11 @@ public void MergeFrom(pb::CodedInputStream input) { void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; @@ -2202,6 +2504,7 @@ public void MergeFrom(pb::CodedInputStream input) { } + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class SymbolDescriptor : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2275,6 +2578,10 @@ public string Disambiguator { /// Field number for the "suffix" field. public const int SuffixFieldNumber = 3; private global::Scip.SymbolDescriptor.Types.Suffix suffix_ = global::Scip.SymbolDescriptor.Types.Suffix.UnspecifiedSuffix; + /// + /// NOTE: If you add new fields here, make sure to update the prepareSlot() + /// function responsible for parsing symbols. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Scip.SymbolDescriptor.Types.Suffix Suffix { @@ -2415,7 +2722,11 @@ public void MergeFrom(pb::CodedInputStream input) { #else uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; @@ -2442,7 +2753,11 @@ public void MergeFrom(pb::CodedInputStream input) { void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; @@ -2479,18 +2794,19 @@ public enum Suffix { /// /// Use Namespace instead. /// + [global::System.ObsoleteAttribute] [pbr::OriginalName("Package", PreferredAlias = false)] Package = 1, [pbr::OriginalName("Type")] Type = 2, [pbr::OriginalName("Term")] Term = 3, [pbr::OriginalName("Method")] Method = 4, [pbr::OriginalName("TypeParameter")] TypeParameter = 5, [pbr::OriginalName("Parameter")] Parameter = 6, - [pbr::OriginalName("Macro")] Macro = 9, /// /// Can be used for any purpose. /// [pbr::OriginalName("Meta")] Meta = 7, [pbr::OriginalName("Local")] Local = 8, + [pbr::OriginalName("Macro")] Macro = 9, } } @@ -2499,19 +2815,22 @@ public enum Suffix { } /// - /// SymbolInformation defines metadata about a symbol, such as the symbol's - /// docstring or what package it's defined it. + /// Signature represents the signature of a symbol as it's displayed in API + /// documentation or hover tooltips. It uses a subset of Document's fields with + /// the same field numbers for wire compatibility with older indexes that encoded + /// signatures using the Document message type. /// - public sealed partial class SymbolInformation : pb::IMessage + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class Signature : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SymbolInformation()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Signature()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -2527,7 +2846,7 @@ public sealed partial class SymbolInformation : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SymbolInformation() { + public Signature() { OnConstruction(); } @@ -2535,84 +2854,83 @@ public SymbolInformation() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SymbolInformation(SymbolInformation other) : this() { - symbol_ = other.symbol_; - documentation_ = other.documentation_.Clone(); - relationships_ = other.relationships_.Clone(); + public Signature(Signature other) : this() { + language_ = other.language_; + text_ = other.text_; + occurrences_ = other.occurrences_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SymbolInformation Clone() { - return new SymbolInformation(this); + public Signature Clone() { + return new Signature(this); } - /// Field number for the "symbol" field. - public const int SymbolFieldNumber = 1; - private string symbol_ = ""; + /// Field number for the "language" field. + public const int LanguageFieldNumber = 4; + private string language_ = ""; /// - /// Identifier of this symbol, which can be referenced from `Occurence.symbol`. - /// The string must be formatted according to the grammar in `Symbol`. + /// The language of the signature, e.g. "java", "go", "python". /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Symbol { - get { return symbol_; } + public string Language { + get { return language_; } set { - symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + language_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Field number for the "documentation" field. - public const int DocumentationFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_documentation_codec - = pb::FieldCodec.ForString(26); - private readonly pbc::RepeatedField documentation_ = new pbc::RepeatedField(); + /// Field number for the "text" field. + public const int TextFieldNumber = 5; + private string text_ = ""; /// - /// (optional, but strongly recommended) The markdown-formatted documentation - /// for this symbol. This field is repeated to allow different kinds of - /// documentation. For example, it's nice to include both the signature of a - /// method (parameters and return type) along with the accompanying docstring. + /// The text content of the signature, e.g. "void add(int a, int b)". /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Documentation { - get { return documentation_; } + public string Text { + get { return text_; } + set { + text_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } } - /// Field number for the "relationships" field. - public const int RelationshipsFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_relationships_codec - = pb::FieldCodec.ForMessage(34, global::Scip.Relationship.Parser); - private readonly pbc::RepeatedField relationships_ = new pbc::RepeatedField(); + /// Field number for the "occurrences" field. + public const int OccurrencesFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_occurrences_codec + = pb::FieldCodec.ForMessage(18, global::Scip.Occurrence.Parser); + private readonly pbc::RepeatedField occurrences_ = new pbc::RepeatedField(); /// - /// (optional) Relationships to other symbols (e.g., implements, type definition). + /// (optional) Occurrences within the signature text that reference other + /// symbols, enabling hyperlinking of types in the signature. Ranges are + /// relative to the `text` field. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Relationships { - get { return relationships_; } + public pbc::RepeatedField Occurrences { + get { return occurrences_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { - return Equals(other as SymbolInformation); + return Equals(other as Signature); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(SymbolInformation other) { + public bool Equals(Signature other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Symbol != other.Symbol) return false; - if(!documentation_.Equals(other.documentation_)) return false; - if(!relationships_.Equals(other.relationships_)) return false; + if (Language != other.Language) return false; + if (Text != other.Text) return false; + if(!occurrences_.Equals(other.occurrences_)) return false; return Equals(_unknownFields, other._unknownFields); } @@ -2620,9 +2938,9 @@ public bool Equals(SymbolInformation other) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); - hash ^= documentation_.GetHashCode(); - hash ^= relationships_.GetHashCode(); + if (Language.Length != 0) hash ^= Language.GetHashCode(); + if (Text.Length != 0) hash ^= Text.GetHashCode(); + hash ^= occurrences_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2641,12 +2959,15 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Symbol.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Symbol); + occurrences_.WriteTo(output, _repeated_occurrences_codec); + if (Language.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Language); + } + if (Text.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Text); } - documentation_.WriteTo(output, _repeated_documentation_codec); - relationships_.WriteTo(output, _repeated_relationships_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2657,12 +2978,15 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Symbol.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Symbol); + occurrences_.WriteTo(ref output, _repeated_occurrences_codec); + if (Language.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Language); + } + if (Text.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Text); } - documentation_.WriteTo(ref output, _repeated_documentation_codec); - relationships_.WriteTo(ref output, _repeated_relationships_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -2673,11 +2997,13 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (Symbol.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + if (Language.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Language); } - size += documentation_.CalculateSize(_repeated_documentation_codec); - size += relationships_.CalculateSize(_repeated_relationships_codec); + if (Text.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Text); + } + size += occurrences_.CalculateSize(_repeated_occurrences_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2686,15 +3012,17 @@ public int CalculateSize() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(SymbolInformation other) { + public void MergeFrom(Signature other) { if (other == null) { return; } - if (other.Symbol.Length != 0) { - Symbol = other.Symbol; + if (other.Language.Length != 0) { + Language = other.Language; } - documentation_.Add(other.documentation_); - relationships_.Add(other.relationships_); + if (other.Text.Length != 0) { + Text = other.Text; + } + occurrences_.Add(other.occurrences_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2706,20 +3034,24 @@ public void MergeFrom(pb::CodedInputStream input) { #else uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - Symbol = input.ReadString(); + case 18: { + occurrences_.AddEntriesFrom(input, _repeated_occurrences_codec); break; } - case 26: { - documentation_.AddEntriesFrom(input, _repeated_documentation_codec); + case 34: { + Language = input.ReadString(); break; } - case 34: { - relationships_.AddEntriesFrom(input, _repeated_relationships_codec); + case 42: { + Text = input.ReadString(); break; } } @@ -2733,20 +3065,24 @@ public void MergeFrom(pb::CodedInputStream input) { void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - Symbol = input.ReadString(); + case 18: { + occurrences_.AddEntriesFrom(ref input, _repeated_occurrences_codec); break; } - case 26: { - documentation_.AddEntriesFrom(ref input, _repeated_documentation_codec); + case 34: { + Language = input.ReadString(); break; } - case 34: { - relationships_.AddEntriesFrom(ref input, _repeated_relationships_codec); + case 42: { + Text = input.ReadString(); break; } } @@ -2756,16 +3092,21 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class Relationship : pb::IMessage + /// + /// SymbolInformation defines metadata about a symbol, such as the symbol's + /// docstring or what package it's defined it. + /// + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class SymbolInformation : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Relationship()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SymbolInformation()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -2781,7 +3122,7 @@ public sealed partial class Relationship : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Relationship() { + public SymbolInformation() { OnConstruction(); } @@ -2789,24 +3130,30 @@ public Relationship() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Relationship(Relationship other) : this() { + public SymbolInformation(SymbolInformation other) : this() { symbol_ = other.symbol_; - isReference_ = other.isReference_; - isImplementation_ = other.isImplementation_; - isTypeDefinition_ = other.isTypeDefinition_; - isDefinition_ = other.isDefinition_; + documentation_ = other.documentation_.Clone(); + relationships_ = other.relationships_.Clone(); + kind_ = other.kind_; + displayName_ = other.displayName_; + signatureDocumentation_ = other.signatureDocumentation_ != null ? other.signatureDocumentation_.Clone() : null; + enclosingSymbol_ = other.enclosingSymbol_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Relationship Clone() { - return new Relationship(this); + public SymbolInformation Clone() { + return new SymbolInformation(this); } /// Field number for the "symbol" field. public const int SymbolFieldNumber = 1; private string symbol_ = ""; + /// + /// Identifier of this symbol, which can be referenced from `Occurence.symbol`. + /// The string must be formatted according to the grammar in `Symbol`. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Symbol { @@ -2816,131 +3163,1483 @@ public string Symbol { } } - /// Field number for the "is_reference" field. - public const int IsReferenceFieldNumber = 2; - private bool isReference_; + /// Field number for the "documentation" field. + public const int DocumentationFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_documentation_codec + = pb::FieldCodec.ForString(26); + private readonly pbc::RepeatedField documentation_ = new pbc::RepeatedField(); /// - /// When resolving "Find references", this field documents what other symbols - /// should be included together with this symbol. For example, consider the - /// following TypeScript code that defines two symbols `Animal#sound()` and - /// `Dog#sound()`: - /// ```ts - /// interface Animal { - /// ^^^^^^ definition Animal# - /// sound(): string - /// ^^^^^ definition Animal#sound() - /// } - /// class Dog implements Animal { - /// ^^^ definition Dog#, implementation_symbols = Animal# - /// public sound(): string { return "woof" } - /// ^^^^^ definition Dog#sound(), references_symbols = Animal#sound(), implementation_symbols = Animal#sound() - /// } - /// const animal: Animal = new Dog() - /// ^^^^^^ reference Animal# - /// console.log(animal.sound()) - /// ^^^^^ reference Animal#sound() - /// ``` - /// Doing "Find references" on the symbol `Animal#sound()` should return - /// references to the `Dog#sound()` method as well. Vice-versa, doing "Find - /// references" on the `Dog#sound()` method should include references to the - /// `Animal#sound()` method as well. + /// (optional, but strongly recommended) The markdown-formatted documentation + /// for this symbol. Use `SymbolInformation.signature_documentation` to + /// document the method/class/type signature of this symbol. + /// Due to historical reasons, indexers may include signature documentation in + /// this field by rendering markdown code blocks. New indexers should only + /// include non-code documentation in this field, for example docstrings. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Documentation { + get { return documentation_; } + } + + /// Field number for the "relationships" field. + public const int RelationshipsFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_relationships_codec + = pb::FieldCodec.ForMessage(34, global::Scip.Relationship.Parser); + private readonly pbc::RepeatedField relationships_ = new pbc::RepeatedField(); + /// + /// (optional) Relationships to other symbols (e.g., implements, type definition). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Relationships { + get { return relationships_; } + } + + /// Field number for the "kind" field. + public const int KindFieldNumber = 5; + private global::Scip.SymbolInformation.Types.Kind kind_ = global::Scip.SymbolInformation.Types.Kind.UnspecifiedKind; + /// + /// The kind of this symbol. Use this field instead of + /// `SymbolDescriptor.Suffix` to determine whether something is, for example, a + /// class or a method. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Scip.SymbolInformation.Types.Kind Kind { + get { return kind_; } + set { + kind_ = value; + } + } + + /// Field number for the "display_name" field. + public const int DisplayNameFieldNumber = 6; + private string displayName_ = ""; + /// + /// (optional) The name of this symbol as it should be displayed to the user. + /// For example, the symbol "com/example/MyClass#myMethod(+1)." should have the + /// display name "myMethod". The `symbol` field is not a reliable source of + /// the display name for several reasons: + /// + /// - Local symbols don't encode the name. + /// - Some languages have case-insensitive names, so the symbol is all-lowercase. + /// - The symbol may encode names with special characters that should not be + /// displayed to the user. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string DisplayName { + get { return displayName_; } + set { + displayName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "signature_documentation" field. + public const int SignatureDocumentationFieldNumber = 7; + private global::Scip.Signature signatureDocumentation_; + /// + /// (optional) The signature of this symbol as it's displayed in API + /// documentation or in hover tooltips. For example, a Java method that adds + /// two numbers would have `Signature.language = "java"` and + /// `Signature.text = "void add(int a, int b)"`. The `language` and `text` + /// fields are required while `occurrences` can be optionally included to + /// support hyperlinking referenced symbols in the signature. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Scip.Signature SignatureDocumentation { + get { return signatureDocumentation_; } + set { + signatureDocumentation_ = value; + } + } + + /// Field number for the "enclosing_symbol" field. + public const int EnclosingSymbolFieldNumber = 8; + private string enclosingSymbol_ = ""; + /// + /// (optional) The enclosing symbol if this is a local symbol. For non-local + /// symbols, the enclosing symbol should be parsed from the `symbol` field + /// using the `Descriptor` grammar. + /// + /// The primary use-case for this field is to allow local symbol to be displayed + /// in a symbol hierarchy for API documentation. It's OK to leave this field + /// empty for local variables since local variables usually don't belong in API + /// documentation. However, in the situation that you wish to include a local + /// symbol in the hierarchy, then you can use `enclosing_symbol` to locate the + /// "parent" or "owner" of this local symbol. For example, a Java indexer may + /// choose to use local symbols for private class fields while providing an + /// `enclosing_symbol` to reference the enclosing class to allow the field to + /// be part of the class documentation hierarchy. From the perspective of an + /// author of an indexer, the decision to use a local symbol or global symbol + /// should exclusively be determined whether the local symbol is accessible + /// outside the document, not by the capability to find the enclosing + /// symbol. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool IsReference { - get { return isReference_; } + public string EnclosingSymbol { + get { return enclosingSymbol_; } + set { + enclosingSymbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SymbolInformation); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SymbolInformation other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if(!documentation_.Equals(other.documentation_)) return false; + if(!relationships_.Equals(other.relationships_)) return false; + if (Kind != other.Kind) return false; + if (DisplayName != other.DisplayName) return false; + if (!object.Equals(SignatureDocumentation, other.SignatureDocumentation)) return false; + if (EnclosingSymbol != other.EnclosingSymbol) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + hash ^= documentation_.GetHashCode(); + hash ^= relationships_.GetHashCode(); + if (Kind != global::Scip.SymbolInformation.Types.Kind.UnspecifiedKind) hash ^= Kind.GetHashCode(); + if (DisplayName.Length != 0) hash ^= DisplayName.GetHashCode(); + if (signatureDocumentation_ != null) hash ^= SignatureDocumentation.GetHashCode(); + if (EnclosingSymbol.Length != 0) hash ^= EnclosingSymbol.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + documentation_.WriteTo(output, _repeated_documentation_codec); + relationships_.WriteTo(output, _repeated_relationships_codec); + if (Kind != global::Scip.SymbolInformation.Types.Kind.UnspecifiedKind) { + output.WriteRawTag(40); + output.WriteEnum((int) Kind); + } + if (DisplayName.Length != 0) { + output.WriteRawTag(50); + output.WriteString(DisplayName); + } + if (signatureDocumentation_ != null) { + output.WriteRawTag(58); + output.WriteMessage(SignatureDocumentation); + } + if (EnclosingSymbol.Length != 0) { + output.WriteRawTag(66); + output.WriteString(EnclosingSymbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + documentation_.WriteTo(ref output, _repeated_documentation_codec); + relationships_.WriteTo(ref output, _repeated_relationships_codec); + if (Kind != global::Scip.SymbolInformation.Types.Kind.UnspecifiedKind) { + output.WriteRawTag(40); + output.WriteEnum((int) Kind); + } + if (DisplayName.Length != 0) { + output.WriteRawTag(50); + output.WriteString(DisplayName); + } + if (signatureDocumentation_ != null) { + output.WriteRawTag(58); + output.WriteMessage(SignatureDocumentation); + } + if (EnclosingSymbol.Length != 0) { + output.WriteRawTag(66); + output.WriteString(EnclosingSymbol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + size += documentation_.CalculateSize(_repeated_documentation_codec); + size += relationships_.CalculateSize(_repeated_relationships_codec); + if (Kind != global::Scip.SymbolInformation.Types.Kind.UnspecifiedKind) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Kind); + } + if (DisplayName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(DisplayName); + } + if (signatureDocumentation_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SignatureDocumentation); + } + if (EnclosingSymbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(EnclosingSymbol); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SymbolInformation other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + documentation_.Add(other.documentation_); + relationships_.Add(other.relationships_); + if (other.Kind != global::Scip.SymbolInformation.Types.Kind.UnspecifiedKind) { + Kind = other.Kind; + } + if (other.DisplayName.Length != 0) { + DisplayName = other.DisplayName; + } + if (other.signatureDocumentation_ != null) { + if (signatureDocumentation_ == null) { + SignatureDocumentation = new global::Scip.Signature(); + } + SignatureDocumentation.MergeFrom(other.SignatureDocumentation); + } + if (other.EnclosingSymbol.Length != 0) { + EnclosingSymbol = other.EnclosingSymbol; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 26: { + documentation_.AddEntriesFrom(input, _repeated_documentation_codec); + break; + } + case 34: { + relationships_.AddEntriesFrom(input, _repeated_relationships_codec); + break; + } + case 40: { + Kind = (global::Scip.SymbolInformation.Types.Kind) input.ReadEnum(); + break; + } + case 50: { + DisplayName = input.ReadString(); + break; + } + case 58: { + if (signatureDocumentation_ == null) { + SignatureDocumentation = new global::Scip.Signature(); + } + input.ReadMessage(SignatureDocumentation); + break; + } + case 66: { + EnclosingSymbol = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 26: { + documentation_.AddEntriesFrom(ref input, _repeated_documentation_codec); + break; + } + case 34: { + relationships_.AddEntriesFrom(ref input, _repeated_relationships_codec); + break; + } + case 40: { + Kind = (global::Scip.SymbolInformation.Types.Kind) input.ReadEnum(); + break; + } + case 50: { + DisplayName = input.ReadString(); + break; + } + case 58: { + if (signatureDocumentation_ == null) { + SignatureDocumentation = new global::Scip.Signature(); + } + input.ReadMessage(SignatureDocumentation); + break; + } + case 66: { + EnclosingSymbol = input.ReadString(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the SymbolInformation message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// (optional) Kind represents the fine-grained category of a symbol, suitable for presenting + /// information about the symbol's meaning in the language. + /// + /// For example: + /// - A Java method would have the kind `Method` while a Go function would + /// have the kind `Function`, even if the symbols for these use the same + /// syntax for the descriptor `SymbolDescriptor.Suffix.Method`. + /// - A Go struct has the symbol kind `Struct` while a Java class has + /// the symbol kind `Class` even if they both have the same descriptor: + /// `SymbolDescriptor.Suffix.Type`. + /// + /// Since Kind is more fine-grained than Suffix: + /// - If two symbols have the same Kind, they should share the same Suffix. + /// - If two symbols have different Suffixes, they should have different Kinds. + /// + public enum Kind { + [pbr::OriginalName("UnspecifiedKind")] UnspecifiedKind = 0, + /// + /// A method which may or may not have a body. For Java, Kotlin etc. + /// + [pbr::OriginalName("AbstractMethod")] AbstractMethod = 66, + /// + /// For Ruby's attr_accessor + /// + [pbr::OriginalName("Accessor")] Accessor = 72, + [pbr::OriginalName("Array")] Array = 1, + /// + /// For Alloy + /// + [pbr::OriginalName("Assertion")] Assertion = 2, + [pbr::OriginalName("AssociatedType")] AssociatedType = 3, + /// + /// For C++ + /// + [pbr::OriginalName("Attribute")] Attribute = 4, + /// + /// For Lean + /// + [pbr::OriginalName("Axiom")] Axiom = 5, + [pbr::OriginalName("Boolean")] Boolean = 6, + [pbr::OriginalName("Class")] Class = 7, + /// + /// For C++ + /// + [pbr::OriginalName("Concept")] Concept = 86, + [pbr::OriginalName("Constant")] Constant = 8, + [pbr::OriginalName("Constructor")] Constructor = 9, + /// + /// For Solidity + /// + [pbr::OriginalName("Contract")] Contract = 62, + /// + /// For Haskell + /// + [pbr::OriginalName("DataFamily")] DataFamily = 10, + /// + /// For C# and F# + /// + [pbr::OriginalName("Delegate")] Delegate = 73, + [pbr::OriginalName("Enum")] Enum = 11, + [pbr::OriginalName("EnumMember")] EnumMember = 12, + [pbr::OriginalName("Error")] Error = 63, + [pbr::OriginalName("Event")] Event = 13, + /// + /// For Dart + /// + [pbr::OriginalName("Extension")] Extension = 84, + /// + /// For Alloy + /// + [pbr::OriginalName("Fact")] Fact = 14, + [pbr::OriginalName("Field")] Field = 15, + [pbr::OriginalName("File")] File = 16, + [pbr::OriginalName("Function")] Function = 17, + /// + /// For 'get' in Swift, 'attr_reader' in Ruby + /// + [pbr::OriginalName("Getter")] Getter = 18, + /// + /// For Raku + /// + [pbr::OriginalName("Grammar")] Grammar = 19, + /// + /// For Purescript and Lean + /// + [pbr::OriginalName("Instance")] Instance = 20, + [pbr::OriginalName("Interface")] Interface = 21, + [pbr::OriginalName("Key")] Key = 22, + /// + /// For Racket + /// + [pbr::OriginalName("Lang")] Lang = 23, + /// + /// For Lean + /// + [pbr::OriginalName("Lemma")] Lemma = 24, + /// + /// For solidity + /// + [pbr::OriginalName("Library")] Library = 64, + [pbr::OriginalName("Macro")] Macro = 25, + [pbr::OriginalName("Method")] Method = 26, + /// + /// For Ruby + /// + [pbr::OriginalName("MethodAlias")] MethodAlias = 74, + /// + /// Analogous to 'ThisParameter' and 'SelfParameter', but for languages + /// like Go where the receiver doesn't have a conventional name. + /// + [pbr::OriginalName("MethodReceiver")] MethodReceiver = 27, + /// + /// Analogous to 'AbstractMethod', for Go. + /// + [pbr::OriginalName("MethodSpecification")] MethodSpecification = 67, + /// + /// For Protobuf + /// + [pbr::OriginalName("Message")] Message = 28, + /// + /// For Dart + /// + [pbr::OriginalName("Mixin")] Mixin = 85, + /// + /// For Solidity + /// + [pbr::OriginalName("Modifier")] Modifier = 65, + [pbr::OriginalName("Module")] Module = 29, + [pbr::OriginalName("Namespace")] Namespace = 30, + [pbr::OriginalName("Null")] Null = 31, + [pbr::OriginalName("Number")] Number = 32, + [pbr::OriginalName("Object")] Object = 33, + [pbr::OriginalName("Operator")] Operator = 34, + [pbr::OriginalName("Package")] Package = 35, + [pbr::OriginalName("PackageObject")] PackageObject = 36, + [pbr::OriginalName("Parameter")] Parameter = 37, + [pbr::OriginalName("ParameterLabel")] ParameterLabel = 38, + /// + /// For Haskell's PatternSynonyms + /// + [pbr::OriginalName("Pattern")] Pattern = 39, + /// + /// For Alloy + /// + [pbr::OriginalName("Predicate")] Predicate = 40, + [pbr::OriginalName("Property")] Property = 41, + /// + /// Analogous to 'Trait' and 'TypeClass', for Swift and Objective-C + /// + [pbr::OriginalName("Protocol")] Protocol = 42, + /// + /// Analogous to 'AbstractMethod', for Swift and Objective-C. + /// + [pbr::OriginalName("ProtocolMethod")] ProtocolMethod = 68, + /// + /// Analogous to 'AbstractMethod', for C++. + /// + [pbr::OriginalName("PureVirtualMethod")] PureVirtualMethod = 69, + /// + /// For Haskell + /// + [pbr::OriginalName("Quasiquoter")] Quasiquoter = 43, + /// + /// 'self' in Python, Rust, Swift etc. + /// + [pbr::OriginalName("SelfParameter")] SelfParameter = 44, + /// + /// For 'set' in Swift, 'attr_writer' in Ruby + /// + [pbr::OriginalName("Setter")] Setter = 45, + /// + /// For Alloy, analogous to 'Struct'. + /// + [pbr::OriginalName("Signature")] Signature = 46, + /// + /// For Ruby + /// + [pbr::OriginalName("SingletonClass")] SingletonClass = 75, + /// + /// Analogous to 'StaticMethod', for Ruby. + /// + [pbr::OriginalName("SingletonMethod")] SingletonMethod = 76, + /// + /// Analogous to 'StaticField', for C++ + /// + [pbr::OriginalName("StaticDataMember")] StaticDataMember = 77, + /// + /// For C# + /// + [pbr::OriginalName("StaticEvent")] StaticEvent = 78, + /// + /// For C# + /// + [pbr::OriginalName("StaticField")] StaticField = 79, + /// + /// For Java, C#, C++ etc. + /// + [pbr::OriginalName("StaticMethod")] StaticMethod = 80, + /// + /// For C#, TypeScript etc. + /// + [pbr::OriginalName("StaticProperty")] StaticProperty = 81, + /// + /// For C, C++ + /// + [pbr::OriginalName("StaticVariable")] StaticVariable = 82, + [pbr::OriginalName("String")] String = 48, + [pbr::OriginalName("Struct")] Struct = 49, + /// + /// For Swift + /// + [pbr::OriginalName("Subscript")] Subscript = 47, + /// + /// For Lean + /// + [pbr::OriginalName("Tactic")] Tactic = 50, + /// + /// For Lean + /// + [pbr::OriginalName("Theorem")] Theorem = 51, + /// + /// Method receiver for languages + /// 'this' in JavaScript, C++, Java etc. + /// + [pbr::OriginalName("ThisParameter")] ThisParameter = 52, + /// + /// Analogous to 'Protocol' and 'TypeClass', for Rust, Scala etc. + /// + [pbr::OriginalName("Trait")] Trait = 53, + /// + /// Analogous to 'AbstractMethod', for Rust, Scala etc. + /// + [pbr::OriginalName("TraitMethod")] TraitMethod = 70, + /// + /// Data type definition for languages like OCaml which use `type` + /// rather than separate keywords like `struct` and `enum`. + /// + [pbr::OriginalName("Type")] Type = 54, + [pbr::OriginalName("TypeAlias")] TypeAlias = 55, + /// + /// Analogous to 'Trait' and 'Protocol', for Haskell, Purescript etc. + /// + [pbr::OriginalName("TypeClass")] TypeClass = 56, + /// + /// Analogous to 'AbstractMethod', for Haskell, Purescript etc. + /// + [pbr::OriginalName("TypeClassMethod")] TypeClassMethod = 71, + /// + /// For Haskell + /// + [pbr::OriginalName("TypeFamily")] TypeFamily = 57, + [pbr::OriginalName("TypeParameter")] TypeParameter = 58, + /// + /// For C, C++, Capn Proto + /// + [pbr::OriginalName("Union")] Union = 59, + [pbr::OriginalName("Value")] Value = 60, + /// + /// Next = 87; + /// Feel free to open a PR proposing new language-specific kinds. + /// + [pbr::OriginalName("Variable")] Variable = 61, + } + + } + #endregion + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class Relationship : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Relationship()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Scip.ScipReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Relationship() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Relationship(Relationship other) : this() { + symbol_ = other.symbol_; + isReference_ = other.isReference_; + isImplementation_ = other.isImplementation_; + isTypeDefinition_ = other.isTypeDefinition_; + isDefinition_ = other.isDefinition_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Relationship Clone() { + return new Relationship(this); + } + + /// Field number for the "symbol" field. + public const int SymbolFieldNumber = 1; + private string symbol_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Symbol { + get { return symbol_; } + set { + symbol_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "is_reference" field. + public const int IsReferenceFieldNumber = 2; + private bool isReference_; + /// + /// When resolving "Find references", this field documents what other symbols + /// should be included together with this symbol. For example, consider the + /// following TypeScript code that defines two symbols `Animal#sound()` and + /// `Dog#sound()`: + /// ```ts + /// interface Animal { + /// ^^^^^^ definition Animal# + /// sound(): string + /// ^^^^^ definition Animal#sound() + /// } + /// class Dog implements Animal { + /// ^^^ definition Dog#, relationships = [{symbol: "Animal#", is_implementation: true}] + /// public sound(): string { return "woof" } + /// ^^^^^ definition Dog#sound(), references_symbols = Animal#sound(), relationships = [{symbol: "Animal#sound()", is_implementation:true, is_reference: true}] + /// } + /// const animal: Animal = new Dog() + /// ^^^^^^ reference Animal# + /// console.log(animal.sound()) + /// ^^^^^ reference Animal#sound() + /// ``` + /// Doing "Find references" on the symbol `Animal#sound()` should return + /// references to the `Dog#sound()` method as well. Vice-versa, doing "Find + /// references" on the `Dog#sound()` method should include references to the + /// `Animal#sound()` method as well. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsReference { + get { return isReference_; } + set { + isReference_ = value; + } + } + + /// Field number for the "is_implementation" field. + public const int IsImplementationFieldNumber = 3; + private bool isImplementation_; + /// + /// Similar to `is_reference` but for "Find implementations". + /// It's common for `is_implementation` and `is_reference` to both be true but + /// it's not always the case. + /// In the TypeScript example above, observe that `Dog#` has an + /// `is_implementation` relationship with `"Animal#"` but not `is_reference`. + /// This is because "Find references" on the "Animal#" symbol should not return + /// "Dog#". We only want "Dog#" to return as a result for "Find + /// implementations" on the "Animal#" symbol. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsImplementation { + get { return isImplementation_; } + set { + isImplementation_ = value; + } + } + + /// Field number for the "is_type_definition" field. + public const int IsTypeDefinitionFieldNumber = 4; + private bool isTypeDefinition_; + /// + /// Similar to `references_symbols` but for "Go to type definition". + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsTypeDefinition { + get { return isTypeDefinition_; } + set { + isTypeDefinition_ = value; + } + } + + /// Field number for the "is_definition" field. + public const int IsDefinitionFieldNumber = 5; + private bool isDefinition_; + /// + /// Allows overriding the behavior of "Go to definition" and "Find references" + /// for symbols which do not have a definition of their own or could + /// potentially have multiple definitions. + /// + /// For example, in a language with single inheritance and no field overriding, + /// inherited fields can reuse the same symbol as the ancestor which declares + /// the field. In such a situation, is_definition is not needed. + /// + /// On the other hand, in languages with single inheritance and some form + /// of mixins, you can use is_definition to relate the symbol to the + /// matching symbol in ancestor classes, and is_reference to relate the + /// symbol to the matching symbol in mixins. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsDefinition { + get { return isDefinition_; } + set { + isDefinition_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Relationship); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Relationship other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Symbol != other.Symbol) return false; + if (IsReference != other.IsReference) return false; + if (IsImplementation != other.IsImplementation) return false; + if (IsTypeDefinition != other.IsTypeDefinition) return false; + if (IsDefinition != other.IsDefinition) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); + if (IsReference != false) hash ^= IsReference.GetHashCode(); + if (IsImplementation != false) hash ^= IsImplementation.GetHashCode(); + if (IsTypeDefinition != false) hash ^= IsTypeDefinition.GetHashCode(); + if (IsDefinition != false) hash ^= IsDefinition.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (IsReference != false) { + output.WriteRawTag(16); + output.WriteBool(IsReference); + } + if (IsImplementation != false) { + output.WriteRawTag(24); + output.WriteBool(IsImplementation); + } + if (IsTypeDefinition != false) { + output.WriteRawTag(32); + output.WriteBool(IsTypeDefinition); + } + if (IsDefinition != false) { + output.WriteRawTag(40); + output.WriteBool(IsDefinition); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Symbol.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Symbol); + } + if (IsReference != false) { + output.WriteRawTag(16); + output.WriteBool(IsReference); + } + if (IsImplementation != false) { + output.WriteRawTag(24); + output.WriteBool(IsImplementation); + } + if (IsTypeDefinition != false) { + output.WriteRawTag(32); + output.WriteBool(IsTypeDefinition); + } + if (IsDefinition != false) { + output.WriteRawTag(40); + output.WriteBool(IsDefinition); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Symbol.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); + } + if (IsReference != false) { + size += 1 + 1; + } + if (IsImplementation != false) { + size += 1 + 1; + } + if (IsTypeDefinition != false) { + size += 1 + 1; + } + if (IsDefinition != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Relationship other) { + if (other == null) { + return; + } + if (other.Symbol.Length != 0) { + Symbol = other.Symbol; + } + if (other.IsReference != false) { + IsReference = other.IsReference; + } + if (other.IsImplementation != false) { + IsImplementation = other.IsImplementation; + } + if (other.IsTypeDefinition != false) { + IsTypeDefinition = other.IsTypeDefinition; + } + if (other.IsDefinition != false) { + IsDefinition = other.IsDefinition; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + IsReference = input.ReadBool(); + break; + } + case 24: { + IsImplementation = input.ReadBool(); + break; + } + case 32: { + IsTypeDefinition = input.ReadBool(); + break; + } + case 40: { + IsDefinition = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Symbol = input.ReadString(); + break; + } + case 16: { + IsReference = input.ReadBool(); + break; + } + case 24: { + IsImplementation = input.ReadBool(); + break; + } + case 32: { + IsTypeDefinition = input.ReadBool(); + break; + } + case 40: { + IsDefinition = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + /// + /// SingleLineRange represents a half-open [start, end) range within a single line. + /// + /// Line numbers and characters are always 0-based. Make sure to increment them + /// before displaying in an editor-like UI because editors conventionally use + /// 1-based numbers. The `character` values are interpreted based on the + /// `PositionEncoding` for the enclosing Document. + /// + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class SingleLineRange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SingleLineRange()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Scip.ScipReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SingleLineRange() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SingleLineRange(SingleLineRange other) : this() { + line_ = other.line_; + startCharacter_ = other.startCharacter_; + endCharacter_ = other.endCharacter_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SingleLineRange Clone() { + return new SingleLineRange(this); + } + + /// Field number for the "line" field. + public const int LineFieldNumber = 1; + private int line_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Line { + get { return line_; } + set { + line_ = value; + } + } + + /// Field number for the "start_character" field. + public const int StartCharacterFieldNumber = 2; + private int startCharacter_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int StartCharacter { + get { return startCharacter_; } + set { + startCharacter_ = value; + } + } + + /// Field number for the "end_character" field. + public const int EndCharacterFieldNumber = 3; + private int endCharacter_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int EndCharacter { + get { return endCharacter_; } + set { + endCharacter_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SingleLineRange); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SingleLineRange other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Line != other.Line) return false; + if (StartCharacter != other.StartCharacter) return false; + if (EndCharacter != other.EndCharacter) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Line != 0) hash ^= Line.GetHashCode(); + if (StartCharacter != 0) hash ^= StartCharacter.GetHashCode(); + if (EndCharacter != 0) hash ^= EndCharacter.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Line != 0) { + output.WriteRawTag(8); + output.WriteInt32(Line); + } + if (StartCharacter != 0) { + output.WriteRawTag(16); + output.WriteInt32(StartCharacter); + } + if (EndCharacter != 0) { + output.WriteRawTag(24); + output.WriteInt32(EndCharacter); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Line != 0) { + output.WriteRawTag(8); + output.WriteInt32(Line); + } + if (StartCharacter != 0) { + output.WriteRawTag(16); + output.WriteInt32(StartCharacter); + } + if (EndCharacter != 0) { + output.WriteRawTag(24); + output.WriteInt32(EndCharacter); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Line != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Line); + } + if (StartCharacter != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(StartCharacter); + } + if (EndCharacter != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(EndCharacter); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SingleLineRange other) { + if (other == null) { + return; + } + if (other.Line != 0) { + Line = other.Line; + } + if (other.StartCharacter != 0) { + StartCharacter = other.StartCharacter; + } + if (other.EndCharacter != 0) { + EndCharacter = other.EndCharacter; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Line = input.ReadInt32(); + break; + } + case 16: { + StartCharacter = input.ReadInt32(); + break; + } + case 24: { + EndCharacter = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Line = input.ReadInt32(); + break; + } + case 16: { + StartCharacter = input.ReadInt32(); + break; + } + case 24: { + EndCharacter = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + /// + /// MultiLineRange represents a half-open [start, end) range spanning multiple lines. + /// + /// Line numbers and characters are always 0-based. Make sure to increment them + /// before displaying in an editor-like UI because editors conventionally use + /// 1-based numbers. The `character` values are interpreted based on the + /// `PositionEncoding` for the enclosing Document. + /// + /// Producers SHOULD use `SingleLineRange` when `start_line == end_line` to keep + /// indexes compact, but consumers MUST accept multi-line encoding even when the + /// range happens to fit on a single line. + /// + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class MultiLineRange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MultiLineRange()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Scip.ScipReflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MultiLineRange() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MultiLineRange(MultiLineRange other) : this() { + startLine_ = other.startLine_; + startCharacter_ = other.startCharacter_; + endLine_ = other.endLine_; + endCharacter_ = other.endCharacter_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MultiLineRange Clone() { + return new MultiLineRange(this); + } + + /// Field number for the "start_line" field. + public const int StartLineFieldNumber = 1; + private int startLine_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int StartLine { + get { return startLine_; } set { - isReference_ = value; + startLine_ = value; } } - /// Field number for the "is_implementation" field. - public const int IsImplementationFieldNumber = 3; - private bool isImplementation_; - /// - /// Similar to `references_symbols` but for "Go to implementation". - /// It's common for the `implementation_symbols` and `references_symbols` fields - /// have the same values but that's not always the case. - /// In the TypeScript example above, observe that `implementation_symbols` has - /// the value `"Animal#"` for the "Dog#" symbol while `references_symbols` is - /// empty. When requesting "Find references" on the "Animal#" symbol we don't - /// want to include references to "Dog#" even if "Go to implementation" on the - /// "Animal#" symbol should navigate to the "Dog#" symbol. - /// + /// Field number for the "start_character" field. + public const int StartCharacterFieldNumber = 2; + private int startCharacter_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool IsImplementation { - get { return isImplementation_; } + public int StartCharacter { + get { return startCharacter_; } set { - isImplementation_ = value; + startCharacter_ = value; } } - /// Field number for the "is_type_definition" field. - public const int IsTypeDefinitionFieldNumber = 4; - private bool isTypeDefinition_; - /// - /// Similar to `references_symbols` but for "Go to type definition". - /// + /// Field number for the "end_line" field. + public const int EndLineFieldNumber = 3; + private int endLine_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool IsTypeDefinition { - get { return isTypeDefinition_; } + public int EndLine { + get { return endLine_; } set { - isTypeDefinition_ = value; + endLine_ = value; } } - /// Field number for the "is_definition" field. - public const int IsDefinitionFieldNumber = 5; - private bool isDefinition_; - /// - /// Allows overriding the behavior of "Go to definition" and "Find references" - /// for symbols which do not have a definition of their own or could - /// potentially have multiple definitions. - /// - /// For example, in a language with single inheritance and no field overriding, - /// inherited fields can reuse the same symbol as the ancestor which declares - /// the field. In such a situation, is_definition is not needed. - /// - /// On the other hand, in languages with single inheritance and some form - /// of mixins, you can use is_definition to relate the symbol to the - /// matching symbol in ancestor classes, and is_reference to relate the - /// symbol to the matching symbol in mixins. - /// - /// NOTE: At the moment, due to limitations of the SCIP to LSIF conversion, - /// only global symbols in an index are allowed to use is_definition. - /// The relationship may not get recorded if either symbol is local. - /// + /// Field number for the "end_character" field. + public const int EndCharacterFieldNumber = 4; + private int endCharacter_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool IsDefinition { - get { return isDefinition_; } + public int EndCharacter { + get { return endCharacter_; } set { - isDefinition_ = value; + endCharacter_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { - return Equals(other as Relationship); + return Equals(other as MultiLineRange); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Relationship other) { + public bool Equals(MultiLineRange other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Symbol != other.Symbol) return false; - if (IsReference != other.IsReference) return false; - if (IsImplementation != other.IsImplementation) return false; - if (IsTypeDefinition != other.IsTypeDefinition) return false; - if (IsDefinition != other.IsDefinition) return false; + if (StartLine != other.StartLine) return false; + if (StartCharacter != other.StartCharacter) return false; + if (EndLine != other.EndLine) return false; + if (EndCharacter != other.EndCharacter) return false; return Equals(_unknownFields, other._unknownFields); } @@ -2948,11 +4647,10 @@ public bool Equals(Relationship other) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); - if (IsReference != false) hash ^= IsReference.GetHashCode(); - if (IsImplementation != false) hash ^= IsImplementation.GetHashCode(); - if (IsTypeDefinition != false) hash ^= IsTypeDefinition.GetHashCode(); - if (IsDefinition != false) hash ^= IsDefinition.GetHashCode(); + if (StartLine != 0) hash ^= StartLine.GetHashCode(); + if (StartCharacter != 0) hash ^= StartCharacter.GetHashCode(); + if (EndLine != 0) hash ^= EndLine.GetHashCode(); + if (EndCharacter != 0) hash ^= EndCharacter.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2971,25 +4669,21 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Symbol.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Symbol); + if (StartLine != 0) { + output.WriteRawTag(8); + output.WriteInt32(StartLine); } - if (IsReference != false) { + if (StartCharacter != 0) { output.WriteRawTag(16); - output.WriteBool(IsReference); + output.WriteInt32(StartCharacter); } - if (IsImplementation != false) { + if (EndLine != 0) { output.WriteRawTag(24); - output.WriteBool(IsImplementation); + output.WriteInt32(EndLine); } - if (IsTypeDefinition != false) { + if (EndCharacter != 0) { output.WriteRawTag(32); - output.WriteBool(IsTypeDefinition); - } - if (IsDefinition != false) { - output.WriteRawTag(40); - output.WriteBool(IsDefinition); + output.WriteInt32(EndCharacter); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -3001,25 +4695,21 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Symbol.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Symbol); + if (StartLine != 0) { + output.WriteRawTag(8); + output.WriteInt32(StartLine); } - if (IsReference != false) { + if (StartCharacter != 0) { output.WriteRawTag(16); - output.WriteBool(IsReference); + output.WriteInt32(StartCharacter); } - if (IsImplementation != false) { + if (EndLine != 0) { output.WriteRawTag(24); - output.WriteBool(IsImplementation); + output.WriteInt32(EndLine); } - if (IsTypeDefinition != false) { + if (EndCharacter != 0) { output.WriteRawTag(32); - output.WriteBool(IsTypeDefinition); - } - if (IsDefinition != false) { - output.WriteRawTag(40); - output.WriteBool(IsDefinition); + output.WriteInt32(EndCharacter); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -3031,20 +4721,17 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (Symbol.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); - } - if (IsReference != false) { - size += 1 + 1; + if (StartLine != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(StartLine); } - if (IsImplementation != false) { - size += 1 + 1; + if (StartCharacter != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(StartCharacter); } - if (IsTypeDefinition != false) { - size += 1 + 1; + if (EndLine != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(EndLine); } - if (IsDefinition != false) { - size += 1 + 1; + if (EndCharacter != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(EndCharacter); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -3054,24 +4741,21 @@ public int CalculateSize() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Relationship other) { + public void MergeFrom(MultiLineRange other) { if (other == null) { return; } - if (other.Symbol.Length != 0) { - Symbol = other.Symbol; - } - if (other.IsReference != false) { - IsReference = other.IsReference; + if (other.StartLine != 0) { + StartLine = other.StartLine; } - if (other.IsImplementation != false) { - IsImplementation = other.IsImplementation; + if (other.StartCharacter != 0) { + StartCharacter = other.StartCharacter; } - if (other.IsTypeDefinition != false) { - IsTypeDefinition = other.IsTypeDefinition; + if (other.EndLine != 0) { + EndLine = other.EndLine; } - if (other.IsDefinition != false) { - IsDefinition = other.IsDefinition; + if (other.EndCharacter != 0) { + EndCharacter = other.EndCharacter; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -3084,28 +4768,28 @@ public void MergeFrom(pb::CodedInputStream input) { #else uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - Symbol = input.ReadString(); + case 8: { + StartLine = input.ReadInt32(); break; } case 16: { - IsReference = input.ReadBool(); + StartCharacter = input.ReadInt32(); break; } case 24: { - IsImplementation = input.ReadBool(); + EndLine = input.ReadInt32(); break; } case 32: { - IsTypeDefinition = input.ReadBool(); - break; - } - case 40: { - IsDefinition = input.ReadBool(); + EndCharacter = input.ReadInt32(); break; } } @@ -3119,28 +4803,28 @@ public void MergeFrom(pb::CodedInputStream input) { void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - Symbol = input.ReadString(); + case 8: { + StartLine = input.ReadInt32(); break; } case 16: { - IsReference = input.ReadBool(); + StartCharacter = input.ReadInt32(); break; } case 24: { - IsImplementation = input.ReadBool(); + EndLine = input.ReadInt32(); break; } case 32: { - IsTypeDefinition = input.ReadBool(); - break; - } - case 40: { - IsDefinition = input.ReadBool(); + EndCharacter = input.ReadInt32(); break; } } @@ -3156,7 +4840,23 @@ public void MergeFrom(pb::CodedInputStream input) { /// /// If possible, indexers should try to bundle logically related information /// across occurrences into a single occurrence to reduce payload sizes. + /// + /// Range encoding: + /// + /// An Occurrence carries its source range in one of two ways: the deprecated + /// `range` field (a `repeated int32` packed encoding kept for backward + /// compatibility), or one of the typed alternatives in the `typed_range` + /// oneof. New producers SHOULD set `typed_range` and SHOULD NOT set the + /// deprecated `range` field. The same rule applies to `enclosing_range` and + /// `typed_enclosing_range`. + /// + /// When both encodings are present on the same Occurrence, `typed_range` takes + /// precedence over `range` (likewise `typed_enclosing_range` over + /// `enclosing_range`). Producers that set both forms MUST keep them + /// semantically equivalent. Consumers SHOULD prefer the typed form when + /// available and fall back to the `repeated int32` form otherwise. /// + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Occurrence : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3171,7 +4871,7 @@ public sealed partial class Occurrence : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Scip.ScipReflection.Descriptor.MessageTypes[9]; } + get { return global::Scip.ScipReflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3197,6 +4897,25 @@ public Occurrence(Occurrence other) : this() { overrideDocumentation_ = other.overrideDocumentation_.Clone(); syntaxKind_ = other.syntaxKind_; diagnostics_ = other.diagnostics_.Clone(); + enclosingRange_ = other.enclosingRange_.Clone(); + switch (other.TypedRangeCase) { + case TypedRangeOneofCase.SingleLineRange: + SingleLineRange = other.SingleLineRange.Clone(); + break; + case TypedRangeOneofCase.MultiLineRange: + MultiLineRange = other.MultiLineRange.Clone(); + break; + } + + switch (other.TypedEnclosingRangeCase) { + case TypedEnclosingRangeOneofCase.SingleLineEnclosingRange: + SingleLineEnclosingRange = other.SingleLineEnclosingRange.Clone(); + break; + case TypedEnclosingRangeOneofCase.MultiLineEnclosingRange: + MultiLineEnclosingRange = other.MultiLineEnclosingRange.Clone(); + break; + } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -3212,31 +4931,60 @@ public Occurrence Clone() { = pb::FieldCodec.ForInt32(10); private readonly pbc::RepeatedField range_ = new pbc::RepeatedField(); /// - /// Source position of this occurrence. Must be exactly three or four - /// elements: + /// Deprecated: Use `single_line_range` or `multi_line_range` instead. /// + /// Half-open [start, end) range. Must be exactly three or four elements: + /// - Three elements: `[startLine, startCharacter, endCharacter]` (single-line) /// - Four elements: `[startLine, startCharacter, endLine, endCharacter]` - /// - Three elements: `[startLine, startCharacter, endCharacter]`. The end line - /// is inferred to have the same value as the start line. /// - /// Line numbers and characters are always 0-based. Make sure to increment the - /// line/character values before displaying them in an editor-like UI because - /// editors conventionally use 1-based numbers. + /// The end line of a three-element range is inferred to equal the start line. /// /// Historical note: the original draft of this schema had a `Range` message /// type with `start` and `end` fields of type `Position`, mirroring LSP. /// Benchmarks revealed that this encoding was inefficient and that we could /// reduce the total payload size of an index by 50% by using `repeated int32` - /// instead. The `repeated int32` encoding is admittedly more embarrassing to - /// work with in some programming languages but we hope the performance - /// improvements make up for it. + /// instead. However, the lack of type safety led to the introduction of + /// `single_line_range` and `multi_line_range` as typed alternatives; the + /// typed encoding's per-index size overhead is small (single-digit percent) + /// because ranges are only a fraction of a typical index payload. /// + [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Range { get { return range_; } } + /// Field number for the "single_line_range" field. + public const int SingleLineRangeFieldNumber = 8; + /// + /// Range spanning a single line. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Scip.SingleLineRange SingleLineRange { + get { return typedRangeCase_ == TypedRangeOneofCase.SingleLineRange ? (global::Scip.SingleLineRange) typedRange_ : null; } + set { + typedRange_ = value; + typedRangeCase_ = value == null ? TypedRangeOneofCase.None : TypedRangeOneofCase.SingleLineRange; + } + } + + /// Field number for the "multi_line_range" field. + public const int MultiLineRangeFieldNumber = 9; + /// + /// Range spanning multiple lines. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Scip.MultiLineRange MultiLineRange { + get { return typedRangeCase_ == TypedRangeOneofCase.MultiLineRange ? (global::Scip.MultiLineRange) typedRange_ : null; } + set { + typedRange_ = value; + typedRangeCase_ = value == null ? TypedRangeOneofCase.None : TypedRangeOneofCase.MultiLineRange; + } + } + /// Field number for the "symbol" field. public const int SymbolFieldNumber = 2; private string symbol_ = ""; @@ -3319,6 +5067,95 @@ public int SymbolRoles { get { return diagnostics_; } } + /// Field number for the "enclosing_range" field. + public const int EnclosingRangeFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_enclosingRange_codec + = pb::FieldCodec.ForInt32(58); + private readonly pbc::RepeatedField enclosingRange_ = new pbc::RepeatedField(); + /// + /// Deprecated: Use `typed_enclosing_range` instead. + /// + /// Uses the same `repeated int32` encoding as the deprecated `range` field. + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField EnclosingRange { + get { return enclosingRange_; } + } + + /// Field number for the "single_line_enclosing_range" field. + public const int SingleLineEnclosingRangeFieldNumber = 10; + /// + /// Enclosing range spanning a single line. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Scip.SingleLineRange SingleLineEnclosingRange { + get { return typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.SingleLineEnclosingRange ? (global::Scip.SingleLineRange) typedEnclosingRange_ : null; } + set { + typedEnclosingRange_ = value; + typedEnclosingRangeCase_ = value == null ? TypedEnclosingRangeOneofCase.None : TypedEnclosingRangeOneofCase.SingleLineEnclosingRange; + } + } + + /// Field number for the "multi_line_enclosing_range" field. + public const int MultiLineEnclosingRangeFieldNumber = 11; + /// + /// Enclosing range spanning multiple lines. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Scip.MultiLineRange MultiLineEnclosingRange { + get { return typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.MultiLineEnclosingRange ? (global::Scip.MultiLineRange) typedEnclosingRange_ : null; } + set { + typedEnclosingRange_ = value; + typedEnclosingRangeCase_ = value == null ? TypedEnclosingRangeOneofCase.None : TypedEnclosingRangeOneofCase.MultiLineEnclosingRange; + } + } + + private object typedRange_; + /// Enum of possible cases for the "typed_range" oneof. + public enum TypedRangeOneofCase { + None = 0, + SingleLineRange = 8, + MultiLineRange = 9, + } + private TypedRangeOneofCase typedRangeCase_ = TypedRangeOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TypedRangeOneofCase TypedRangeCase { + get { return typedRangeCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTypedRange() { + typedRangeCase_ = TypedRangeOneofCase.None; + typedRange_ = null; + } + + private object typedEnclosingRange_; + /// Enum of possible cases for the "typed_enclosing_range" oneof. + public enum TypedEnclosingRangeOneofCase { + None = 0, + SingleLineEnclosingRange = 10, + MultiLineEnclosingRange = 11, + } + private TypedEnclosingRangeOneofCase typedEnclosingRangeCase_ = TypedEnclosingRangeOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TypedEnclosingRangeOneofCase TypedEnclosingRangeCase { + get { return typedEnclosingRangeCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTypedEnclosingRange() { + typedEnclosingRangeCase_ = TypedEnclosingRangeOneofCase.None; + typedEnclosingRange_ = null; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { @@ -3335,11 +5172,18 @@ public bool Equals(Occurrence other) { return true; } if(!range_.Equals(other.range_)) return false; + if (!object.Equals(SingleLineRange, other.SingleLineRange)) return false; + if (!object.Equals(MultiLineRange, other.MultiLineRange)) return false; if (Symbol != other.Symbol) return false; if (SymbolRoles != other.SymbolRoles) return false; if(!overrideDocumentation_.Equals(other.overrideDocumentation_)) return false; if (SyntaxKind != other.SyntaxKind) return false; if(!diagnostics_.Equals(other.diagnostics_)) return false; + if(!enclosingRange_.Equals(other.enclosingRange_)) return false; + if (!object.Equals(SingleLineEnclosingRange, other.SingleLineEnclosingRange)) return false; + if (!object.Equals(MultiLineEnclosingRange, other.MultiLineEnclosingRange)) return false; + if (TypedRangeCase != other.TypedRangeCase) return false; + if (TypedEnclosingRangeCase != other.TypedEnclosingRangeCase) return false; return Equals(_unknownFields, other._unknownFields); } @@ -3348,11 +5192,18 @@ public bool Equals(Occurrence other) { public override int GetHashCode() { int hash = 1; hash ^= range_.GetHashCode(); + if (typedRangeCase_ == TypedRangeOneofCase.SingleLineRange) hash ^= SingleLineRange.GetHashCode(); + if (typedRangeCase_ == TypedRangeOneofCase.MultiLineRange) hash ^= MultiLineRange.GetHashCode(); if (Symbol.Length != 0) hash ^= Symbol.GetHashCode(); if (SymbolRoles != 0) hash ^= SymbolRoles.GetHashCode(); hash ^= overrideDocumentation_.GetHashCode(); if (SyntaxKind != global::Scip.SyntaxKind.UnspecifiedSyntaxKind) hash ^= SyntaxKind.GetHashCode(); hash ^= diagnostics_.GetHashCode(); + hash ^= enclosingRange_.GetHashCode(); + if (typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.SingleLineEnclosingRange) hash ^= SingleLineEnclosingRange.GetHashCode(); + if (typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.MultiLineEnclosingRange) hash ^= MultiLineEnclosingRange.GetHashCode(); + hash ^= (int) typedRangeCase_; + hash ^= (int) typedEnclosingRangeCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -3386,6 +5237,23 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteEnum((int) SyntaxKind); } diagnostics_.WriteTo(output, _repeated_diagnostics_codec); + enclosingRange_.WriteTo(output, _repeated_enclosingRange_codec); + if (typedRangeCase_ == TypedRangeOneofCase.SingleLineRange) { + output.WriteRawTag(66); + output.WriteMessage(SingleLineRange); + } + if (typedRangeCase_ == TypedRangeOneofCase.MultiLineRange) { + output.WriteRawTag(74); + output.WriteMessage(MultiLineRange); + } + if (typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.SingleLineEnclosingRange) { + output.WriteRawTag(82); + output.WriteMessage(SingleLineEnclosingRange); + } + if (typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.MultiLineEnclosingRange) { + output.WriteRawTag(90); + output.WriteMessage(MultiLineEnclosingRange); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -3411,6 +5279,23 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteEnum((int) SyntaxKind); } diagnostics_.WriteTo(ref output, _repeated_diagnostics_codec); + enclosingRange_.WriteTo(ref output, _repeated_enclosingRange_codec); + if (typedRangeCase_ == TypedRangeOneofCase.SingleLineRange) { + output.WriteRawTag(66); + output.WriteMessage(SingleLineRange); + } + if (typedRangeCase_ == TypedRangeOneofCase.MultiLineRange) { + output.WriteRawTag(74); + output.WriteMessage(MultiLineRange); + } + if (typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.SingleLineEnclosingRange) { + output.WriteRawTag(82); + output.WriteMessage(SingleLineEnclosingRange); + } + if (typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.MultiLineEnclosingRange) { + output.WriteRawTag(90); + output.WriteMessage(MultiLineEnclosingRange); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -3422,6 +5307,12 @@ public void WriteTo(pb::CodedOutputStream output) { public int CalculateSize() { int size = 0; size += range_.CalculateSize(_repeated_range_codec); + if (typedRangeCase_ == TypedRangeOneofCase.SingleLineRange) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SingleLineRange); + } + if (typedRangeCase_ == TypedRangeOneofCase.MultiLineRange) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MultiLineRange); + } if (Symbol.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Symbol); } @@ -3433,6 +5324,13 @@ public int CalculateSize() { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) SyntaxKind); } size += diagnostics_.CalculateSize(_repeated_diagnostics_codec); + size += enclosingRange_.CalculateSize(_repeated_enclosingRange_codec); + if (typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.SingleLineEnclosingRange) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SingleLineEnclosingRange); + } + if (typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.MultiLineEnclosingRange) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MultiLineEnclosingRange); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -3457,6 +5355,37 @@ public void MergeFrom(Occurrence other) { SyntaxKind = other.SyntaxKind; } diagnostics_.Add(other.diagnostics_); + enclosingRange_.Add(other.enclosingRange_); + switch (other.TypedRangeCase) { + case TypedRangeOneofCase.SingleLineRange: + if (SingleLineRange == null) { + SingleLineRange = new global::Scip.SingleLineRange(); + } + SingleLineRange.MergeFrom(other.SingleLineRange); + break; + case TypedRangeOneofCase.MultiLineRange: + if (MultiLineRange == null) { + MultiLineRange = new global::Scip.MultiLineRange(); + } + MultiLineRange.MergeFrom(other.MultiLineRange); + break; + } + + switch (other.TypedEnclosingRangeCase) { + case TypedEnclosingRangeOneofCase.SingleLineEnclosingRange: + if (SingleLineEnclosingRange == null) { + SingleLineEnclosingRange = new global::Scip.SingleLineRange(); + } + SingleLineEnclosingRange.MergeFrom(other.SingleLineEnclosingRange); + break; + case TypedEnclosingRangeOneofCase.MultiLineEnclosingRange: + if (MultiLineEnclosingRange == null) { + MultiLineEnclosingRange = new global::Scip.MultiLineRange(); + } + MultiLineEnclosingRange.MergeFrom(other.MultiLineEnclosingRange); + break; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -3468,7 +5397,11 @@ public void MergeFrom(pb::CodedInputStream input) { #else uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; @@ -3497,6 +5430,47 @@ public void MergeFrom(pb::CodedInputStream input) { diagnostics_.AddEntriesFrom(input, _repeated_diagnostics_codec); break; } + case 58: + case 56: { + enclosingRange_.AddEntriesFrom(input, _repeated_enclosingRange_codec); + break; + } + case 66: { + global::Scip.SingleLineRange subBuilder = new global::Scip.SingleLineRange(); + if (typedRangeCase_ == TypedRangeOneofCase.SingleLineRange) { + subBuilder.MergeFrom(SingleLineRange); + } + input.ReadMessage(subBuilder); + SingleLineRange = subBuilder; + break; + } + case 74: { + global::Scip.MultiLineRange subBuilder = new global::Scip.MultiLineRange(); + if (typedRangeCase_ == TypedRangeOneofCase.MultiLineRange) { + subBuilder.MergeFrom(MultiLineRange); + } + input.ReadMessage(subBuilder); + MultiLineRange = subBuilder; + break; + } + case 82: { + global::Scip.SingleLineRange subBuilder = new global::Scip.SingleLineRange(); + if (typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.SingleLineEnclosingRange) { + subBuilder.MergeFrom(SingleLineEnclosingRange); + } + input.ReadMessage(subBuilder); + SingleLineEnclosingRange = subBuilder; + break; + } + case 90: { + global::Scip.MultiLineRange subBuilder = new global::Scip.MultiLineRange(); + if (typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.MultiLineEnclosingRange) { + subBuilder.MergeFrom(MultiLineEnclosingRange); + } + input.ReadMessage(subBuilder); + MultiLineEnclosingRange = subBuilder; + break; + } } } #endif @@ -3508,7 +5482,11 @@ public void MergeFrom(pb::CodedInputStream input) { void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; @@ -3537,6 +5515,47 @@ public void MergeFrom(pb::CodedInputStream input) { diagnostics_.AddEntriesFrom(ref input, _repeated_diagnostics_codec); break; } + case 58: + case 56: { + enclosingRange_.AddEntriesFrom(ref input, _repeated_enclosingRange_codec); + break; + } + case 66: { + global::Scip.SingleLineRange subBuilder = new global::Scip.SingleLineRange(); + if (typedRangeCase_ == TypedRangeOneofCase.SingleLineRange) { + subBuilder.MergeFrom(SingleLineRange); + } + input.ReadMessage(subBuilder); + SingleLineRange = subBuilder; + break; + } + case 74: { + global::Scip.MultiLineRange subBuilder = new global::Scip.MultiLineRange(); + if (typedRangeCase_ == TypedRangeOneofCase.MultiLineRange) { + subBuilder.MergeFrom(MultiLineRange); + } + input.ReadMessage(subBuilder); + MultiLineRange = subBuilder; + break; + } + case 82: { + global::Scip.SingleLineRange subBuilder = new global::Scip.SingleLineRange(); + if (typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.SingleLineEnclosingRange) { + subBuilder.MergeFrom(SingleLineEnclosingRange); + } + input.ReadMessage(subBuilder); + SingleLineEnclosingRange = subBuilder; + break; + } + case 90: { + global::Scip.MultiLineRange subBuilder = new global::Scip.MultiLineRange(); + if (typedEnclosingRangeCase_ == TypedEnclosingRangeOneofCase.MultiLineEnclosingRange) { + subBuilder.MergeFrom(MultiLineEnclosingRange); + } + input.ReadMessage(subBuilder); + MultiLineEnclosingRange = subBuilder; + break; + } } } } @@ -3548,6 +5567,7 @@ public void MergeFrom(pb::CodedInputStream input) { /// Represents a diagnostic, such as a compiler error or warning, which should be /// reported for a document. /// + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Diagnostic : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3562,7 +5582,7 @@ public sealed partial class Diagnostic : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Scip.ScipReflection.Descriptor.MessageTypes[10]; } + get { return global::Scip.ScipReflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3821,7 +5841,11 @@ public void MergeFrom(pb::CodedInputStream input) { #else uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; @@ -3857,7 +5881,11 @@ public void MergeFrom(pb::CodedInputStream input) { void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; diff --git a/ScipDotnet/ScipDocumentIndexer.cs b/ScipDotnet/ScipDocumentIndexer.cs index 57a6e6d..f9a6e0f 100644 --- a/ScipDotnet/ScipDocumentIndexer.cs +++ b/ScipDotnet/ScipDocumentIndexer.cs @@ -2,6 +2,7 @@ using Microsoft.Extensions.Logging; using Scip; using Document = Scip.Document; +using Kind = Scip.SymbolInformation.Types.Kind; namespace ScipDotnet; @@ -175,6 +176,29 @@ private SymbolDescriptor.Types.Suffix SymbolSuffix(ISymbol sym) } } + // SymbolInformation.Kind from the Roslyn symbol; anything not listed stays UnspecifiedKind. + private static Kind ScipKind(ISymbol sym) => sym switch + { + INamedTypeSymbol { TypeKind: TypeKind.Class } => Kind.Class, + INamedTypeSymbol { TypeKind: TypeKind.Interface } => Kind.Interface, + INamedTypeSymbol { TypeKind: TypeKind.Struct } => Kind.Struct, + INamedTypeSymbol { TypeKind: TypeKind.Enum } => Kind.Enum, + INamedTypeSymbol { TypeKind: TypeKind.Delegate } => Kind.Delegate, + INamedTypeSymbol { TypeKind: TypeKind.Module } => Kind.Module, + IMethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor } => Kind.Constructor, + IMethodSymbol { MethodKind: MethodKind.Ordinary, IsStatic: true } => Kind.StaticMethod, + IMethodSymbol { MethodKind: MethodKind.Ordinary } => Kind.Method, + IPropertySymbol { IsIndexer: false, IsStatic: true } => Kind.StaticProperty, + IPropertySymbol { IsIndexer: false } => Kind.Property, + IFieldSymbol { ContainingType.TypeKind: TypeKind.Enum } => Kind.EnumMember, + IFieldSymbol { IsConst: true } => Kind.Constant, + IFieldSymbol { IsStatic: true } => Kind.StaticField, + IFieldSymbol => Kind.Field, + IEventSymbol { IsStatic: true } => Kind.StaticEvent, + IEventSymbol => Kind.Event, + _ => Kind.UnspecifiedKind, + }; + private static string MethodDisambiguator(ISymbol sym) { if (sym is not IMethodSymbol) @@ -241,7 +265,7 @@ public void VisitOccurrence(ISymbol? symbol, Location location, bool isDefinitio if (!isDefinition) return; // Emit SymbolInformation for this definition occurrence. - var info = new SymbolInformation { Symbol = scipSymbol }; + var info = new SymbolInformation { Symbol = scipSymbol, Kind = ScipKind(symbol) }; _doc.Symbols.Add(info); var symbolSignature = symbol.ToDisplayString(_format); diff --git a/ScipDotnet/ScipDotnet.csproj b/ScipDotnet/ScipDotnet.csproj index 020461f..1845401 100644 --- a/ScipDotnet/ScipDotnet.csproj +++ b/ScipDotnet/ScipDotnet.csproj @@ -17,7 +17,7 @@ - + diff --git a/ScipDotnet/ScipProjectIndexer.cs b/ScipDotnet/ScipProjectIndexer.cs index 1f1debf..b3823ac 100644 --- a/ScipDotnet/ScipProjectIndexer.cs +++ b/ScipDotnet/ScipProjectIndexer.cs @@ -131,6 +131,7 @@ await host.Services.GetRequiredService() Scip.Document doc = new() { Language = language, + PositionEncoding = Scip.PositionEncoding.Utf16CodeUnitOffsetFromLineStart, RelativePath = document.FilePath == null ? null : Path.GetRelativePath(options.WorkingDirectory.FullName, document.FilePath) diff --git a/scip.proto b/scip.proto index 8e5486a..9ae8c96 100644 --- a/scip.proto +++ b/scip.proto @@ -12,7 +12,10 @@ syntax = "proto3"; package scip; -option go_package = "github.com/sourcegraph/scip/bindings/go/scip/"; +option go_package = "github.com/scip-code/scip/bindings/go/scip/"; +option java_multiple_files = true; +option java_outer_classname = "ScipProto"; +option java_package = "org.scip_code.scip"; // Index represents a complete SCIP index for a workspace this is rooted at a // single directory. An Index message payload can have a large memory footprint @@ -31,6 +34,8 @@ message Index { // external package won't get indexed for some reason then you can use this // field to provide hover documentation for those external symbols. repeated SymbolInformation external_symbols = 3; + // IMPORTANT: When adding a new field to `Index` here, add a matching + // function in `IndexVisitor` and update `ParseStreaming`. } message Metadata { @@ -43,7 +48,8 @@ message Metadata { // directory. string project_root = 3; // Text encoding of the source files on disk that are referenced from - // `Document.relative_path`. + // `Document.relative_path`. This value is unrelated to the `Document.text` + // field, which is a Protobuf string and hence must be UTF-8 encoded. TextEncoding text_document_encoding = 4; } @@ -70,7 +76,7 @@ message ToolInfo { message Document { // The string ID for the programming language this file is written in. // The `Language` enum contains the names of most common programming languages. - // This field is typed as a string to permit any programming langauge, including + // This field is typed as a string to permit any programming language, including // ones that are not specified by the `Language` enum. string language = 4; // (Required) Unique path to the text document. @@ -91,8 +97,53 @@ message Document { // but have a reference and are defined by some other symbol (see // Relationship.is_definition). repeated SymbolInformation symbols = 3; + + // (optional) Text contents of this document. Indexers are not expected to + // include the text by default. It's preferable that clients read the text + // contents from the file system by resolving the absolute path from joining + // `Index.metadata.project_root` and `Document.relative_path`. This field + // can be useful for testing or when working with virtual/in-memory documents. + string text = 5; + + // Specifies the encoding used for source ranges in this Document. + // + // Usually, this will match the type used to index the string type + // in the indexer's implementation language in O(1) time. + // - For an indexer implemented in JVM/.NET language or JavaScript/TypeScript, + // use UTF16CodeUnitOffsetFromLineStart. + // - For an indexer implemented in Python, + // use UTF32CodeUnitOffsetFromLineStart. + // - For an indexer implemented in Go, Rust or C++, + // use UTF8ByteOffsetFromLineStart. + PositionEncoding position_encoding = 6; } +// Encoding used to interpret the 'character' value in source ranges. +enum PositionEncoding { + // Default value. This value should not be used by new SCIP indexers + // so that a consumer can process the SCIP index without ambiguity. + UnspecifiedPositionEncoding = 0; + // The 'character' value is interpreted as an offset in terms + // of UTF-8 code units (i.e. bytes). + // + // Example: For the string "🚀 Woo" in UTF-8, the bytes are + // [240, 159, 154, 128, 32, 87, 111, 111], so the offset for 'W' + // would be 5. + UTF8CodeUnitOffsetFromLineStart = 1; + // The 'character' value is interpreted as an offset in terms + // of UTF-16 code units (each is 2 bytes). + // + // Example: For the string "🚀 Woo", the UTF-16 code units are + // ['\ud83d', '\ude80', ' ', 'W', 'o', 'o'], so the offset for 'W' + // would be 3. + UTF16CodeUnitOffsetFromLineStart = 2; + // The 'character' value is interpreted as an offset in terms + // of UTF-32 code units (each is 4 bytes). + // + // Example: For the string "🚀 Woo", the UTF-32 code units are + // ['🚀', ' ', 'W', 'o', 'o'], so the offset for 'W' would be 2. + UTF32CodeUnitOffsetFromLineStart = 3; +} // Symbol is similar to a URI, it identifies a class, method, or a local // variable. `SymbolInformation` contains rich metadata about symbols such as @@ -102,18 +153,20 @@ message Document { // interchangeably with `Symbol`. The syntax for Symbol is the following: // ``` // # ()+ stands for one or more repetitions of +// # ()? stands for zero or one occurrence of // ::= ' ' ' ' ()+ | 'local ' // ::= ' ' ' ' -// ::= any UTF-8, escape spaces with double space. -// ::= same as above, use the placeholder '.' to indicate an empty value +// ::= any UTF-8, escape spaces with double space. Must not be empty nor start with 'local' +// ::= any UTF-8, escape spaces with double space. Use the placeholder '.' to indicate an empty value // ::= same as above // ::= same as above -// ::= | | | | | | +// ::= | | | | | | | // ::= '/' // ::= '#' // ::= '.' // ::= ':' -// ::= '(' ').' +// ::= '!' +// ::= '(' ()? ').' // ::= '[' ']' // ::= '(' ')' // ::= @@ -121,8 +174,9 @@ message Document { // ::= | // ::= ()+ // ::= '_' | '+' | '-' | '$' | ASCII letter or digit -// ::= '`' ()+ '`' -// ::= any UTF-8 character, escape backticks with double backtick. +// ::= '`' ()+ '`', must contain at least one non- +// ::= any UTF-8, escape backticks with double backtick. +// ::= // ``` // // The list of descriptors for a symbol should together form a fully @@ -130,10 +184,13 @@ message Document { // identifier across the package. Typically, it will include one descriptor // for every node in the AST (along the ancestry path) between the root of // the file and the node corresponding to the symbol. +// +// Local symbols MUST only be used for entities which are local to a Document, +// and cannot be accessed from outside the Document. message Symbol { string scheme = 1; Package package = 2; - repeated SymbolDescriptor descriptors = 3; + repeated Descriptor descriptors = 3; } // Unit of packaging and distribution. @@ -145,7 +202,7 @@ message Package { string version = 3; } -message SymbolDescriptor { +message Descriptor { enum Suffix { option allow_alias = true; UnspecifiedSuffix = 0; @@ -154,20 +211,41 @@ message SymbolDescriptor { // NOTE: This corresponds to a package in Go and JVM languages. Namespace = 1; // Use Namespace instead. - Package = 1 [deprecated=true]; + Package = 1 [deprecated = true]; Type = 2; Term = 3; Method = 4; TypeParameter = 5; Parameter = 6; - Macro = 9; // Can be used for any purpose. Meta = 7; Local = 8; + Macro = 9; } string name = 1; string disambiguator = 2; Suffix suffix = 3; + // NOTE: If you add new fields here, make sure to update the prepareSlot() + // function responsible for parsing symbols. +} + +// Signature represents the signature of a symbol as it's displayed in API +// documentation or hover tooltips. It uses a subset of Document's fields with +// the same field numbers for wire compatibility with older indexes that encoded +// signatures using the Document message type. +message Signature { + // The language of the signature, e.g. "java", "go", "python". + string language = 4; + // The text content of the signature, e.g. "void add(int a, int b)". + string text = 5; + // (optional) Occurrences within the signature text that reference other + // symbols, enabling hyperlinking of types in the signature. Ranges are + // relative to the `text` field. + repeated Occurrence occurrences = 2; + + // Reserved field numbers from the Document message to prevent accidental + // reuse, which would break wire compatibility with older indexes. + reserved 1, 3, 6; } // SymbolInformation defines metadata about a symbol, such as the symbol's @@ -177,12 +255,211 @@ message SymbolInformation { // The string must be formatted according to the grammar in `Symbol`. string symbol = 1; // (optional, but strongly recommended) The markdown-formatted documentation - // for this symbol. This field is repeated to allow different kinds of - // documentation. For example, it's nice to include both the signature of a - // method (parameters and return type) along with the accompanying docstring. + // for this symbol. Use `SymbolInformation.signature_documentation` to + // document the method/class/type signature of this symbol. + // Due to historical reasons, indexers may include signature documentation in + // this field by rendering markdown code blocks. New indexers should only + // include non-code documentation in this field, for example docstrings. repeated string documentation = 3; // (optional) Relationships to other symbols (e.g., implements, type definition). repeated Relationship relationships = 4; + // The kind of this symbol. Use this field instead of + // `SymbolDescriptor.Suffix` to determine whether something is, for example, a + // class or a method. + Kind kind = 5; + // (optional) Kind represents the fine-grained category of a symbol, suitable for presenting + // information about the symbol's meaning in the language. + // + // For example: + // - A Java method would have the kind `Method` while a Go function would + // have the kind `Function`, even if the symbols for these use the same + // syntax for the descriptor `SymbolDescriptor.Suffix.Method`. + // - A Go struct has the symbol kind `Struct` while a Java class has + // the symbol kind `Class` even if they both have the same descriptor: + // `SymbolDescriptor.Suffix.Type`. + // + // Since Kind is more fine-grained than Suffix: + // - If two symbols have the same Kind, they should share the same Suffix. + // - If two symbols have different Suffixes, they should have different Kinds. + enum Kind { + UnspecifiedKind = 0; + // A method which may or may not have a body. For Java, Kotlin etc. + AbstractMethod = 66; + // For Ruby's attr_accessor + Accessor = 72; + Array = 1; + // For Alloy + Assertion = 2; + AssociatedType = 3; + // For C++ + Attribute = 4; + // For Lean + Axiom = 5; + Boolean = 6; + Class = 7; + // For C++ + Concept = 86; + Constant = 8; + Constructor = 9; + // For Solidity + Contract = 62; + // For Haskell + DataFamily = 10; + // For C# and F# + Delegate = 73; + Enum = 11; + EnumMember = 12; + Error = 63; + Event = 13; + // For Dart + Extension = 84; + // For Alloy + Fact = 14; + Field = 15; + File = 16; + Function = 17; + // For 'get' in Swift, 'attr_reader' in Ruby + Getter = 18; + // For Raku + Grammar = 19; + // For Purescript and Lean + Instance = 20; + Interface = 21; + Key = 22; + // For Racket + Lang = 23; + // For Lean + Lemma = 24; + // For solidity + Library = 64; + Macro = 25; + Method = 26; + // For Ruby + MethodAlias = 74; + // Analogous to 'ThisParameter' and 'SelfParameter', but for languages + // like Go where the receiver doesn't have a conventional name. + MethodReceiver = 27; + // Analogous to 'AbstractMethod', for Go. + MethodSpecification = 67; + // For Protobuf + Message = 28; + // For Dart + Mixin = 85; + // For Solidity + Modifier = 65; + Module = 29; + Namespace = 30; + Null = 31; + Number = 32; + Object = 33; + Operator = 34; + Package = 35; + PackageObject = 36; + Parameter = 37; + ParameterLabel = 38; + // For Haskell's PatternSynonyms + Pattern = 39; + // For Alloy + Predicate = 40; + Property = 41; + // Analogous to 'Trait' and 'TypeClass', for Swift and Objective-C + Protocol = 42; + // Analogous to 'AbstractMethod', for Swift and Objective-C. + ProtocolMethod = 68; + // Analogous to 'AbstractMethod', for C++. + PureVirtualMethod = 69; + // For Haskell + Quasiquoter = 43; + // 'self' in Python, Rust, Swift etc. + SelfParameter = 44; + // For 'set' in Swift, 'attr_writer' in Ruby + Setter = 45; + // For Alloy, analogous to 'Struct'. + Signature = 46; + // For Ruby + SingletonClass = 75; + // Analogous to 'StaticMethod', for Ruby. + SingletonMethod = 76; + // Analogous to 'StaticField', for C++ + StaticDataMember = 77; + // For C# + StaticEvent = 78; + // For C# + StaticField = 79; + // For Java, C#, C++ etc. + StaticMethod = 80; + // For C#, TypeScript etc. + StaticProperty = 81; + // For C, C++ + StaticVariable = 82; + String = 48; + Struct = 49; + // For Swift + Subscript = 47; + // For Lean + Tactic = 50; + // For Lean + Theorem = 51; + // Method receiver for languages + // 'this' in JavaScript, C++, Java etc. + ThisParameter = 52; + // Analogous to 'Protocol' and 'TypeClass', for Rust, Scala etc. + Trait = 53; + // Analogous to 'AbstractMethod', for Rust, Scala etc. + TraitMethod = 70; + // Data type definition for languages like OCaml which use `type` + // rather than separate keywords like `struct` and `enum`. + Type = 54; + TypeAlias = 55; + // Analogous to 'Trait' and 'Protocol', for Haskell, Purescript etc. + TypeClass = 56; + // Analogous to 'AbstractMethod', for Haskell, Purescript etc. + TypeClassMethod = 71; + // For Haskell + TypeFamily = 57; + TypeParameter = 58; + // For C, C++, Capn Proto + Union = 59; + Value = 60; + Variable = 61; + // Next = 87; + // Feel free to open a PR proposing new language-specific kinds. + } + // (optional) The name of this symbol as it should be displayed to the user. + // For example, the symbol "com/example/MyClass#myMethod(+1)." should have the + // display name "myMethod". The `symbol` field is not a reliable source of + // the display name for several reasons: + // + // - Local symbols don't encode the name. + // - Some languages have case-insensitive names, so the symbol is all-lowercase. + // - The symbol may encode names with special characters that should not be + // displayed to the user. + string display_name = 6; + // (optional) The signature of this symbol as it's displayed in API + // documentation or in hover tooltips. For example, a Java method that adds + // two numbers would have `Signature.language = "java"` and + // `Signature.text = "void add(int a, int b)"`. The `language` and `text` + // fields are required while `occurrences` can be optionally included to + // support hyperlinking referenced symbols in the signature. + Signature signature_documentation = 7; + // (optional) The enclosing symbol if this is a local symbol. For non-local + // symbols, the enclosing symbol should be parsed from the `symbol` field + // using the `Descriptor` grammar. + // + // The primary use-case for this field is to allow local symbol to be displayed + // in a symbol hierarchy for API documentation. It's OK to leave this field + // empty for local variables since local variables usually don't belong in API + // documentation. However, in the situation that you wish to include a local + // symbol in the hierarchy, then you can use `enclosing_symbol` to locate the + // "parent" or "owner" of this local symbol. For example, a Java indexer may + // choose to use local symbols for private class fields while providing an + // `enclosing_symbol` to reference the enclosing class to allow the field to + // be part of the class documentation hierarchy. From the perspective of an + // author of an indexer, the decision to use a local symbol or global symbol + // should exclusively be determined whether the local symbol is accessible + // outside the document, not by the capability to find the enclosing + // symbol. + string enclosing_symbol = 8; } message Relationship { @@ -198,9 +475,9 @@ message Relationship { // ^^^^^ definition Animal#sound() // } // class Dog implements Animal { - // ^^^ definition Dog#, implementation_symbols = Animal# + // ^^^ definition Dog#, relationships = [{symbol: "Animal#", is_implementation: true}] // public sound(): string { return "woof" } - // ^^^^^ definition Dog#sound(), references_symbols = Animal#sound(), implementation_symbols = Animal#sound() + // ^^^^^ definition Dog#sound(), references_symbols = Animal#sound(), relationships = [{symbol: "Animal#sound()", is_implementation:true, is_reference: true}] // } // const animal: Animal = new Dog() // ^^^^^^ reference Animal# @@ -212,14 +489,14 @@ message Relationship { // references" on the `Dog#sound()` method should include references to the // `Animal#sound()` method as well. bool is_reference = 2; - // Similar to `references_symbols` but for "Go to implementation". - // It's common for the `implementation_symbols` and `references_symbols` fields - // have the same values but that's not always the case. - // In the TypeScript example above, observe that `implementation_symbols` has - // the value `"Animal#"` for the "Dog#" symbol while `references_symbols` is - // empty. When requesting "Find references" on the "Animal#" symbol we don't - // want to include references to "Dog#" even if "Go to implementation" on the - // "Animal#" symbol should navigate to the "Dog#" symbol. + // Similar to `is_reference` but for "Find implementations". + // It's common for `is_implementation` and `is_reference` to both be true but + // it's not always the case. + // In the TypeScript example above, observe that `Dog#` has an + // `is_implementation` relationship with `"Animal#"` but not `is_reference`. + // This is because "Find references" on the "Animal#" symbol should not return + // "Dog#". We only want "Dog#" to return as a result for "Find + // implementations" on the "Animal#" symbol. bool is_implementation = 3; // Similar to `references_symbols` but for "Go to type definition". bool is_type_definition = 4; @@ -235,15 +512,11 @@ message Relationship { // of mixins, you can use is_definition to relate the symbol to the // matching symbol in ancestor classes, and is_reference to relate the // symbol to the matching symbol in mixins. - // - // NOTE: At the moment, due to limitations of the SCIP to LSIF conversion, - // only global symbols in an index are allowed to use is_definition. - // The relationship may not get recorded if either symbol is local. bool is_definition = 5; // Update registerInverseRelationships on adding a new field here. } -// SymbolRole declares what "role" a symbol has in an occurrence. A role is +// SymbolRole declares what "role" a symbol has in an occurrence. A role is // encoded as a bitset where each bit represents a different role. For example, // to determine if the `Import` role is set, test whether the second bit of the // enum value is defined. In pseudocode, this can be implemented with the @@ -264,6 +537,12 @@ enum SymbolRole { Generated = 0x10; // Is the symbol in test code? Test = 0x20; + // Is this a signature for a symbol that is defined elsewhere? + // + // Applies to forward declarations for languages like C, C++ + // and Objective-C, as well as `val` declarations in interface + // files in languages like SML and OCaml. + ForwardDefinition = 0x40; } enum SyntaxKind { @@ -281,7 +560,7 @@ enum SyntaxKind { // `if`, `else`, `return`, `class`, etc. Keyword = 4; - IdentifierKeyword = 4 [deprecated=true]; + IdentifierKeyword = 4 [deprecated = true]; // `+`, `*`, etc. IdentifierOperator = 5; @@ -307,7 +586,7 @@ enum SyntaxKind { // NOTE: This corresponds to a package in Go and JVM languages, // and a module in languages like Python and JavaScript. IdentifierNamespace = 14; - IdentifierModule = 14 [deprecated=true]; + IdentifierModule = 14 [deprecated = true]; // Function references, including calls IdentifierFunction = 15; @@ -361,31 +640,86 @@ enum SyntaxKind { TagDelimiter = 36; } +// SingleLineRange represents a half-open [start, end) range within a single line. +// +// Line numbers and characters are always 0-based. Make sure to increment them +// before displaying in an editor-like UI because editors conventionally use +// 1-based numbers. The `character` values are interpreted based on the +// `PositionEncoding` for the enclosing Document. +message SingleLineRange { + int32 line = 1; + int32 start_character = 2; + int32 end_character = 3; +} + +// MultiLineRange represents a half-open [start, end) range spanning multiple lines. +// +// Line numbers and characters are always 0-based. Make sure to increment them +// before displaying in an editor-like UI because editors conventionally use +// 1-based numbers. The `character` values are interpreted based on the +// `PositionEncoding` for the enclosing Document. +// +// Producers SHOULD use `SingleLineRange` when `start_line == end_line` to keep +// indexes compact, but consumers MUST accept multi-line encoding even when the +// range happens to fit on a single line. +message MultiLineRange { + int32 start_line = 1; + int32 start_character = 2; + int32 end_line = 3; + int32 end_character = 4; +} + // Occurrence associates a source position with a symbol and/or highlighting // information. // // If possible, indexers should try to bundle logically related information // across occurrences into a single occurrence to reduce payload sizes. +// +// Range encoding: +// +// An Occurrence carries its source range in one of two ways: the deprecated +// `range` field (a `repeated int32` packed encoding kept for backward +// compatibility), or one of the typed alternatives in the `typed_range` +// oneof. New producers SHOULD set `typed_range` and SHOULD NOT set the +// deprecated `range` field. The same rule applies to `enclosing_range` and +// `typed_enclosing_range`. +// +// When both encodings are present on the same Occurrence, `typed_range` takes +// precedence over `range` (likewise `typed_enclosing_range` over +// `enclosing_range`). Producers that set both forms MUST keep them +// semantically equivalent. Consumers SHOULD prefer the typed form when +// available and fall back to the `repeated int32` form otherwise. message Occurrence { - // Source position of this occurrence. Must be exactly three or four - // elements: + // Deprecated: Use `single_line_range` or `multi_line_range` instead. // + // Half-open [start, end) range. Must be exactly three or four elements: + // - Three elements: `[startLine, startCharacter, endCharacter]` (single-line) // - Four elements: `[startLine, startCharacter, endLine, endCharacter]` - // - Three elements: `[startLine, startCharacter, endCharacter]`. The end line - // is inferred to have the same value as the start line. // - // Line numbers and characters are always 0-based. Make sure to increment the - // line/character values before displaying them in an editor-like UI because - // editors conventionally use 1-based numbers. + // The end line of a three-element range is inferred to equal the start line. // // Historical note: the original draft of this schema had a `Range` message // type with `start` and `end` fields of type `Position`, mirroring LSP. // Benchmarks revealed that this encoding was inefficient and that we could // reduce the total payload size of an index by 50% by using `repeated int32` - // instead. The `repeated int32` encoding is admittedly more embarrassing to - // work with in some programming languages but we hope the performance - // improvements make up for it. - repeated int32 range = 1; + // instead. However, the lack of type safety led to the introduction of + // `single_line_range` and `multi_line_range` as typed alternatives; the + // typed encoding's per-index size overhead is small (single-digit percent) + // because ranges are only a fraction of a typical index payload. + repeated int32 range = 1 [deprecated = true]; + + // Half-open [start, end) source range of this occurrence. + // + // It is allowed for the range to be empty (i.e. start==end). + // + // When both `typed_range` and the deprecated `range` field are set, + // `typed_range` takes precedence. + oneof typed_range { + // Range spanning a single line. + SingleLineRange single_line_range = 8; + // Range spanning multiple lines. + MultiLineRange multi_line_range = 9; + } // (optional) The symbol that appears at this position. See // `SymbolInformation.symbol` for how to format symbols as strings. string symbol = 2; @@ -405,6 +739,70 @@ message Occurrence { SyntaxKind syntax_kind = 5; // (optional) Diagnostics that have been reported for this specific range. repeated Diagnostic diagnostics = 6; + // Deprecated: Use `typed_enclosing_range` instead. + // + // Uses the same `repeated int32` encoding as the deprecated `range` field. + repeated int32 enclosing_range = 7 [deprecated = true]; + + // (optional) Half-open source range of the nearest non-trivial enclosing AST + // node. This range must enclose the occurrence range. Example applications: + // + // - Call hierarchies: to determine what symbols are referenced from the body + // of a function + // - Symbol outline: to display breadcrumbs from the cursor position to the + // root of the file + // - Expand selection: to select the nearest enclosing AST node. + // - Highlight range: to indicate the AST expression that is associated with a + // hover popover + // + // For definition occurrences, the enclosing range should indicate the + // start/end bounds of the entire definition AST node, including + // documentation. + // ``` + // const n = 3 + // ^ range + // ^^^^^^^^^^^ enclosing_range + // + // /** Parses the string into something */ + // ^ enclosing_range start --------------------------------------| + // function parse(input string): string { | + // ^^^^^ range | + // return input.slice(n) | + // } | + // ^ enclosing_range end <---------------------------------------| + // ``` + // + // Any attributes/decorators/attached macros should also be part of the + // enclosing range. + // + // ```python + // @cache + // ^ enclosing_range start---------------------| + // def factorial(n): | + // return n * factorial(n-1) if n else 1 | + // < enclosing_range end-----------------------| + // + // ``` + // + // For reference occurrences, the enclosing range should indicate the start/end + // bounds of the parent expression. + // ``` + // const a = a.b + // ^ range + // ^^^ enclosing_range + // const b = a.b(41).f(42).g(43) + // ^ range + // ^^^^^^^^^^^^^ enclosing_range + // ``` + // + // When both `typed_enclosing_range` and the deprecated `enclosing_range` + // field are set, `typed_enclosing_range` takes precedence. + oneof typed_enclosing_range { + // Enclosing range spanning a single line. + SingleLineRange single_line_enclosing_range = 10; + // Enclosing range spanning multiple lines. + MultiLineRange multi_line_enclosing_range = 11; + } } // Represents a diagnostic, such as a compiler error or warning, which should be @@ -440,11 +838,12 @@ enum DiagnosticTag { // for the `Document.language` field. The primary purpose of this enum is to // prevent a situation where we have a single programming language ends up with // multiple string representations. For example, the C++ language uses the name -// "CPlusPlus" in this enum and other names such as "cpp" are incompatible. +// "CPP" in this enum and other names such as "cpp" are incompatible. // Feel free to send a pull-request to add missing programming languages. enum Language { UnspecifiedLanguage = 0; ABAP = 60; + Apex = 96; APL = 49; Ada = 39; Agda = 45; @@ -462,6 +861,7 @@ enum Language { Coffeescript = 21; CommonLisp = 9; Coq = 47; + CUDA = 97; Dart = 3; Delphi = 57; Diff = 88; @@ -477,6 +877,7 @@ enum Language { Git_Config = 89; Git_Rebase = 92; Go = 33; + GraphQL = 98; Groovy = 7; HTML = 30; Hack = 20; @@ -490,29 +891,36 @@ enum Language { JavaScript = 22; JavaScriptReact = 93; Jsonnet = 76; - Julia = 55; + Julia = 55; + Justfile = 109; Kotlin = 4; LaTeX = 83; Lean = 48; Less = 27; Lua = 12; + Luau = 108; Makefile = 79; Markdown = 84; Matlab = 52; + Nickel = 110; // https://nickel-lang.org/ Nix = 77; OCaml = 41; Objective_C = 36; Objective_CPP = 37; + Odin = 111; // https://odin-lang.org/ + Pascal = 99; PHP = 19; PLSQL = 70; Perl = 13; PowerShell = 67; Prolog = 71; + Protobuf = 100; Python = 15; R = 54; Racket = 11; Raku = 14; Razor = 62; + Repro = 102; // Internal language for testing SCIP ReST = 85; Ruby = 16; Rust = 40; @@ -525,11 +933,18 @@ enum Language { Scheme = 10; ShellScript = 64; // Bash Skylark = 78; + Slang = 107; + Solidity = 95; + Svelte = 106; Swift = 2; + Tcl = 101; TOML = 73; TeX = 82; + Thrift = 103; TypeScript = 23; TypeScriptReact = 94; + Verilog = 104; + VHDL = 105; VisualBasic = 63; Vue = 25; Wolfram = 53; @@ -537,7 +952,7 @@ enum Language { XSL = 32; YAML = 74; Zig = 38; - // NextLanguage = 95; + // NextLanguage = 112; // Steps add a new language: // 1. Copy-paste the "NextLanguage = N" line above // 2. Increment "NextLanguage = N" to "NextLanguage = N+1" diff --git a/snapshots/input/symbol-kinds/CSharpKinds/CSharpKinds.csproj b/snapshots/input/symbol-kinds/CSharpKinds/CSharpKinds.csproj new file mode 100644 index 0000000..8d2b232 --- /dev/null +++ b/snapshots/input/symbol-kinds/CSharpKinds/CSharpKinds.csproj @@ -0,0 +1,8 @@ + + + + net8.0 + enable + + + diff --git a/snapshots/input/symbol-kinds/CSharpKinds/Kinds.cs b/snapshots/input/symbol-kinds/CSharpKinds/Kinds.cs new file mode 100644 index 0000000..1e44e94 --- /dev/null +++ b/snapshots/input/symbol-kinds/CSharpKinds/Kinds.cs @@ -0,0 +1,49 @@ +namespace SymbolKinds +{ + public interface IShape + { + } + + public struct Point + { + } + + public enum Color + { + Red + } + + public delegate void Handler(); + + public class Kinds + { + public const int Constant = 1; + public int Field; + public static int StaticField; + + public Kinds() + { + } + + public int Property { get; set; } + public static int StaticProperty { get; set; } + + public event Handler? Event; + public static event Handler? StaticEvent; + + public void Method() + { + } + + public static void StaticMethod() + { + } + } + + public static class KindsExtensions + { + public static void Extension(this Kinds kinds) + { + } + } +} diff --git a/snapshots/input/symbol-kinds/VBKinds/Kinds.vb b/snapshots/input/symbol-kinds/VBKinds/Kinds.vb new file mode 100644 index 0000000..99d5b16 --- /dev/null +++ b/snapshots/input/symbol-kinds/VBKinds/Kinds.vb @@ -0,0 +1,9 @@ +Namespace SymbolKinds + Public Class VBClass + End Class + + Public Module VBModule + Public Sub ModuleMethod() + End Sub + End Module +End Namespace diff --git a/snapshots/input/symbol-kinds/VBKinds/VBKinds.vbproj b/snapshots/input/symbol-kinds/VBKinds/VBKinds.vbproj new file mode 100644 index 0000000..fad20c5 --- /dev/null +++ b/snapshots/input/symbol-kinds/VBKinds/VBKinds.vbproj @@ -0,0 +1,8 @@ + + + + net8.0 + + + + diff --git a/snapshots/input/symbol-kinds/symbol-kinds.sln b/snapshots/input/symbol-kinds/symbol-kinds.sln new file mode 100644 index 0000000..4dc6d15 --- /dev/null +++ b/snapshots/input/symbol-kinds/symbol-kinds.sln @@ -0,0 +1,48 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpKinds", "CSharpKinds\CSharpKinds.csproj", "{AECE61AA-B55D-4840-9654-47D4FA1EC341}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VBKinds", "VBKinds\VBKinds.vbproj", "{3092C308-D3F4-4836-A96B-3C3663B378BE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AECE61AA-B55D-4840-9654-47D4FA1EC341}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AECE61AA-B55D-4840-9654-47D4FA1EC341}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AECE61AA-B55D-4840-9654-47D4FA1EC341}.Debug|x64.ActiveCfg = Debug|Any CPU + {AECE61AA-B55D-4840-9654-47D4FA1EC341}.Debug|x64.Build.0 = Debug|Any CPU + {AECE61AA-B55D-4840-9654-47D4FA1EC341}.Debug|x86.ActiveCfg = Debug|Any CPU + {AECE61AA-B55D-4840-9654-47D4FA1EC341}.Debug|x86.Build.0 = Debug|Any CPU + {AECE61AA-B55D-4840-9654-47D4FA1EC341}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AECE61AA-B55D-4840-9654-47D4FA1EC341}.Release|Any CPU.Build.0 = Release|Any CPU + {AECE61AA-B55D-4840-9654-47D4FA1EC341}.Release|x64.ActiveCfg = Release|Any CPU + {AECE61AA-B55D-4840-9654-47D4FA1EC341}.Release|x64.Build.0 = Release|Any CPU + {AECE61AA-B55D-4840-9654-47D4FA1EC341}.Release|x86.ActiveCfg = Release|Any CPU + {AECE61AA-B55D-4840-9654-47D4FA1EC341}.Release|x86.Build.0 = Release|Any CPU + {3092C308-D3F4-4836-A96B-3C3663B378BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3092C308-D3F4-4836-A96B-3C3663B378BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3092C308-D3F4-4836-A96B-3C3663B378BE}.Debug|x64.ActiveCfg = Debug|Any CPU + {3092C308-D3F4-4836-A96B-3C3663B378BE}.Debug|x64.Build.0 = Debug|Any CPU + {3092C308-D3F4-4836-A96B-3C3663B378BE}.Debug|x86.ActiveCfg = Debug|Any CPU + {3092C308-D3F4-4836-A96B-3C3663B378BE}.Debug|x86.Build.0 = Debug|Any CPU + {3092C308-D3F4-4836-A96B-3C3663B378BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3092C308-D3F4-4836-A96B-3C3663B378BE}.Release|Any CPU.Build.0 = Release|Any CPU + {3092C308-D3F4-4836-A96B-3C3663B378BE}.Release|x64.ActiveCfg = Release|Any CPU + {3092C308-D3F4-4836-A96B-3C3663B378BE}.Release|x64.Build.0 = Release|Any CPU + {3092C308-D3F4-4836-A96B-3C3663B378BE}.Release|x86.ActiveCfg = Release|Any CPU + {3092C308-D3F4-4836-A96B-3C3663B378BE}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/snapshots/output-net10.0/symbol-kinds/CSharpKinds/Kinds.cs b/snapshots/output-net10.0/symbol-kinds/CSharpKinds/Kinds.cs new file mode 100644 index 0000000..5e69f1c --- /dev/null +++ b/snapshots/output-net10.0/symbol-kinds/CSharpKinds/Kinds.cs @@ -0,0 +1,99 @@ + namespace SymbolKinds +// ^^^^^^^^^^^ reference scip-dotnet nuget . . SymbolKinds/ + { + public interface IShape +// ^^^^^^ definition scip-dotnet nuget . . SymbolKinds/IShape# +// documentation ```cs\ninterface IShape\n``` + { + } + + public struct Point +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Point# +// documentation ```cs\nstruct Point\n``` + { + } + + public enum Color +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Color# +// documentation ```cs\nenum Color\n``` +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/IComparable# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/IConvertible# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/ISpanFormattable# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/IFormattable# + { + Red +// ^^^ definition scip-dotnet nuget . . SymbolKinds/Color#Red. +// documentation ```cs\nColor.Red = 0\n``` + } + + public delegate void Handler(); +// ^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Handler# +// documentation ```cs\ndelegate void Handler()\n``` +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/MulticastDelegate# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/Delegate# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/ICloneable# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 Serialization/ISerializable# + + public class Kinds +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds# +// documentation ```cs\nclass Kinds\n``` + { + public const int Constant = 1; +// ^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Constant. +// documentation ```cs\npublic const int Kinds.Constant = 1\n``` + public int Field; +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Field. +// documentation ```cs\npublic int Kinds.Field\n``` + public static int StaticField; +// ^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#StaticField. +// documentation ```cs\npublic static int Kinds.StaticField\n``` + + public Kinds() +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#`.ctor`(). +// documentation ```cs\npublic Kinds.Kinds()\n``` + { + } + + public int Property { get; set; } +// ^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Property. +// documentation ```cs\npublic int Kinds.Property { get; set; }\n``` + public static int StaticProperty { get; set; } +// ^^^^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#StaticProperty. +// documentation ```cs\npublic static int Kinds.StaticProperty { get; set; }\n``` + + public event Handler? Event; +// ^^^^^^^ reference scip-dotnet nuget . . SymbolKinds/Handler# +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Event# +// documentation ```cs\npublic event Handler? Kinds.Event\n``` + public static event Handler? StaticEvent; +// ^^^^^^^ reference scip-dotnet nuget . . SymbolKinds/Handler# +// ^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#StaticEvent# +// documentation ```cs\npublic static event Handler? Kinds.StaticEvent\n``` + + public void Method() +// ^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Method(). +// documentation ```cs\npublic void Kinds.Method()\n``` + { + } + + public static void StaticMethod() +// ^^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#StaticMethod(). +// documentation ```cs\npublic static void Kinds.StaticMethod()\n``` + { + } + } + + public static class KindsExtensions +// ^^^^^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/KindsExtensions# +// documentation ```cs\nclass KindsExtensions\n``` + { + public static void Extension(this Kinds kinds) +// ^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/KindsExtensions#Extension(). +// documentation ```cs\npublic void Kinds.Extension()\n``` +// ^^^^^ reference scip-dotnet nuget . . SymbolKinds/Kinds# +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/KindsExtensions#Extension().(kinds) +// documentation ```cs\nKinds kinds\n``` + { + } + } + } diff --git a/snapshots/output-net10.0/symbol-kinds/VBKinds/Kinds.vb b/snapshots/output-net10.0/symbol-kinds/VBKinds/Kinds.vb new file mode 100644 index 0000000..f03c8e5 --- /dev/null +++ b/snapshots/output-net10.0/symbol-kinds/VBKinds/Kinds.vb @@ -0,0 +1,16 @@ + Namespace SymbolKinds +' ^^^^^^^^^^^ reference scip-dotnet nuget . . SymbolKinds/ + Public Class VBClass +' ^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/VBClass# +' documentation ```vb\nClass VBClass\n``` + End Class + + Public Module VBModule +' ^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/VBModule# +' documentation ```vb\nModule VBModule\n``` + Public Sub ModuleMethod() +' ^^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/VBModule#ModuleMethod(). +' documentation ```vb\nPublic Sub VBModule.ModuleMethod()\n``` + End Sub + End Module + End Namespace diff --git a/snapshots/output-net8.0/symbol-kinds/CSharpKinds/Kinds.cs b/snapshots/output-net8.0/symbol-kinds/CSharpKinds/Kinds.cs new file mode 100644 index 0000000..5e69f1c --- /dev/null +++ b/snapshots/output-net8.0/symbol-kinds/CSharpKinds/Kinds.cs @@ -0,0 +1,99 @@ + namespace SymbolKinds +// ^^^^^^^^^^^ reference scip-dotnet nuget . . SymbolKinds/ + { + public interface IShape +// ^^^^^^ definition scip-dotnet nuget . . SymbolKinds/IShape# +// documentation ```cs\ninterface IShape\n``` + { + } + + public struct Point +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Point# +// documentation ```cs\nstruct Point\n``` + { + } + + public enum Color +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Color# +// documentation ```cs\nenum Color\n``` +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/IComparable# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/IConvertible# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/ISpanFormattable# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/IFormattable# + { + Red +// ^^^ definition scip-dotnet nuget . . SymbolKinds/Color#Red. +// documentation ```cs\nColor.Red = 0\n``` + } + + public delegate void Handler(); +// ^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Handler# +// documentation ```cs\ndelegate void Handler()\n``` +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/MulticastDelegate# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/Delegate# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/ICloneable# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 Serialization/ISerializable# + + public class Kinds +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds# +// documentation ```cs\nclass Kinds\n``` + { + public const int Constant = 1; +// ^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Constant. +// documentation ```cs\npublic const int Kinds.Constant = 1\n``` + public int Field; +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Field. +// documentation ```cs\npublic int Kinds.Field\n``` + public static int StaticField; +// ^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#StaticField. +// documentation ```cs\npublic static int Kinds.StaticField\n``` + + public Kinds() +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#`.ctor`(). +// documentation ```cs\npublic Kinds.Kinds()\n``` + { + } + + public int Property { get; set; } +// ^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Property. +// documentation ```cs\npublic int Kinds.Property { get; set; }\n``` + public static int StaticProperty { get; set; } +// ^^^^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#StaticProperty. +// documentation ```cs\npublic static int Kinds.StaticProperty { get; set; }\n``` + + public event Handler? Event; +// ^^^^^^^ reference scip-dotnet nuget . . SymbolKinds/Handler# +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Event# +// documentation ```cs\npublic event Handler? Kinds.Event\n``` + public static event Handler? StaticEvent; +// ^^^^^^^ reference scip-dotnet nuget . . SymbolKinds/Handler# +// ^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#StaticEvent# +// documentation ```cs\npublic static event Handler? Kinds.StaticEvent\n``` + + public void Method() +// ^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Method(). +// documentation ```cs\npublic void Kinds.Method()\n``` + { + } + + public static void StaticMethod() +// ^^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#StaticMethod(). +// documentation ```cs\npublic static void Kinds.StaticMethod()\n``` + { + } + } + + public static class KindsExtensions +// ^^^^^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/KindsExtensions# +// documentation ```cs\nclass KindsExtensions\n``` + { + public static void Extension(this Kinds kinds) +// ^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/KindsExtensions#Extension(). +// documentation ```cs\npublic void Kinds.Extension()\n``` +// ^^^^^ reference scip-dotnet nuget . . SymbolKinds/Kinds# +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/KindsExtensions#Extension().(kinds) +// documentation ```cs\nKinds kinds\n``` + { + } + } + } diff --git a/snapshots/output-net8.0/symbol-kinds/VBKinds/Kinds.vb b/snapshots/output-net8.0/symbol-kinds/VBKinds/Kinds.vb new file mode 100644 index 0000000..f03c8e5 --- /dev/null +++ b/snapshots/output-net8.0/symbol-kinds/VBKinds/Kinds.vb @@ -0,0 +1,16 @@ + Namespace SymbolKinds +' ^^^^^^^^^^^ reference scip-dotnet nuget . . SymbolKinds/ + Public Class VBClass +' ^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/VBClass# +' documentation ```vb\nClass VBClass\n``` + End Class + + Public Module VBModule +' ^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/VBModule# +' documentation ```vb\nModule VBModule\n``` + Public Sub ModuleMethod() +' ^^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/VBModule#ModuleMethod(). +' documentation ```vb\nPublic Sub VBModule.ModuleMethod()\n``` + End Sub + End Module + End Namespace diff --git a/snapshots/output-net9.0/symbol-kinds/CSharpKinds/Kinds.cs b/snapshots/output-net9.0/symbol-kinds/CSharpKinds/Kinds.cs new file mode 100644 index 0000000..5e69f1c --- /dev/null +++ b/snapshots/output-net9.0/symbol-kinds/CSharpKinds/Kinds.cs @@ -0,0 +1,99 @@ + namespace SymbolKinds +// ^^^^^^^^^^^ reference scip-dotnet nuget . . SymbolKinds/ + { + public interface IShape +// ^^^^^^ definition scip-dotnet nuget . . SymbolKinds/IShape# +// documentation ```cs\ninterface IShape\n``` + { + } + + public struct Point +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Point# +// documentation ```cs\nstruct Point\n``` + { + } + + public enum Color +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Color# +// documentation ```cs\nenum Color\n``` +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/IComparable# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/IConvertible# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/ISpanFormattable# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/IFormattable# + { + Red +// ^^^ definition scip-dotnet nuget . . SymbolKinds/Color#Red. +// documentation ```cs\nColor.Red = 0\n``` + } + + public delegate void Handler(); +// ^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Handler# +// documentation ```cs\ndelegate void Handler()\n``` +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/MulticastDelegate# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/Delegate# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 System/ICloneable# +// relationship implementation scip-dotnet nuget System.Runtime 8.0.0.0 Serialization/ISerializable# + + public class Kinds +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds# +// documentation ```cs\nclass Kinds\n``` + { + public const int Constant = 1; +// ^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Constant. +// documentation ```cs\npublic const int Kinds.Constant = 1\n``` + public int Field; +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Field. +// documentation ```cs\npublic int Kinds.Field\n``` + public static int StaticField; +// ^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#StaticField. +// documentation ```cs\npublic static int Kinds.StaticField\n``` + + public Kinds() +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#`.ctor`(). +// documentation ```cs\npublic Kinds.Kinds()\n``` + { + } + + public int Property { get; set; } +// ^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Property. +// documentation ```cs\npublic int Kinds.Property { get; set; }\n``` + public static int StaticProperty { get; set; } +// ^^^^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#StaticProperty. +// documentation ```cs\npublic static int Kinds.StaticProperty { get; set; }\n``` + + public event Handler? Event; +// ^^^^^^^ reference scip-dotnet nuget . . SymbolKinds/Handler# +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Event# +// documentation ```cs\npublic event Handler? Kinds.Event\n``` + public static event Handler? StaticEvent; +// ^^^^^^^ reference scip-dotnet nuget . . SymbolKinds/Handler# +// ^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#StaticEvent# +// documentation ```cs\npublic static event Handler? Kinds.StaticEvent\n``` + + public void Method() +// ^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#Method(). +// documentation ```cs\npublic void Kinds.Method()\n``` + { + } + + public static void StaticMethod() +// ^^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/Kinds#StaticMethod(). +// documentation ```cs\npublic static void Kinds.StaticMethod()\n``` + { + } + } + + public static class KindsExtensions +// ^^^^^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/KindsExtensions# +// documentation ```cs\nclass KindsExtensions\n``` + { + public static void Extension(this Kinds kinds) +// ^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/KindsExtensions#Extension(). +// documentation ```cs\npublic void Kinds.Extension()\n``` +// ^^^^^ reference scip-dotnet nuget . . SymbolKinds/Kinds# +// ^^^^^ definition scip-dotnet nuget . . SymbolKinds/KindsExtensions#Extension().(kinds) +// documentation ```cs\nKinds kinds\n``` + { + } + } + } diff --git a/snapshots/output-net9.0/symbol-kinds/VBKinds/Kinds.vb b/snapshots/output-net9.0/symbol-kinds/VBKinds/Kinds.vb new file mode 100644 index 0000000..f03c8e5 --- /dev/null +++ b/snapshots/output-net9.0/symbol-kinds/VBKinds/Kinds.vb @@ -0,0 +1,16 @@ + Namespace SymbolKinds +' ^^^^^^^^^^^ reference scip-dotnet nuget . . SymbolKinds/ + Public Class VBClass +' ^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/VBClass# +' documentation ```vb\nClass VBClass\n``` + End Class + + Public Module VBModule +' ^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/VBModule# +' documentation ```vb\nModule VBModule\n``` + Public Sub ModuleMethod() +' ^^^^^^^^^^^^ definition scip-dotnet nuget . . SymbolKinds/VBModule#ModuleMethod(). +' documentation ```vb\nPublic Sub VBModule.ModuleMethod()\n``` + End Sub + End Module + End Namespace