From 908ea1b7bee7797c611b6e97fbbd197d5bc4ffa1 Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Sun, 27 Oct 2024 17:59:51 +0100 Subject: Check if `shared` exists, if it doesn't then don't save it as collection. --- src/server/requests.odin | 11 +++++++---- src/server/symbol.odin | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/requests.odin b/src/server/requests.odin index 769f939..9de82b6 100644 --- a/src/server/requests.odin +++ b/src/server/requests.odin @@ -538,10 +538,13 @@ read_ols_initialize_options :: proc(config: ^common.Config, ols_config: OlsConfi if "shared" not_in config.collections && odin_core_env != "" { forward_path, _ := filepath.to_slash(odin_core_env, context.temp_allocator) - config.collections[strings.clone("shared")] = path.join( - elems = {forward_path, "shared"}, - allocator = context.allocator, - ) + shared_path := path.join(elems = {forward_path, "shared"}, allocator = context.allocator) + + if os.exists(shared_path) { + config.collections[strings.clone("shared")] = shared_path + } else { + delete(shared_path) + } } log.info(config.collections) diff --git a/src/server/symbol.odin b/src/server/symbol.odin index 6769a65..1bed406 100644 --- a/src/server/symbol.odin +++ b/src/server/symbol.odin @@ -38,8 +38,8 @@ SymbolPackageValue :: struct {} SymbolProcedureValue :: struct { return_types: []^ast.Field, arg_types: []^ast.Field, - orig_return_types: []^ast.Field, //If there has been generics, we still store the unaltered version here - orig_arg_types: []^ast.Field, //If there has been generics, we still store the unaltered version here + orig_return_types: []^ast.Field, //When generics have overloaded the types, we store the original version here. + orig_arg_types: []^ast.Field, //When generics have overloaded the types, we store the original version here. generic: bool, } -- cgit v1.2.3