aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorryuukk <44361234+ryuukk@users.noreply.github.com>2023-06-26 18:07:16 +0200
committerGitHub <noreply@github.com>2023-06-26 18:07:16 +0200
commitc597e10685ecf4fb71a7cc449d89ebbc5af47227 (patch)
tree725e506e8908b72cd74584e248cf2622ba3bdc72 /src/server
parent9120feed29abfda747dd8130d9d30d1e4145f58d (diff)
Copy collections from newly received config
Diffstat (limited to 'src/server')
-rw-r--r--src/server/requests.odin25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/server/requests.odin b/src/server/requests.odin
index 3804e51..4b5c6de 100644
--- a/src/server/requests.odin
+++ b/src/server/requests.odin
@@ -433,7 +433,22 @@ read_ols_initialize_options :: proc(
config.enable_inlay_hints =
ols_config.enable_inlay_hints.(bool) or_else config.enable_inlay_hints
+ // copy collections from new config
+ when ODIN_OS == .Windows {
+ for it in ols_config.collections {
+ forward, _ := filepath.to_slash(
+ common.get_case_sensitive_path(it.path),
+ context.temp_allocator,
+ )
+ config.collections[it.name] = strings.clone(forward, context.allocator)
+ }
+ } else {
+ for it in ols_config.collections {
+ config.collections[it.name] = strings.clone(it.path, context.allocator)
+ }
+ }
+ // ensure that core/vendor collections are provided
odin_core_env := os.get_env("ODIN_ROOT", context.temp_allocator)
if odin_core_env == "" {
@@ -463,16 +478,6 @@ read_ols_initialize_options :: proc(
allocator = context.allocator,
)
}
-
- when ODIN_OS == .Windows {
- for k, v in config.collections {
- forward, _ := filepath.to_slash(
- common.get_case_sensitive_path(v),
- context.temp_allocator,
- )
- config.collections[k] = strings.clone(forward, context.allocator)
- }
- }
}
request_initialize :: proc(