diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2021-01-07 01:02:24 +0100 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2021-01-07 01:02:24 +0100 |
| commit | 81d80fb20341227eb146927e646573aec4f61531 (patch) | |
| tree | 935ff400cbac2ffffa98a71338d7a4e75aceb33c /src | |
| parent | d85b9c400a17a8c0e3f0cdd7893ba3e76f932c25 (diff) | |
support backslash, forward slash, relative collection paths
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/requests.odin | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/server/requests.odin b/src/server/requests.odin index 0da4b0a..07c440c 100644 --- a/src/server/requests.odin +++ b/src/server/requests.odin @@ -12,6 +12,7 @@ import "core:path" import "core:runtime" import "core:thread" import "core:sync" +import "core:path/filepath" import "intrinsics" import "shared:common" @@ -434,7 +435,17 @@ request_initialize :: proc(task: ^common.Task) { config.enable_semantic_tokens = ols_config.enable_semantic_tokens; for p in ols_config.collections { - config.collections[strings.clone(p.name)] = strings.clone(strings.to_lower(p.path, context.temp_allocator)); + + forward_path, _ := filepath.to_slash(p.path, context.temp_allocator); + + if filepath.is_abs(p.path) { + config.collections[strings.clone(p.name)] = strings.to_lower(forward_path); + } + + else { + config.collections[strings.clone(p.name)] = strings.to_lower(path.join(elems = {uri.path, forward_path}, allocator = context.temp_allocator)); + } + } } |