Change constructor tracking to not use type (#29)

pull/315/head
Jonathan Arnett 2022-05-24 15:45:09 +07:00 committed by GitHub
parent aed23b28dd
commit d7861b2a4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

@ -32,10 +32,10 @@
(type_definition
(data_constructors
(data_constructor
name: (constructor_name) @name))) @definition.type
name: (constructor_name) @name))) @definition.constructor
(external_type
(type_name
name: (type_identifier) @name)) @definition.type
(type_identifier) @name @reference.type
(constructor_name) @name @reference.type
(constructor_name) @name @reference.constructor

@ -9,14 +9,14 @@ import gleam/bit_builder
pub type FrameData {
// ^ definition.type
Text(String)
// <- definition.type
// <- definition.constructor
// ^ reference.type
Binary(BitString)
Continuation(BitString)
Ping(BitString)
Pong(BitString)
Close(code: Option(Int), reason: Option(String))
// <- definition.type
// <- definition.constructor
// ^ reference.type
// ^ reference.type
// ^ reference.type
@ -42,7 +42,7 @@ fn encode_frame(frame: Frame) -> bit_builder.BitBuilder {
let opcode =
case frame.data {
Continuation(_) -> <<0x0:size(1)>>
// <- reference.type
// <- reference.constructor
Text(_) -> <<0x1:size(1)>>
Binary(_) -> <<0x2:size(1)>>
// 0x3-7 reserved for future non-control frames

@ -1,6 +1,6 @@
fn record_with_fun_field(record) {
let foo = Bar(baz: fn(x) { x + 1 })
// ^ reference.type
// ^ reference.constructor
foo.baz(41)
record.foobar("hello")