Skip to content

Commit

Permalink
Fix issue with maybe(string) in OlsConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielGavin committed Sep 19, 2023
1 parent 89ebef8 commit 59f033f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
23 changes: 15 additions & 8 deletions src/server/requests.odin
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,21 @@ read_ols_initialize_options :: proc(
config.file_log = ols_config.file_log.(bool) or_else config.file_log
config.enable_rename =
ols_config.enable_references.(bool) or_else config.enable_rename
config.odin_command = strings.clone(
ols_config.odin_command.(string) or_else config.odin_command,
context.allocator,
)
config.checker_args = strings.clone(
ols_config.checker_args.(string) or_else config.checker_args,
context.allocator,
)

if ols_config.odin_command != "" {
config.odin_command = strings.clone(
ols_config.odin_command,
context.allocator,
)
}

if ols_config.checker_args != "" {
config.checker_args = strings.clone(
ols_config.checker_args,
context.allocator,
)
}

config.enable_inlay_hints =
ols_config.enable_inlay_hints.(bool) or_else config.enable_inlay_hints
config.enable_fake_method =
Expand Down
4 changes: 2 additions & 2 deletions src/server/types.odin
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ OlsConfig :: struct {
disable_parser_errors: Maybe(bool),
verbose: Maybe(bool),
file_log: Maybe(bool),
odin_command: Maybe(string),
checker_args: Maybe(string),
odin_command: string,
checker_args: string,
}

OlsConfigCollection :: struct {
Expand Down

0 comments on commit 59f033f

Please sign in to comment.