From 90a41ff247b050228e1a6e1a9fe0486948ca6b9e Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Sun, 10 Aug 2025 14:39:49 +0200 Subject: Fix compiler issues with contextless --- src/server/check.odin | 2 +- src/server/completion.odin | 4 +++- src/server/hover.odin | 6 +----- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/server') diff --git a/src/server/check.odin b/src/server/check.odin index 4b7da85..ea68066 100644 --- a/src/server/check.odin +++ b/src/server/check.odin @@ -20,7 +20,7 @@ import "core:thread" import "src:common" //Store uris we have reported on since last save. We use this to clear them on next save. -uris_reported := make([dynamic]string) +uris_reported: [dynamic]string Json_Error :: struct { type: string, diff --git a/src/server/completion.odin b/src/server/completion.odin index ae9d984..25018df 100644 --- a/src/server/completion.odin +++ b/src/server/completion.odin @@ -14,6 +14,7 @@ import "core:slice" import "core:sort" import "core:strconv" import "core:strings" +import "base:runtime" import "src:common" @@ -397,7 +398,8 @@ DIRECTIVE_NAME_LIST :: []string { completion_items_directives: []CompletionResult @(init) -_init_completion_items_directives :: proc() { +_init_completion_items_directives :: proc "contextless" () { + context = runtime.default_context() completion_items_directives = slice.mapper(DIRECTIVE_NAME_LIST, proc(name: string) -> CompletionResult { return CompletionResult{ completion_item = CompletionItem{ diff --git a/src/server/hover.odin b/src/server/hover.odin index 364585d..4719685 100644 --- a/src/server/hover.odin +++ b/src/server/hover.odin @@ -48,11 +48,7 @@ write_hover_content :: proc(ast_context: ^AstContext, symbol: Symbol) -> MarkupC } builtin_identifier_hover: map[string]string = { - "context" = fmt.aprintf( - "```odin\n%v\n```\n%v", - "runtime.context: Context", - "This context variable is local to each scope and is implicitly passed by pointer to any procedure call in that scope (if the procedure has the Odin calling convention).", - ), + "context" = "```odin\nruntime.context: Context\n```\nThis context variable is local to each scope and is implicitly passed by pointer to any procedure call in that scope (if the procedure has the Odin calling convention).", } -- cgit v1.2.3