From 4615c41f7569df0d2b4f98afdd0fb50cf6f29fba Mon Sep 17 00:00:00 2001 From: FourteenBrush <74827262+FourteenBrush@users.noreply.github.com> Date: Sat, 21 Sep 2024 16:53:36 +0200 Subject: Add #caller_expression support --- src/server/completion.odin | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/completion.odin b/src/server/completion.odin index 1b7249d..b456392 100644 --- a/src/server/completion.odin +++ b/src/server/completion.odin @@ -180,6 +180,7 @@ DIRECTIVE_NAME_LIST :: []string { "caller_location", /* call directives */ "location", + "caller_expression", "exists", "load", "load_directory", -- cgit v1.2.3 From e0f4abc82b9ad79677df808d23becc2d9978420b Mon Sep 17 00:00:00 2001 From: FourteenBrush <74827262+FourteenBrush@users.noreply.github.com> Date: Thu, 26 Sep 2024 14:29:26 +0200 Subject: Add `#reverse` directive --- src/server/completion.odin | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/completion.odin b/src/server/completion.odin index b456392..c085881 100644 --- a/src/server/completion.odin +++ b/src/server/completion.odin @@ -178,6 +178,7 @@ DIRECTIVE_NAME_LIST :: []string { "line", "procedure", "caller_location", + "reverse", /* call directives */ "location", "caller_expression", -- cgit v1.2.3 From f091b9ac6ee75a6be1473d7d3ee73ad8fb4e1a60 Mon Sep 17 00:00:00 2001 From: FourteenBrush <74827262+FourteenBrush@users.noreply.github.com> Date: Sat, 28 Sep 2024 11:38:57 +0200 Subject: Fixes #508 --- src/odin/printer/printer.odin | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/odin/printer/printer.odin b/src/odin/printer/printer.odin index 8fb8baf..2789da6 100644 --- a/src/odin/printer/printer.odin +++ b/src/odin/printer/printer.odin @@ -129,13 +129,18 @@ build_disabled_lines_info :: proc(p: ^Printer) { for group in p.comments { for comment in group.list { - comment_text, _ := strings.replace_all(comment.text[:], " ", "", context.temp_allocator) - if strings.contains(comment_text, "//odinfmt:disable") { + if !strings.starts_with(comment.text, "//") do continue + comment_text := strings.trim_left_space(comment.text[len("//"):]) + + if !strings.starts_with(comment_text, "odinfmt:") do continue + action := strings.trim_space(comment_text[len("odinfmt:"):]) + + if action == "disable" { found_disable = true empty = true disable_position = comment.pos - } else if strings.contains(comment_text, "//odinfmt:enable") && found_disable { + } else if found_disable && action == "enable" { begin := disable_position.offset - (comment.pos.column - 1) end := comment.pos.offset + len(comment.text) @@ -146,7 +151,7 @@ build_disabled_lines_info :: proc(p: ^Printer) { empty = empty, } - for line := disable_position.line; line <= comment.pos.line; line += 1 { + for line in disable_position.line.. Date: Sat, 28 Sep 2024 12:43:24 +0200 Subject: Whoops --- src/odin/printer/printer.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/odin/printer/printer.odin b/src/odin/printer/printer.odin index 2789da6..74f5853 100644 --- a/src/odin/printer/printer.odin +++ b/src/odin/printer/printer.odin @@ -151,7 +151,7 @@ build_disabled_lines_info :: proc(p: ^Printer) { empty = empty, } - for line in disable_position.line..