diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2021-12-26 21:25:22 +0100 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2021-12-26 21:25:22 +0100 |
| commit | f0a3c8ff10c6a8b9833ce50c8a34e6d2a23bf216 (patch) | |
| tree | a9fb52f42b3e35bfc8111325350f46b1775a365f | |
| parent | 0669cf27fbb9ff3576a6a98c7c690b4f2259f504 (diff) | |
Forgot to clone string odin_command
| -rw-r--r-- | src/server/check.odin | 12 | ||||
| -rw-r--r-- | src/server/requests.odin | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/server/check.odin b/src/server/check.odin index 2be55f1..37a7691 100644 --- a/src/server/check.odin +++ b/src/server/check.odin @@ -19,8 +19,7 @@ import "core:text/scanner" import "shared:common" when ODIN_OS == "windows" { - check :: proc(uri: common.Uri, writer: ^Writer) { - + check :: proc(uri: common.Uri, writer: ^Writer, config: ^common.Config) { data := make([]byte, mem.kilobytes(10), context.temp_allocator); buffer: []byte; @@ -37,13 +36,14 @@ when ODIN_OS == "windows" { } command: string; - - if common.config.odin_command != "" { - command = common.config.odin_command; + + if config.odin_command != "" { + command = config.odin_command; + } else { command = "odin"; } - + if code, ok, buffer = common.run_executable(fmt.tprintf("%v check %s %s -no-entry-point", command, path.dir(uri.path, context.temp_allocator), strings.to_string(collection_builder)), &data); !ok { log.errorf("Odin check failed with code %v for file %v", code, uri.path); return; diff --git a/src/server/requests.odin b/src/server/requests.odin index e67f7b4..f5d7a24 100644 --- a/src/server/requests.odin +++ b/src/server/requests.odin @@ -418,7 +418,7 @@ request_initialize :: proc (task: ^common.Task) { config.verbose = ols_config.verbose; config.file_log = ols_config.file_log; config.formatter = ols_config.formatter; - config.odin_command = ols_config.odin_command; + config.odin_command = strings.clone(ols_config.odin_command, context.allocator); for p in ols_config.collections { @@ -943,7 +943,7 @@ notification_did_save :: proc (task: ^common.Task) { log.errorf("failed to collect symbols on save %v", ret); } - check(uri, writer); + check(uri, writer, config); } request_semantic_token_full :: proc (task: ^common.Task) { |