Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEDX-1655: Added missing kinds #149

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions lib/src/gen/scip.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,11 @@ class Document extends $pb.GeneratedMessage {
/// 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> | <macro>
Expand All @@ -440,16 +441,16 @@ class Document extends $pb.GeneratedMessage {
/// <term> ::= <name> '.'
/// <meta> ::= <name> ':'
/// <macro> ::= <name> '!'
/// <method> ::= <name> '(' <method-disambiguator> ').'
/// <method> ::= <name> '(' (<method-disambiguator>)? ').'
/// <type-parameter> ::= '[' <name> ']'
/// <parameter> ::= '(' <name> ')'
/// <name> ::= <identifier>
/// <method-disambiguator> ::= <simple-identifier>
/// <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>
/// ```
///
Expand Down Expand Up @@ -1094,13 +1095,15 @@ class Occurrence extends $pb.GeneratedMessage {
static Occurrence getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Occurrence>(create);
static Occurrence? _defaultInstance;

/// Source position of this occurrence. Must be exactly three or four
/// Half-open [start, end) range of this occurrence. Must be exactly three or four
/// elements:
///
/// - 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.
///
/// It is allowed for the range to be empty (i.e. start==end).
///
/// 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.
Expand Down Expand Up @@ -1165,8 +1168,8 @@ class Occurrence extends $pb.GeneratedMessage {
@$pb.TagNumber(6)
$core.List<Diagnostic> get diagnostics => $_getList(5);

/// (optional) Using the same encoding as the sibling `range` field, source
/// position of the nearest non-trivial enclosing AST node. This range must
/// (optional) Using the same encoding as the sibling `range` field, half-open
/// source range of the nearest non-trivial enclosing AST node. This range must
/// enclose the `range` field. Example applications that make use of the
/// enclosing_range field:
///
Expand Down
4 changes: 4 additions & 0 deletions lib/src/gen/scip.pbenum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ class SymbolInformation_Kind extends $pb.ProtobufEnum {
static const SymbolInformation_Kind EnumMember = SymbolInformation_Kind._(12, _omitEnumNames ? '' : 'EnumMember');
static const SymbolInformation_Kind Error = SymbolInformation_Kind._(63, _omitEnumNames ? '' : 'Error');
static const SymbolInformation_Kind Event = SymbolInformation_Kind._(13, _omitEnumNames ? '' : 'Event');
static const SymbolInformation_Kind Extension = SymbolInformation_Kind._(84, _omitEnumNames ? '' : 'Extension');
static const SymbolInformation_Kind Fact = SymbolInformation_Kind._(14, _omitEnumNames ? '' : 'Fact');
static const SymbolInformation_Kind Field = SymbolInformation_Kind._(15, _omitEnumNames ? '' : 'Field');
static const SymbolInformation_Kind File = SymbolInformation_Kind._(16, _omitEnumNames ? '' : 'File');
Expand All @@ -543,6 +544,7 @@ class SymbolInformation_Kind extends $pb.ProtobufEnum {
static const SymbolInformation_Kind MethodReceiver = SymbolInformation_Kind._(27, _omitEnumNames ? '' : 'MethodReceiver');
static const SymbolInformation_Kind MethodSpecification = SymbolInformation_Kind._(67, _omitEnumNames ? '' : 'MethodSpecification');
static const SymbolInformation_Kind Message = SymbolInformation_Kind._(28, _omitEnumNames ? '' : 'Message');
static const SymbolInformation_Kind Mixin = SymbolInformation_Kind._(85, _omitEnumNames ? '' : 'Mixin');
static const SymbolInformation_Kind Modifier = SymbolInformation_Kind._(65, _omitEnumNames ? '' : 'Modifier');
static const SymbolInformation_Kind Module = SymbolInformation_Kind._(29, _omitEnumNames ? '' : 'Module');
static const SymbolInformation_Kind Namespace = SymbolInformation_Kind._(30, _omitEnumNames ? '' : 'Namespace');
Expand Down Expand Up @@ -610,6 +612,7 @@ class SymbolInformation_Kind extends $pb.ProtobufEnum {
EnumMember,
Error,
Event,
Extension,
Fact,
Field,
File,
Expand All @@ -628,6 +631,7 @@ class SymbolInformation_Kind extends $pb.ProtobufEnum {
MethodReceiver,
MethodSpecification,
Message,
Mixin,
Modifier,
Module,
Namespace,
Expand Down
40 changes: 21 additions & 19 deletions lib/src/gen/scip.pbjson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ const SymbolInformation_Kind$json = {
{'1': 'EnumMember', '2': 12},
{'1': 'Error', '2': 63},
{'1': 'Event', '2': 13},
{'1': 'Extension', '2': 84},
{'1': 'Fact', '2': 14},
{'1': 'Field', '2': 15},
{'1': 'File', '2': 16},
Expand All @@ -528,6 +529,7 @@ const SymbolInformation_Kind$json = {
{'1': 'MethodReceiver', '2': 27},
{'1': 'MethodSpecification', '2': 67},
{'1': 'Message', '2': 28},
{'1': 'Mixin', '2': 85},
{'1': 'Modifier', '2': 65},
{'1': 'Module', '2': 29},
{'1': 'Namespace', '2': 30},
Expand Down Expand Up @@ -585,29 +587,29 @@ final $typed_data.Uint8List symbolInformationDescriptor = $convert.base64Decode(
'xJbmZvcm1hdGlvbi5LaW5kUgRraW5kEiEKDGRpc3BsYXlfbmFtZRgGIAEoCVILZGlzcGxheU5h'
'bWUSRwoXc2lnbmF0dXJlX2RvY3VtZW50YXRpb24YByABKAsyDi5zY2lwLkRvY3VtZW50UhZzaW'
'duYXR1cmVEb2N1bWVudGF0aW9uEikKEGVuY2xvc2luZ19zeW1ib2wYCCABKAlSD2VuY2xvc2lu'
'Z1N5bWJvbCLUCQoES2luZBITCg9VbnNwZWNpZmllZEtpbmQQABISCg5BYnN0cmFjdE1ldGhvZB'
'Z1N5bWJvbCLuCQoES2luZBITCg9VbnNwZWNpZmllZEtpbmQQABISCg5BYnN0cmFjdE1ldGhvZB'
'BCEgwKCEFjY2Vzc29yEEgSCQoFQXJyYXkQARINCglBc3NlcnRpb24QAhISCg5Bc3NvY2lhdGVk'
'VHlwZRADEg0KCUF0dHJpYnV0ZRAEEgkKBUF4aW9tEAUSCwoHQm9vbGVhbhAGEgkKBUNsYXNzEA'
'cSDAoIQ29uc3RhbnQQCBIPCgtDb25zdHJ1Y3RvchAJEgwKCENvbnRyYWN0ED4SDgoKRGF0YUZh'
'bWlseRAKEgwKCERlbGVnYXRlEEkSCAoERW51bRALEg4KCkVudW1NZW1iZXIQDBIJCgVFcnJvch'
'A/EgkKBUV2ZW50EA0SCAoERmFjdBAOEgkKBUZpZWxkEA8SCAoERmlsZRAQEgwKCEZ1bmN0aW9u'
'EBESCgoGR2V0dGVyEBISCwoHR3JhbW1hchATEgwKCEluc3RhbmNlEBQSDQoJSW50ZX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gtTdG'
'F0aWNFdmVudBBOEg8KC1N0YXRpY0ZpZWxkEE8SEAoMU3RhdGljTWV0aG9kEFASEgoOU3RhdGlj'
'UHJvcGVydHkQURISCg5TdGF0aWNWYXJpYWJsZRBSEgoKBlN0cmluZxAwEgoKBlN0cnVjdBAxEg'
'0KCVN1YnNjcmlwdBAvEgoKBlRhY3RpYxAyEgsKB1RoZW9yZW0QMxIRCg1UaGlzUGFyYW1ldGVy'
'EDQSCQoFVHJhaXQQNRIPCgtUcmFpdE1ldGhvZBBGEggKBFR5cGUQNhINCglUeXBlQWxpYXMQNx'
'INCglUeXBlQ2xhc3MQOBITCg9UeXBlQ2xhc3NNZXRob2QQRxIOCgpUeXBlRmFtaWx5EDkSEQoN'
'VHlwZVBhcmFtZXRlchA6EgkKBVVuaW9uEDsSCQoFVmFsdWUQPBIMCghWYXJpYWJsZRA9');

@$core.Deprecated('Use relationshipDescriptor instead')
const Relationship$json = {
Expand Down
28 changes: 16 additions & 12 deletions lib/src/gen/scip.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/// Comes From: https://github.com/sourcegraph/scip/blob/main/scip.proto
/// scip v0.3.3

// An index contains one or more pieces of information about a given piece of
// source code or software artifact. Complementary information can be merged
// together from multiple sources to provide a unified code intelligence
Expand Down Expand Up @@ -155,10 +152,11 @@ enum PositionEncoding {
// 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> | <macro>
Expand All @@ -167,16 +165,16 @@ enum PositionEncoding {
// <term> ::= <name> '.'
// <meta> ::= <name> ':'
// <macro> ::= <name> '!'
// <method> ::= <name> '(' <method-disambiguator> ').'
// <method> ::= <name> '(' (<method-disambiguator>)? ').'
// <type-parameter> ::= '[' <name> ']'
// <parameter> ::= '(' <name> ')'
// <name> ::= <identifier>
// <method-disambiguator> ::= <simple-identifier>
// <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>
// ```
//
Expand Down Expand Up @@ -289,6 +287,8 @@ message SymbolInformation {
EnumMember = 12;
Error = 63;
Event = 13;
// For Dart
Extension = 84;
// For Alloy
Fact = 14;
Field = 15;
Expand Down Expand Up @@ -319,6 +319,8 @@ message SymbolInformation {
MethodSpecification = 67;
// For Protobuf
Message = 28;
// For Dart
Mixin = 85;
// For Solidity
Modifier = 65;
Module = 29;
Expand Down Expand Up @@ -396,7 +398,7 @@ message SymbolInformation {
Union = 59;
Value = 60;
Variable = 61;
// Next = 83;
// Next = 86;
// 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.
Expand Down Expand Up @@ -625,13 +627,15 @@ enum SyntaxKind {
// If possible, indexers should try to bundle logically related information
// across occurrences into a single occurrence to reduce payload sizes.
message Occurrence {
// Source position of this occurrence. Must be exactly three or four
// Half-open [start, end) range of this occurrence. Must be exactly three or four
// elements:
//
// - 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.
//
// It is allowed for the range to be empty (i.e. start==end).
//
// 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.
Expand Down Expand Up @@ -666,8 +670,8 @@ message Occurrence {
SyntaxKind syntax_kind = 5;
// (optional) Diagnostics that have been reported for this specific range.
repeated Diagnostic diagnostics = 6;
// (optional) Using the same encoding as the sibling `range` field, source
// position of the nearest non-trivial enclosing AST node. This range must
// (optional) Using the same encoding as the sibling `range` field, half-open
// source range of the nearest non-trivial enclosing AST node. This range must
// enclose the `range` field. Example applications that make use of the
// enclosing_range field:
//
Expand Down
6 changes: 2 additions & 4 deletions lib/src/kind_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ SymbolInformation_Kind symbolKindFor(Element el) {
if (el is ClassElement) {
return SymbolInformation_Kind.Class;
} else if (el is MixinElement) {
// Pending: https://github.com/sourcegraph/scip/pull/277
// return SymbolInformation_Kind.Mixin;
return SymbolInformation_Kind.Mixin;
} else if (el is EnumElement) {
return SymbolInformation_Kind.Enum;
} else if (el is TypeAliasElement) {
return SymbolInformation_Kind.TypeAlias;
} else if (el is ExtensionElement) {
// Pending: https://github.com/sourcegraph/scip/pull/277
// return SymbolInformation_Kind.Extension;
return SymbolInformation_Kind.Extension;
} else if (el is ConstructorElement) {
return SymbolInformation_Kind.Constructor;
} else if (el is MethodElement) {
Expand Down