aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDamian Tarnawski <gthetarnav@gmail.com>2025-07-04 20:46:43 +0200
committerDamian Tarnawski <gthetarnav@gmail.com>2025-07-04 20:46:43 +0200
commitce13a380a3ca5ff15f866a1719b5bdedd09c2f67 (patch)
tree49a044e8309f21ac23aa9f30ba8ef1a76ba7592f /tests
parentc1f587679b228bacbb2c0ca3ba9f6f45b9dac043 (diff)
Don't add additional space before default param inlay hints.
Diffstat (limited to 'tests')
-rw-r--r--tests/inlay_hints_test.odin30
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/inlay_hints_test.odin b/tests/inlay_hints_test.odin
index 632ed25..0bede69 100644
--- a/tests/inlay_hints_test.odin
+++ b/tests/inlay_hints_test.odin
@@ -25,7 +25,7 @@ ast_inlay_hints_default_parameters :: proc(t: ^testing.T) {
test.expect_inlay_hints(t, &source, {{
position = {5, 15},
kind = .Parameter,
- label = " a := false",
+ label = "a := false",
}, {
position = {5, 15},
kind = .Parameter,
@@ -34,6 +34,34 @@ ast_inlay_hints_default_parameters :: proc(t: ^testing.T) {
}
@(test)
+ast_inlay_hints_default_parameters_after_required :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+
+ my_function :: proc(a: int, b := false, c := 42) {}
+
+ main :: proc() {
+ my_function(1)
+ }
+ `,
+ packages = {},
+ config = {
+ enable_inlay_hints_default_params = true,
+ },
+ }
+
+ test.expect_inlay_hints(t, &source, {{
+ position = {5, 16},
+ kind = .Parameter,
+ label = ", b := false",
+ }, {
+ position = {5, 16},
+ kind = .Parameter,
+ label = ", c := 42",
+ }})
+}
+
+@(test)
ast_inlay_hints_parameters :: proc(t: ^testing.T) {
source := test.Source {
main = `package test