diff --git a/docker-images/syntax-highlighter/Cargo.Bazel.lock b/docker-images/syntax-highlighter/Cargo.Bazel.lock index 7ad584782e2b..d551f1025c91 100644 --- a/docker-images/syntax-highlighter/Cargo.Bazel.lock +++ b/docker-images/syntax-highlighter/Cargo.Bazel.lock @@ -1,5 +1,5 @@ { - "checksum": "a30200fddef89273f32721d5e5e6b1e44a4d56104443ffb9e2bc722f6ca165ab", + "checksum": "288db33db039b863e97c43a6dc03bbb6fe334ab97e11d52e00b63dd3e6c17487", "crates": { "addr2line 0.20.0": { "name": "addr2line", @@ -10125,16 +10125,13 @@ }, "license": "Unlicense/MIT" }, - "scip 0.1.1": { + "scip 0.3.1": { "name": "scip", - "version": "0.1.1", + "version": "0.3.1", "repository": { - "Git": { - "remote": "https://github.com/sourcegraph/scip", - "commitish": { - "Rev": "1bf111e1cf175569970e95566b379fb2a548d70a" - }, - "strip_prefix": "bindings/rust" + "Http": { + "url": "https://crates.io/api/v1/crates/scip/0.3.1/download", + "sha256": "3e84d21062a3ba08d58870c8c36b0c005b2b2261c6ad1bf7042585427c781883" } }, "targets": [ @@ -10163,7 +10160,7 @@ "selects": {} }, "edition": "2021", - "version": "0.1.1" + "version": "0.3.1" }, "license": "Apache-2.0" }, @@ -10264,7 +10261,7 @@ "target": "rustc_hash" }, { - "id": "scip 0.1.1", + "id": "scip 0.3.1", "target": "scip" }, { @@ -10322,7 +10319,7 @@ "target": "protobuf" }, { - "id": "scip 0.1.1", + "id": "scip 0.3.1", "target": "scip" }, { @@ -10382,7 +10379,7 @@ "target": "protobuf" }, { - "id": "scip 0.1.1", + "id": "scip 0.3.1", "target": "scip" } ], @@ -10429,7 +10426,7 @@ "target": "lazy_static" }, { - "id": "scip 0.1.1", + "id": "scip 0.3.1", "target": "scip" }, { @@ -10907,7 +10904,7 @@ "target": "rocket" }, { - "id": "scip 0.1.1", + "id": "scip 0.3.1", "target": "scip" }, { @@ -11774,7 +11771,7 @@ "target": "rustyline" }, { - "id": "scip 0.1.1", + "id": "scip 0.3.1", "target": "scip" }, { diff --git a/docker-images/syntax-highlighter/Cargo.lock b/docker-images/syntax-highlighter/Cargo.lock index f30578325b96..31c602fa8520 100644 --- a/docker-images/syntax-highlighter/Cargo.lock +++ b/docker-images/syntax-highlighter/Cargo.lock @@ -1837,8 +1837,9 @@ dependencies = [ [[package]] name = "scip" -version = "0.1.1" -source = "git+https://github.com/sourcegraph/scip?rev=1bf111e1cf175569970e95566b379fb2a548d70a#1bf111e1cf175569970e95566b379fb2a548d70a" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e84d21062a3ba08d58870c8c36b0c005b2b2261c6ad1bf7042585427c781883" dependencies = [ "protobuf", ] diff --git a/docker-images/syntax-highlighter/Cargo.toml b/docker-images/syntax-highlighter/Cargo.toml index 1d08f898da74..d0a6082d4a78 100644 --- a/docker-images/syntax-highlighter/Cargo.toml +++ b/docker-images/syntax-highlighter/Cargo.toml @@ -64,7 +64,7 @@ tree-sitter = "0.20.9" tree-sitter-highlight = "0.20.1" # Since there is no version tag, we pin the dependency to a specific revision -scip = { git = "https://github.com/sourcegraph/scip", rev="1bf111e1cf175569970e95566b379fb2a548d70a" } +scip = "0.3.1" protobuf = "3" diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/queries/c_sharp/scip-tags.scm b/docker-images/syntax-highlighter/crates/scip-syntax/queries/c_sharp/scip-tags.scm index 83473586d784..29e2159d615c 100644 --- a/docker-images/syntax-highlighter/crates/scip-syntax/queries/c_sharp/scip-tags.scm +++ b/docker-images/syntax-highlighter/crates/scip-syntax/queries/c_sharp/scip-tags.scm @@ -1,20 +1,18 @@ -(using_directive (qualified_name) @descriptor.type) - -(class_declaration name: (_) @descriptor.type) @scope -(interface_declaration name: (_) @descriptor.type) @scope -(enum_declaration name: (_) @descriptor.type) @scope -(struct_declaration name: (_) @descriptor.type) @scope -(namespace_declaration name: (_) @descriptor.namespace) @scope +(class_declaration name: (_) @descriptor.type @kind.class) @scope +(interface_declaration name: (_) @descriptor.type @kind.interface) @scope +(enum_declaration name: (_) @descriptor.type @kind.enum) @scope +(struct_declaration name: (_) @descriptor.type @kind.struct) @scope +(namespace_declaration name: (_) @descriptor.namespace @kind.namespace) @scope ; Counter-intuitive name; it can actually be global -(local_function_statement name: (_) @descriptor.method) -(method_declaration name: (_) @descriptor.method) -(constructor_declaration name: (_) @descriptor.method) +(local_function_statement name: (_) @descriptor.method @kind.function) +(method_declaration name: (_) @descriptor.method @kind.method) +(constructor_declaration name: (_) @descriptor.method @kind.constructor) (block) @local -(field_declaration (variable_declaration (variable_declarator (identifier) @descriptor.term))) -(event_field_declaration (variable_declaration (variable_declarator (identifier) @descriptor.term))) -(property_declaration name: (identifier) @descriptor.term) -(enum_member_declaration name: (_) @descriptor.term) -(delegate_declaration name: (identifier) @descriptor.method) +(field_declaration (variable_declaration (variable_declarator (identifier) @descriptor.term @kind.field))) +(event_field_declaration (variable_declaration (variable_declarator (identifier) @kind.event @descriptor.term))) +(property_declaration name: (identifier) @descriptor.term @kind.property) +(enum_member_declaration name: (_) @descriptor.term @kind.enummember) +(delegate_declaration name: (identifier) @descriptor.method @kind.delegate) diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/queries/python/scip-tags.scm b/docker-images/syntax-highlighter/crates/scip-syntax/queries/python/scip-tags.scm index a9d9ac87fc3b..9bec77b3d891 100644 --- a/docker-images/syntax-highlighter/crates/scip-syntax/queries/python/scip-tags.scm +++ b/docker-images/syntax-highlighter/crates/scip-syntax/queries/python/scip-tags.scm @@ -8,23 +8,22 @@ ; (import_statement name: (_) @descriptor.term) ; (import_from_statement name: (_) @descriptor.term) -(class_definition name: (_) @descriptor.type body: (_) @scope) +(class_definition name: (_) @descriptor.type @kind.class body: (_) @scope) (class_definition body: (block [(function_definition - name: (_) @descriptor.method @kind.field + name: (_) @descriptor.method @kind.method body: (_) @local) (decorated_definition definition: (function_definition - name: (_) @descriptor.method @kind.field + name: (_) @descriptor.method @kind.method body: (_) @local))])) - -(module (function_definition name: (_) @descriptor.method body: (_) @local)) -(module (decorated_definition (function_definition name: (_) @descriptor.method body: (_) @local))) +(module (function_definition name: (_) @descriptor.method @kind.function body: (_) @local)) +(module (decorated_definition (function_definition name: (_) @descriptor.method @kind.function body: (_) @local))) ;; foo = 1 -(expression_statement (assignment left: (identifier) @descriptor.term)) +(expression_statement (assignment left: (identifier) @descriptor.term @kind.variable)) ;; foo, bar, baz = 1, 2, 3 -(expression_statement (assignment left: (pattern_list (identifier) @descriptor.term))) +(expression_statement (assignment left: (pattern_list (identifier) @descriptor.term @kind.variable))) diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/queries/ruby/scip-tags.scm b/docker-images/syntax-highlighter/crates/scip-syntax/queries/ruby/scip-tags.scm index ce51f7486f3e..daa1283a618f 100644 --- a/docker-images/syntax-highlighter/crates/scip-syntax/queries/ruby/scip-tags.scm +++ b/docker-images/syntax-highlighter/crates/scip-syntax/queries/ruby/scip-tags.scm @@ -1,27 +1,30 @@ -(assignment left: [(identifier) (constant)] @descriptor.term) -(class name: (_) @descriptor.type) @scope -(method name: (_) @descriptor.method) @local +(module name: (_) @descriptor.namespace @kind.module) @scope -(singleton_method name: (_) @descriptor.method) @local +(assignment left: (identifier) @descriptor.term @kind.variable) +(assignment left: (constant) @descriptor.term @kind.constant) +(class name: (_) @descriptor.type @kind.class) @scope +(method name: (_) @descriptor.method @kind.method) @local + +(singleton_method name: (_) @descriptor.method @kind.singletonmethod) @local [(do_block) (block) (unless) (case) (begin) (if) (while) (for)] @local ;; attr_accessor :bar -> bar, bar= ((call method: (identifier) @_attr_accessor - arguments: (argument_list (simple_symbol) @descriptor.method)) + arguments: (argument_list (simple_symbol) @descriptor.method @kind.accessor)) (#eq? @_attr_accessor "attr_accessor") (#transform! ":(.*)" "$1") (#transform! ":(.*)" "$1=")) ((call method: (identifier) @_attr_reader - arguments: (argument_list (simple_symbol) @descriptor.method)) + arguments: (argument_list (simple_symbol) @descriptor.method @kind.getter)) (#eq? @_attr_reader "attr_reader") (#transform! ":(.*)" "$1")) ((call method: (identifier) @_attr_writer - arguments: (argument_list (simple_symbol) @descriptor.method)) + arguments: (argument_list (simple_symbol) @descriptor.method @kind.setter)) (#eq? @_attr_writer "attr_writer") (#transform! ":(.*)" "$1=")) @@ -30,7 +33,7 @@ method: (identifier) @_alias_method arguments: (argument_list . - (simple_symbol) @descriptor.method)) + (simple_symbol) @descriptor.method @kind.methodalias)) (#eq? @_alias_method "alias_method") (#transform! ":(.*)" "$1")) diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/src/lib.rs b/docker-images/syntax-highlighter/crates/scip-syntax/src/lib.rs index 95be029ccc2b..3ec1f5843510 100644 --- a/docker-images/syntax-highlighter/crates/scip-syntax/src/lib.rs +++ b/docker-images/syntax-highlighter/crates/scip-syntax/src/lib.rs @@ -98,11 +98,12 @@ mod test { // But most tests should go here and just generate scip snapshots generate_tags_and_snapshot!(Scip, test_scip_zig, "globals.zig"); - generate_tags_and_snapshot!(Scip, test_scip_python, "globals.py"); + generate_tags_and_snapshot!(All, test_tags_python, test_scip_python, "globals.py"); generate_tags_and_snapshot!(Scip, test_scip_python_comp, "python-repo-comp.py"); + generate_tags_and_snapshot!(All, test_tags_ruby, test_scip_ruby, "ruby-globals.rb"); generate_tags_and_snapshot!(Scip, test_scip_java, "globals.java"); generate_tags_and_snapshot!(Scip, test_scip_typescript, "globals.ts"); - generate_tags_and_snapshot!(Scip, test_scip_csharp, "globals.cs"); + generate_tags_and_snapshot!(All, test_tags_csharp, test_scip_csharp, "globals.cs"); generate_tags_and_snapshot!(Scip, test_scip_scala, "globals.scala"); generate_tags_and_snapshot!(All, test_tags_kotlin, test_scip_kotlin, "globals.kt"); diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_globals.cs.snap b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_globals.cs.snap index ddf3e5aee992..f819463a8435 100644 --- a/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_globals.cs.snap +++ b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_globals.cs.snap @@ -3,19 +3,18 @@ source: crates/scip-syntax/src/lib.rs expression: dumped --- using System.Collections.Generic; -// ^^^^^^^^^^^^^^^^^^^^^^^^^^ definition scip-ctags `System.Collections.Generic`# public void SurprisinglyValid(string firstParam) { } -// ^^^^^^^^^^^^^^^^^ definition scip-ctags SurprisinglyValid(). +// ^^^^^^^^^^^^^^^^^ definition(Function) scip-ctags SurprisinglyValid(). namespace Longer.Namespace -// ^^^^^^^^^^^^^^^^ definition scip-ctags `Longer.Namespace`/ +// ^^^^^^^^^^^^^^^^ definition(Namespace) scip-ctags `Longer.Namespace`/ { public class Class -// ^^^^^ definition scip-ctags `Longer.Namespace`/Class# +// ^^^^^ definition(Class) scip-ctags `Longer.Namespace`/Class# { public int ExplicitGetterSetter -// ^^^^^^^^^^^^^^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#ExplicitGetterSetter. +// ^^^^^^^^^^^^^^^^^^^^ definition(Property) scip-ctags `Longer.Namespace`/Class#ExplicitGetterSetter. { get { @@ -27,104 +26,104 @@ expression: dumped } } private int _val; -// ^^^^ definition scip-ctags `Longer.Namespace`/Class#_val. +// ^^^^ definition(Field) scip-ctags `Longer.Namespace`/Class#_val. protected virtual int ImplicitGetterSetter -// ^^^^^^^^^^^^^^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#ImplicitGetterSetter. +// ^^^^^^^^^^^^^^^^^^^^ definition(Property) scip-ctags `Longer.Namespace`/Class#ImplicitGetterSetter. { get; set; } internal int ImplicitGetterPrivateSetter -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#ImplicitGetterPrivateSetter. +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition(Property) scip-ctags `Longer.Namespace`/Class#ImplicitGetterPrivateSetter. { get; private set; } public struct Coords -// ^^^^^^ definition scip-ctags `Longer.Namespace`/Class#Coords# +// ^^^^^^ definition(Struct) scip-ctags `Longer.Namespace`/Class#Coords# { public Coords(double x, double y) -// ^^^^^^ definition scip-ctags `Longer.Namespace`/Class#Coords#Coords(). +// ^^^^^^ definition(Constructor) scip-ctags `Longer.Namespace`/Class#Coords#Coords(). { X = x; Y = y; } public double X { get; } -// ^ definition scip-ctags `Longer.Namespace`/Class#Coords#X. +// ^ definition(Property) scip-ctags `Longer.Namespace`/Class#Coords#X. public double Y { get; } -// ^ definition scip-ctags `Longer.Namespace`/Class#Coords#Y. +// ^ definition(Property) scip-ctags `Longer.Namespace`/Class#Coords#Y. public override string ToString() => $"({X}, {Y})"; -// ^^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#Coords#ToString(). +// ^^^^^^^^ definition(Method) scip-ctags `Longer.Namespace`/Class#Coords#ToString(). } delegate int MyDelegate(); -// ^^^^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#MyDelegate(). +// ^^^^^^^^^^ definition(Delegate) scip-ctags `Longer.Namespace`/Class#MyDelegate(). public event ChangedEventHandler Changed; -// ^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#Changed. +// ^^^^^^^ definition(Event) scip-ctags `Longer.Namespace`/Class#Changed. int _speed; -// ^^^^^^ definition scip-ctags `Longer.Namespace`/Class#_speed. +// ^^^^^^ definition(Field) scip-ctags `Longer.Namespace`/Class#_speed. public string PublicImplicitGetterSetter { get; set; } -// ^^^^^^^^^^^^^^^^^^^^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#PublicImplicitGetterSetter. +// ^^^^^^^^^^^^^^^^^^^^^^^^^^ definition(Property) scip-ctags `Longer.Namespace`/Class#PublicImplicitGetterSetter. public string LambdaFunction => PublicImplicitGetterSetter + " " + _speed + " speed"; -// ^^^^^^^^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#LambdaFunction. +// ^^^^^^^^^^^^^^ definition(Property) scip-ctags `Longer.Namespace`/Class#LambdaFunction. public enum Swag -// ^^^^ definition scip-ctags `Longer.Namespace`/Class#Swag# +// ^^^^ definition(Enum) scip-ctags `Longer.Namespace`/Class#Swag# { Shirt, -// ^^^^^ definition scip-ctags `Longer.Namespace`/Class#Swag#Shirt. +// ^^^^^ definition(EnumMember) scip-ctags `Longer.Namespace`/Class#Swag#Shirt. Sweater, -// ^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#Swag#Sweater. +// ^^^^^^^ definition(EnumMember) scip-ctags `Longer.Namespace`/Class#Swag#Sweater. Socks = 42, -// ^^^^^ definition scip-ctags `Longer.Namespace`/Class#Swag#Socks. +// ^^^^^ definition(EnumMember) scip-ctags `Longer.Namespace`/Class#Swag#Socks. Pants -// ^^^^^ definition scip-ctags `Longer.Namespace`/Class#Swag#Pants. +// ^^^^^ definition(EnumMember) scip-ctags `Longer.Namespace`/Class#Swag#Pants. } public Swag SourcegraphSwag; -// ^^^^^^^^^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#SourcegraphSwag. +// ^^^^^^^^^^^^^^^ definition(Field) scip-ctags `Longer.Namespace`/Class#SourcegraphSwag. [Flags] public enum ZigFeatureSet -// ^^^^^^^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#ZigFeatureSet# +// ^^^^^^^^^^^^^ definition(Enum) scip-ctags `Longer.Namespace`/Class#ZigFeatureSet# { None = 0, -// ^^^^ definition scip-ctags `Longer.Namespace`/Class#ZigFeatureSet#None. +// ^^^^ definition(EnumMember) scip-ctags `Longer.Namespace`/Class#ZigFeatureSet#None. Errors = 1, -// ^^^^^^ definition scip-ctags `Longer.Namespace`/Class#ZigFeatureSet#Errors. +// ^^^^^^ definition(EnumMember) scip-ctags `Longer.Namespace`/Class#ZigFeatureSet#Errors. Comptime = 2, -// ^^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#ZigFeatureSet#Comptime. +// ^^^^^^^^ definition(EnumMember) scip-ctags `Longer.Namespace`/Class#ZigFeatureSet#Comptime. BuildSystem = 4, -// ^^^^^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#ZigFeatureSet#BuildSystem. +// ^^^^^^^^^^^ definition(EnumMember) scip-ctags `Longer.Namespace`/Class#ZigFeatureSet#BuildSystem. CoolCommunity = 8, -// ^^^^^^^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#ZigFeatureSet#CoolCommunity. +// ^^^^^^^^^^^^^ definition(EnumMember) scip-ctags `Longer.Namespace`/Class#ZigFeatureSet#CoolCommunity. FullPackage = Errors | Comptime | BuildSystem | CoolCommunity -// ^^^^^^^^^^^ definition scip-ctags `Longer.Namespace`/Class#ZigFeatureSet#FullPackage. +// ^^^^^^^^^^^ definition(EnumMember) scip-ctags `Longer.Namespace`/Class#ZigFeatureSet#FullPackage. } public static void Syntax() {} -// ^^^^^^ definition scip-ctags `Longer.Namespace`/Class#Syntax(). +// ^^^^^^ definition(Method) scip-ctags `Longer.Namespace`/Class#Syntax(). } } namespace OneClass -// ^^^^^^^^ definition scip-ctags OneClass/ +// ^^^^^^^^ definition(Namespace) scip-ctags OneClass/ { public class TheClass -// ^^^^^^^^ definition scip-ctags OneClass/TheClass# +// ^^^^^^^^ definition(Class) scip-ctags OneClass/TheClass# { public Clickable ClickAction { get; set; } -// ^^^^^^^^^^^ definition scip-ctags OneClass/TheClass#ClickAction. +// ^^^^^^^^^^^ definition(Property) scip-ctags OneClass/TheClass#ClickAction. public string Text { get; set; } -// ^^^^ definition scip-ctags OneClass/TheClass#Text. +// ^^^^ definition(Property) scip-ctags OneClass/TheClass#Text. } } diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_globals.py.snap b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_globals.py.snap index cd53bdc2c3ea..95269707bb23 100644 --- a/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_globals.py.snap +++ b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_globals.py.snap @@ -8,16 +8,16 @@ expression: dumped //^^^^ definition scip-ctags bruh. class Bruh(object): -// ^^^^ definition scip-ctags Bruh# +// ^^^^ definition(Class) scip-ctags Bruh# a: int // ^ definition scip-ctags Bruh#a. def __init__(self) -> None: -// ^^^^^^^^ definition(Field) scip-ctags Bruh#__init__(). +// ^^^^^^^^ definition(Method) scip-ctags Bruh#__init__(). pass def dab(): -// ^^^ definition(Field) scip-ctags Bruh#dab(). +// ^^^ definition(Method) scip-ctags Bruh#dab(). print("yay!") def more(): print("a function in a function!!") @@ -40,52 +40,52 @@ expression: dumped async def my_function(): -// ^^^^^^^^^^^ definition scip-ctags my_function(). +// ^^^^^^^^^^^ definition(Function) scip-ctags my_function(). pass class SomeAsyncStuffs: -// ^^^^^^^^^^^^^^^ definition scip-ctags SomeAsyncStuffs# +// ^^^^^^^^^^^^^^^ definition(Class) scip-ctags SomeAsyncStuffs# def __init__(self, obj): -// ^^^^^^^^ definition(Field) scip-ctags SomeAsyncStuffs#__init__(). +// ^^^^^^^^ definition(Method) scip-ctags SomeAsyncStuffs#__init__(). pass def __aiter__(self): -// ^^^^^^^^^ definition(Field) scip-ctags SomeAsyncStuffs#__aiter__(). +// ^^^^^^^^^ definition(Method) scip-ctags SomeAsyncStuffs#__aiter__(). pass async def __anext__(self): -// ^^^^^^^^^ definition(Field) scip-ctags SomeAsyncStuffs#__anext__(). +// ^^^^^^^^^ definition(Method) scip-ctags SomeAsyncStuffs#__anext__(). pass def does_nothing(f): -// ^^^^^^^^^^^^ definition scip-ctags does_nothing(). +// ^^^^^^^^^^^^ definition(Function) scip-ctags does_nothing(). return f def does_nothingwrapper(*args): -// ^^^^^^^^^^^^^^^^^^^ definition scip-ctags does_nothingwrapper(). +// ^^^^^^^^^^^^^^^^^^^ definition(Function) scip-ctags does_nothingwrapper(). return does_nothing @does_nothing def has_a_name(): -// ^^^^^^^^^^ definition scip-ctags has_a_name(). +// ^^^^^^^^^^ definition(Function) scip-ctags has_a_name(). pass @does_nothing def func02(): pass -// ^^^^^^ definition scip-ctags func02(). +// ^^^^^^ definition(Function) scip-ctags func02(). @does_nothing class ClassWithDecorators(object): -// ^^^^^^^^^^^^^^^^^^^ definition scip-ctags ClassWithDecorators# +// ^^^^^^^^^^^^^^^^^^^ definition(Class) scip-ctags ClassWithDecorators# @staticmethod def static_method(): -// ^^^^^^^^^^^^^ definition(Field) scip-ctags ClassWithDecorators#static_method(). +// ^^^^^^^^^^^^^ definition(Method) scip-ctags ClassWithDecorators#static_method(). print("hello") @classmethod def class_method(cls): -// ^^^^^^^^^^^^ definition(Field) scip-ctags ClassWithDecorators#class_method(). +// ^^^^^^^^^^^^ definition(Method) scip-ctags ClassWithDecorators#class_method(). print("hi from %s" % cls.__name__) @does_nothingwrapper(1, 2, 3) @@ -93,7 +93,7 @@ expression: dumped @ staticmethod @does_nothing def prints_something(): -// ^^^^^^^^^^^^^^^^ definition(Field) scip-ctags ClassWithDecorators#prints_something(). +// ^^^^^^^^^^^^^^^^ definition(Method) scip-ctags ClassWithDecorators#prints_something(). print("something") diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_python-repo-comp.py.snap b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_python-repo-comp.py.snap index a50321612ff4..927241779012 100644 --- a/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_python-repo-comp.py.snap +++ b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_python-repo-comp.py.snap @@ -25,7 +25,7 @@ expression: dumped # A custom socket for the sock parameter to RemoteCollector's allows one to # specify e.g. a TLS socket. class RemoteCollector: -// ^^^^^^^^^^^^^^^ definition scip-ctags RemoteCollector# +// ^^^^^^^^^^^^^^^ definition(Class) scip-ctags RemoteCollector# # sock is literally the socket that is used to communicate with the remote # collector. sock = None @@ -35,19 +35,19 @@ expression: dumped // ^^^^^^ definition scip-ctags RemoteCollector#_debug. def __init__(self, sock=None, debug=False): -// ^^^^^^^^ definition(Field) scip-ctags RemoteCollector#__init__(). +// ^^^^^^^^ definition(Method) scip-ctags RemoteCollector#__init__(). self.sock = sock self._debug = debug def _log(self, *args): -// ^^^^ definition(Field) scip-ctags RemoteCollector#_log(). +// ^^^^ definition(Method) scip-ctags RemoteCollector#_log(). if self._debug: print "appdash: %s" % (" ".join(args)) # connect connects the underlying socket to the given address, waiting at # max for the given timeout before raising an exception. def connect(self, host="localhost", port=7701, timeout=10): -// ^^^^^^^ definition(Field) scip-ctags RemoteCollector#connect(). +// ^^^^^^^ definition(Method) scip-ctags RemoteCollector#connect(). # Use the given socket, or create a new one. if self.sock is None: self.sock = socket.create_connection((host, port), timeout=timeout) @@ -60,7 +60,7 @@ expression: dumped # function does not return until all have been sent out or an exception has # occured (e.g. disconnection). def collect(self, spanID, *annotations): -// ^^^^^^^ definition(Field) scip-ctags RemoteCollector#collect(). +// ^^^^^^^ definition(Method) scip-ctags RemoteCollector#collect(). self._log("collecting", str(len(annotations)), "annotations for", str(spanID)) packet = encode._collect(spanID, *annotations) buf = encode._msg(packet) @@ -74,7 +74,7 @@ expression: dumped # close closes the underlying socket. def close(self): -// ^^^^^ definition(Field) scip-ctags RemoteCollector#close(). +// ^^^^^ definition(Method) scip-ctags RemoteCollector#close(). self.sock.close() self.sock = None diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_ruby-globals.rb.snap b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_ruby-globals.rb.snap new file mode 100644 index 000000000000..32f7e79273c3 --- /dev/null +++ b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__scip_snapshot_ruby-globals.rb.snap @@ -0,0 +1,101 @@ +--- +source: crates/scip-syntax/src/lib.rs +expression: dumped +--- + SOME_CONSTANT = 2.718 +//^^^^^^^^^^^^^ definition(Constant) scip-ctags SOME_CONSTANT. + + if true + a = 1 + elsif false + b = 2 + else + c = 3 + end + + (1..5).each do |counter| + z = 3 + end + + for counter in 1..5 + y = 10 + end + + counter = 1 +//^^^^^^^ definition scip-ctags counter. + while counter <= 5 do + no = true + counter += 1 + end + + begin + raise NoMemoryError, 'Z.' + rescue NoMemoryError => exception_variable + puts 'A', exception_variable + rescue RuntimeError => other_exception_variable + puts 'K' + else + puts 'L' + ensure + puts 'O' + end + + grade = 42 +//^^^^^ definition scip-ctags grade. + case grade + when 0.100 + shouldntgetcaptured = true + puts 'you got a grade i guess' + end + + module MyModule +// ^^^^^^^^ definition(Module) scip-ctags MyModule/ + def self.abc(base) +// ^^^ definition(SingletonMethod) scip-ctags MyModule/abc(). + end + + class MyClass +// ^^^^^^^ definition(Class) scip-ctags MyModule/MyClass# + def yay +// ^^^ definition(Method) scip-ctags MyModule/MyClass#yay(). + end + + def self.woo(base) +// ^^^ definition(SingletonMethod) scip-ctags MyModule/MyClass#woo(). + end + end + end + + class Foo +// ^^^ definition(Class) scip-ctags Foo# + attr_accessor :bar +// ^^^^ definition(Accessor) scip-ctags Foo#`bar=`(). +// ^^^^ definition(Accessor) scip-ctags Foo#bar(). + attr_reader :baz +// ^^^^ definition(Getter) scip-ctags Foo#baz(). + attr_writer :qux +// ^^^^ definition(Setter) scip-ctags Foo#`qux=`(). + end + + class Aliased +// ^^^^^^^ definition(Class) scip-ctags Aliased# + def bar +// ^^^ definition(Method) scip-ctags Aliased#bar(). + end + + alias_method :baz, :bar +// ^^^^ definition(MethodAlias) scip-ctags Aliased#baz(). + end + + class Parental +// ^^^^^^^^ definition(Class) scip-ctags Parental# + def parental_func() +// ^^^^^^^^^^^^^ definition(Method) scip-ctags Parental#parental_func(). + end + end + + class Composed +// ^^^^^^^^ definition(Class) scip-ctags Composed# + include Parental + end + diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__tags_snapshot_globals.cs.snap b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__tags_snapshot_globals.cs.snap new file mode 100644 index 000000000000..4dfff617ec6e --- /dev/null +++ b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__tags_snapshot_globals.cs.snap @@ -0,0 +1,40 @@ +--- +source: crates/scip-syntax/src/lib.rs +expression: "String::from_utf8_lossy(buf_writer.buffer())" +--- +{"_type":"tag","name":"Longer.Namespace","path":"globals.cs","language":"c_sharp","line":5,"kind":"namespace","scope":null} +{"_type":"tag","name":"Class","path":"globals.cs","language":"c_sharp","line":7,"kind":"class","scope":"Longer.Namespace"} +{"_type":"tag","name":"Coords","path":"globals.cs","language":"c_sharp","line":34,"kind":"struct","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"ToString","path":"globals.cs","language":"c_sharp","line":45,"kind":"method","scope":"Longer.Namespace.Class.Coords"} +{"_type":"tag","name":"Y","path":"globals.cs","language":"c_sharp","line":43,"kind":"property","scope":"Longer.Namespace.Class.Coords"} +{"_type":"tag","name":"X","path":"globals.cs","language":"c_sharp","line":42,"kind":"property","scope":"Longer.Namespace.Class.Coords"} +{"_type":"tag","name":"Coords","path":"globals.cs","language":"c_sharp","line":36,"kind":"constructor","scope":"Longer.Namespace.Class.Coords"} +{"_type":"tag","name":"Swag","path":"globals.cs","language":"c_sharp","line":57,"kind":"enum","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"Pants","path":"globals.cs","language":"c_sharp","line":62,"kind":"enumMember","scope":"Longer.Namespace.Class.Swag"} +{"_type":"tag","name":"Socks","path":"globals.cs","language":"c_sharp","line":61,"kind":"enumMember","scope":"Longer.Namespace.Class.Swag"} +{"_type":"tag","name":"Sweater","path":"globals.cs","language":"c_sharp","line":60,"kind":"enumMember","scope":"Longer.Namespace.Class.Swag"} +{"_type":"tag","name":"Shirt","path":"globals.cs","language":"c_sharp","line":59,"kind":"enumMember","scope":"Longer.Namespace.Class.Swag"} +{"_type":"tag","name":"ZigFeatureSet","path":"globals.cs","language":"c_sharp","line":67,"kind":"enum","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"FullPackage","path":"globals.cs","language":"c_sharp","line":75,"kind":"enumMember","scope":"Longer.Namespace.Class.ZigFeatureSet"} +{"_type":"tag","name":"CoolCommunity","path":"globals.cs","language":"c_sharp","line":74,"kind":"enumMember","scope":"Longer.Namespace.Class.ZigFeatureSet"} +{"_type":"tag","name":"BuildSystem","path":"globals.cs","language":"c_sharp","line":73,"kind":"enumMember","scope":"Longer.Namespace.Class.ZigFeatureSet"} +{"_type":"tag","name":"Comptime","path":"globals.cs","language":"c_sharp","line":72,"kind":"enumMember","scope":"Longer.Namespace.Class.ZigFeatureSet"} +{"_type":"tag","name":"Errors","path":"globals.cs","language":"c_sharp","line":71,"kind":"enumMember","scope":"Longer.Namespace.Class.ZigFeatureSet"} +{"_type":"tag","name":"None","path":"globals.cs","language":"c_sharp","line":70,"kind":"enumMember","scope":"Longer.Namespace.Class.ZigFeatureSet"} +{"_type":"tag","name":"Syntax","path":"globals.cs","language":"c_sharp","line":78,"kind":"method","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"SourcegraphSwag","path":"globals.cs","language":"c_sharp","line":65,"kind":"field","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"LambdaFunction","path":"globals.cs","language":"c_sharp","line":55,"kind":"property","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"PublicImplicitGetterSetter","path":"globals.cs","language":"c_sharp","line":53,"kind":"property","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"_speed","path":"globals.cs","language":"c_sharp","line":52,"kind":"field","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"Changed","path":"globals.cs","language":"c_sharp","line":50,"kind":"event","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"MyDelegate","path":"globals.cs","language":"c_sharp","line":48,"kind":"delegate","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"ImplicitGetterPrivateSetter","path":"globals.cs","language":"c_sharp","line":28,"kind":"property","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"ImplicitGetterSetter","path":"globals.cs","language":"c_sharp","line":22,"kind":"property","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"_val","path":"globals.cs","language":"c_sharp","line":20,"kind":"field","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"ExplicitGetterSetter","path":"globals.cs","language":"c_sharp","line":9,"kind":"property","scope":"Longer.Namespace.Class"} +{"_type":"tag","name":"OneClass","path":"globals.cs","language":"c_sharp","line":82,"kind":"namespace","scope":null} +{"_type":"tag","name":"TheClass","path":"globals.cs","language":"c_sharp","line":84,"kind":"class","scope":"OneClass"} +{"_type":"tag","name":"Text","path":"globals.cs","language":"c_sharp","line":87,"kind":"property","scope":"OneClass.TheClass"} +{"_type":"tag","name":"ClickAction","path":"globals.cs","language":"c_sharp","line":86,"kind":"property","scope":"OneClass.TheClass"} +{"_type":"tag","name":"SurprisinglyValid","path":"globals.cs","language":"c_sharp","line":3,"kind":"function","scope":null} + diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__tags_snapshot_globals.py.snap b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__tags_snapshot_globals.py.snap new file mode 100644 index 000000000000..ecc662705083 --- /dev/null +++ b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__tags_snapshot_globals.py.snap @@ -0,0 +1,29 @@ +--- +source: crates/scip-syntax/src/lib.rs +expression: "String::from_utf8_lossy(buf_writer.buffer())" +--- +{"_type":"tag","name":"Bruh","path":"globals.py","language":"python","line":6,"kind":"class","scope":null} +{"_type":"tag","name":"dab","path":"globals.py","language":"python","line":11,"kind":"method","scope":"Bruh"} +{"_type":"tag","name":"__init__","path":"globals.py","language":"python","line":8,"kind":"method","scope":"Bruh"} +{"_type":"tag","name":"a","path":"globals.py","language":"python","line":6,"kind":"variable","scope":"Bruh"} +{"_type":"tag","name":"SomeAsyncStuffs","path":"globals.py","language":"python","line":37,"kind":"class","scope":null} +{"_type":"tag","name":"__anext__","path":"globals.py","language":"python","line":43,"kind":"method","scope":"SomeAsyncStuffs"} +{"_type":"tag","name":"__aiter__","path":"globals.py","language":"python","line":40,"kind":"method","scope":"SomeAsyncStuffs"} +{"_type":"tag","name":"__init__","path":"globals.py","language":"python","line":37,"kind":"method","scope":"SomeAsyncStuffs"} +{"_type":"tag","name":"ClassWithDecorators","path":"globals.py","language":"python","line":61,"kind":"class","scope":null} +{"_type":"tag","name":"prints_something","path":"globals.py","language":"python","line":73,"kind":"method","scope":"ClassWithDecorators"} +{"_type":"tag","name":"class_method","path":"globals.py","language":"python","line":66,"kind":"method","scope":"ClassWithDecorators"} +{"_type":"tag","name":"static_method","path":"globals.py","language":"python","line":62,"kind":"method","scope":"ClassWithDecorators"} +{"_type":"tag","name":"bar","path":"globals.py","language":"python","line":80,"kind":"variable","scope":null} +{"_type":"tag","name":"foo","path":"globals.py","language":"python","line":80,"kind":"variable","scope":null} +{"_type":"tag","name":"baz","path":"globals.py","language":"python","line":77,"kind":"variable","scope":null} +{"_type":"tag","name":"bar","path":"globals.py","language":"python","line":77,"kind":"variable","scope":null} +{"_type":"tag","name":"foo","path":"globals.py","language":"python","line":77,"kind":"variable","scope":null} +{"_type":"tag","name":"func02","path":"globals.py","language":"python","line":57,"kind":"function","scope":null} +{"_type":"tag","name":"has_a_name","path":"globals.py","language":"python","line":53,"kind":"function","scope":null} +{"_type":"tag","name":"does_nothingwrapper","path":"globals.py","language":"python","line":49,"kind":"function","scope":null} +{"_type":"tag","name":"does_nothing","path":"globals.py","language":"python","line":46,"kind":"function","scope":null} +{"_type":"tag","name":"my_function","path":"globals.py","language":"python","line":32,"kind":"function","scope":null} +{"_type":"tag","name":"should_show_ifs","path":"globals.py","language":"python","line":19,"kind":"variable","scope":null} +{"_type":"tag","name":"bruh","path":"globals.py","language":"python","line":3,"kind":"variable","scope":null} + diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__tags_snapshot_go-globals.go.snap b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__tags_snapshot_go-globals.go.snap index fc21d28b608c..f2982df74200 100644 --- a/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__tags_snapshot_go-globals.go.snap +++ b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__tags_snapshot_go-globals.go.snap @@ -19,6 +19,6 @@ expression: "String::from_utf8_lossy(buf_writer.buffer())" {"_type":"tag","name":"diffPath","path":"go-globals.go","language":"go","line":56,"kind":"variable","scope":"multierror"} {"_type":"tag","name":"Wait","path":"go-globals.go","language":"go","line":48,"kind":"method","scope":"multierror.Group"} {"_type":"tag","name":"Go","path":"go-globals.go","language":"go","line":32,"kind":"method","scope":"multierror.Group"} -{"_type":"tag","name":"TypeAlias","path":"go-globals.go","language":"go","line":26,"kind":"typealias","scope":"multierror"} -{"_type":"tag","name":"TypeDef","path":"go-globals.go","language":"go","line":25,"kind":"typealias","scope":"multierror"} +{"_type":"tag","name":"TypeAlias","path":"go-globals.go","language":"go","line":26,"kind":"typeAlias","scope":"multierror"} +{"_type":"tag","name":"TypeDef","path":"go-globals.go","language":"go","line":25,"kind":"typeAlias","scope":"multierror"} diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__tags_snapshot_ruby-globals.rb.snap b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__tags_snapshot_ruby-globals.rb.snap new file mode 100644 index 000000000000..441b9ee0641f --- /dev/null +++ b/docker-images/syntax-highlighter/crates/scip-syntax/src/snapshots/scip_syntax__test__tags_snapshot_ruby-globals.rb.snap @@ -0,0 +1,24 @@ +--- +source: crates/scip-syntax/src/lib.rs +expression: "String::from_utf8_lossy(buf_writer.buffer())" +--- +{"_type":"tag","name":"MyModule","path":"ruby-globals.rb","language":"ruby","line":44,"kind":"module","scope":null} +{"_type":"tag","name":"MyClass","path":"ruby-globals.rb","language":"ruby","line":48,"kind":"class","scope":"MyModule"} +{"_type":"tag","name":"woo","path":"ruby-globals.rb","language":"ruby","line":52,"kind":"singletonMethod","scope":"MyModule.MyClass"} +{"_type":"tag","name":"yay","path":"ruby-globals.rb","language":"ruby","line":49,"kind":"method","scope":"MyModule.MyClass"} +{"_type":"tag","name":"abc","path":"ruby-globals.rb","language":"ruby","line":45,"kind":"singletonMethod","scope":"MyModule"} +{"_type":"tag","name":"Foo","path":"ruby-globals.rb","language":"ruby","line":57,"kind":"class","scope":null} +{"_type":"tag","name":"qux=","path":"ruby-globals.rb","language":"ruby","line":60,"kind":"setter","scope":"Foo"} +{"_type":"tag","name":"baz","path":"ruby-globals.rb","language":"ruby","line":59,"kind":"getter","scope":"Foo"} +{"_type":"tag","name":"bar=","path":"ruby-globals.rb","language":"ruby","line":58,"kind":"accessor","scope":"Foo"} +{"_type":"tag","name":"bar","path":"ruby-globals.rb","language":"ruby","line":58,"kind":"accessor","scope":"Foo"} +{"_type":"tag","name":"Aliased","path":"ruby-globals.rb","language":"ruby","line":63,"kind":"class","scope":null} +{"_type":"tag","name":"baz","path":"ruby-globals.rb","language":"ruby","line":67,"kind":"methodAlias","scope":"Aliased"} +{"_type":"tag","name":"bar","path":"ruby-globals.rb","language":"ruby","line":64,"kind":"method","scope":"Aliased"} +{"_type":"tag","name":"Parental","path":"ruby-globals.rb","language":"ruby","line":70,"kind":"class","scope":null} +{"_type":"tag","name":"parental_func","path":"ruby-globals.rb","language":"ruby","line":71,"kind":"method","scope":"Parental"} +{"_type":"tag","name":"Composed","path":"ruby-globals.rb","language":"ruby","line":75,"kind":"class","scope":null} +{"_type":"tag","name":"grade","path":"ruby-globals.rb","language":"ruby","line":37,"kind":"variable","scope":null} +{"_type":"tag","name":"counter","path":"ruby-globals.rb","language":"ruby","line":19,"kind":"variable","scope":null} +{"_type":"tag","name":"SOME_CONSTANT","path":"ruby-globals.rb","language":"ruby","line":1,"kind":"constant","scope":null} + diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/src/ts_scip.rs b/docker-images/syntax-highlighter/crates/scip-syntax/src/ts_scip.rs index 8b4d41937923..e352ac99d160 100644 --- a/docker-images/syntax-highlighter/crates/scip-syntax/src/ts_scip.rs +++ b/docker-images/syntax-highlighter/crates/scip-syntax/src/ts_scip.rs @@ -21,12 +21,26 @@ pub fn captures_to_kind(kind: &Option<&String>) -> symbol_information::Kind { use symbol_information::Kind::*; kind.map_or(UnspecifiedKind, |kind| match kind.as_str() { + "kind.accessor" => Accessor, + "kind.class" => Class, "kind.constant" => Constant, + "kind.constructor" => Constructor, + "kind.delegate" => Delegate, + "kind.enum" => Enum, + "kind.enummember" => EnumMember, + "kind.event" => Event, "kind.field" => Field, "kind.function" => Function, + "kind.getter" => Getter, "kind.interface" => Interface, "kind.method" => Method, + "kind.methodalias" => MethodAlias, + "kind.module" => Module, + "kind.namespace" => Namespace, "kind.package" => Package, + "kind.property" => Property, + "kind.setter" => Setter, + "kind.singletonmethod" => SingletonMethod, "kind.struct" => Struct, "kind.typealias" => TypeAlias, _ => UnspecifiedKind, @@ -37,14 +51,28 @@ pub fn symbol_kind_to_ctags_kind(kind: &symbol_information::Kind) -> Option<&'st use symbol_information::Kind::*; match kind { + Accessor => Some("accessor"), + Class => Some("class"), Constant => Some("constant"), + Constructor => Some("constructor"), + Delegate => Some("delegate"), + Enum => Some("enum"), + EnumMember => Some("enumMember"), + Event => Some("event"), Field => Some("field"), Function => Some("function"), + Getter => Some("getter"), Interface => Some("interface"), Method => Some("method"), + MethodAlias => Some("methodAlias"), + Module => Some("module"), + Namespace => Some("namespace"), Package => Some("package"), + Property => Some("property"), + Setter => Some("setter"), + SingletonMethod => Some("singletonMethod"), Struct => Some("struct"), - TypeAlias => Some("typealias"), + TypeAlias => Some("typeAlias"), _ => None, } } diff --git a/docker-images/syntax-highlighter/crates/scip-syntax/testdata/ruby-globals.rb b/docker-images/syntax-highlighter/crates/scip-syntax/testdata/ruby-globals.rb index 2797aa8a44d6..3ac5bb4bc2f8 100644 --- a/docker-images/syntax-highlighter/crates/scip-syntax/testdata/ruby-globals.rb +++ b/docker-images/syntax-highlighter/crates/scip-syntax/testdata/ruby-globals.rb @@ -1,3 +1,5 @@ +SOME_CONSTANT = 2.718 + if true a = 1 elsif false