diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2024-06-28 23:48:34 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2024-06-28 23:48:34 +0200 |
| commit | 607722dcb9624d07e9f4513bf706e24fed06c5d3 (patch) | |
| tree | 54b8dbe19f8bbacace5100fa2ea5d36ddb07fd4b | |
| parent | cd46aa86777d203ddc67f31eaa60ee763cef3d87 (diff) | |
Support specifying the os with profile.
| -rw-r--r-- | src/server/requests.odin | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/server/requests.odin b/src/server/requests.odin index 8af1141..0fd73ba 100644 --- a/src/server/requests.odin +++ b/src/server/requests.odin @@ -477,23 +477,22 @@ read_ols_initialize_options :: proc( ) } } + + config.profile.os = strings.clone(profile.os) + + break } } + if config.profile.os == "" { + config.profile.os = os_enum_to_string[ODIN_OS] + } + config.checker_targets = slice.clone( ols_config.checker_targets, context.allocator, ) - found_target := false - - for target in config.checker_targets { - if ODIN_OS in os_enum_to_string { - found_target = true - } - } - - config.enable_inlay_hints = ols_config.enable_inlay_hints.(bool) or_else config.enable_inlay_hints config.enable_fake_method = @@ -558,7 +557,9 @@ read_ols_initialize_options :: proc( context.temp_allocator, ) - config.collections[strings.clone(it.name)] = strings.clone(slashed_path) + config.collections[strings.clone(it.name)] = strings.clone( + slashed_path, + ) } else { log.errorf( "Failed to find absolute address of collection: %v", @@ -743,7 +744,7 @@ request_initialize :: proc( if uri, ok := common.parse_uri(project_uri, context.temp_allocator); ok { global_ols_config_path := path.join( - elems = { + elems = { filepath.dir(os.args[0], context.temp_allocator), "ols.json", }, |