aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordoongjohn <doongjohn@gmail.com>2025-10-29 23:26:36 +0900
committerdoongjohn <doongjohn@gmail.com>2025-10-29 23:26:50 +0900
commit69d6b1d88b61c3f4d73d05c398272fc692853262 (patch)
tree9eb81eaa57002b4b51aa6c94696687c87b979e6b /src
parent12b9b60c0e01793db35c98a9bc61a95678694caa (diff)
Change config load order and fix odin_core_env detection.
Diffstat (limited to 'src')
-rw-r--r--src/server/requests.odin12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/server/requests.odin b/src/server/requests.odin
index 98347d5..82d0ae2 100644
--- a/src/server/requests.odin
+++ b/src/server/requests.odin
@@ -542,8 +542,10 @@ read_ols_initialize_options :: proc(config: ^common.Config, ols_config: OlsConfi
}
}
- if abs_core_env, ok := filepath.abs(odin_core_env, context.temp_allocator); ok {
- odin_core_env = abs_core_env
+ if odin_core_env != "" {
+ if abs_core_env, ok := filepath.abs(odin_core_env, context.temp_allocator); ok {
+ odin_core_env = abs_core_env
+ }
}
}
}
@@ -676,9 +678,6 @@ request_initialize :: proc(
}
if uri, ok := common.parse_uri(project_uri, context.temp_allocator); ok {
- // Apply the requested ols config.
- read_ols_initialize_options(config, initialize_params.initializationOptions, uri)
-
// Apply the global ols config.
global_ols_config_path := path.join(
elems = {filepath.dir(os.args[0], context.temp_allocator), "ols.json"},
@@ -686,6 +685,9 @@ request_initialize :: proc(
)
read_ols_config(global_ols_config_path, config, uri)
+ // Apply the requested ols config.
+ read_ols_initialize_options(config, initialize_params.initializationOptions, uri)
+
// Apply ols.json config.
ols_config_path := path.join(elems = {uri.path, "ols.json"}, allocator = context.temp_allocator)
read_ols_config(ols_config_path, config, uri)