From 58b7cac8fc14c92b0677c542610d8738c373fa81 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sat, 20 Jan 2024 09:13:50 -0500 Subject: [PATCH] Add test cases for nested record field access Connects #81 --- test/corpus/expressions.txt | 15 +++++++++++++++ test/highlight/records.gleam | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt index eab6de7cd..bb6578166 100644 --- a/test/corpus/expressions.txt +++ b/test/corpus/expressions.txt @@ -145,3 +145,18 @@ panic as { "Hello, " <> "world!" } (quoted_content)) (string (quoted_content)))))) + +================================================================================ +Nested field access +================================================================================ + +config.connection.host + +-------------------------------------------------------------------------------- + +(source_file + (field_access + (field_access + (identifier) + (label)) + (label))) diff --git a/test/highlight/records.gleam b/test/highlight/records.gleam index 252fac0ee..bf9a77ecf 100644 --- a/test/highlight/records.gleam +++ b/test/highlight/records.gleam @@ -12,3 +12,9 @@ pub fn new(name: String) { // ^ property // ^ variable.parameter } + +let config = Config() +config.connection.host +// ^ variable +// ^ property +// ^ property