aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-10-27 17:59:51 +0100
committerDanielGavin <danielgavin5@hotmail.com>2024-10-27 17:59:51 +0100
commit908ea1b7bee7797c611b6e97fbbd197d5bc4ffa1 (patch)
tree7f3d8df874eb6497250411ecfb3e357d55651cc7 /src/server
parentb6bf1f4d909fab8c9b4e5b20271442b165b7e171 (diff)
Check if `shared` exists, if it doesn't then don't save it as collection.
Diffstat (limited to 'src/server')
-rw-r--r--src/server/requests.odin11
-rw-r--r--src/server/symbol.odin4
2 files changed, 9 insertions, 6 deletions
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,
}