diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-06-11 11:46:14 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-06-11 11:46:14 +0200 |
| commit | 70d5bcf8eca474440020c31239cd827cf3bb3415 (patch) | |
| tree | 3fec51ed6f3257ad73b971e98dcb7c6b5e1f68fc /src/common | |
| parent | eda3110541a5a9f6f5e3b9428139f5d060e6a3ae (diff) | |
More reference work
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/config.odin | 3 | ||||
| -rw-r--r-- | src/common/position.odin | 4 | ||||
| -rw-r--r-- | src/common/util_windows.odin | 6 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/common/config.odin b/src/common/config.odin index afdcdeb..387e8b8 100644 --- a/src/common/config.odin +++ b/src/common/config.odin @@ -15,6 +15,9 @@ Config :: struct { enable_inlay_hints: bool, enable_procedure_context: bool, enable_snippets: bool, + enable_references: bool, + enable_rename: bool, + enable_std_references: bool, thread_count: int, file_log: bool, formatter: Format_Config, diff --git a/src/common/position.odin b/src/common/position.odin index 2ccd0a8..3a600ab 100644 --- a/src/common/position.odin +++ b/src/common/position.odin @@ -42,8 +42,8 @@ get_absolute_position :: proc(position: Position, document_text: []u8) -> (Absol } line_count := 0 - index := 1 - last := document_text[0] + index := 1 + last := document_text[0] if !get_index_at_line(&index, &line_count, &last, document_text, position.line) { return absolute, false diff --git a/src/common/util_windows.odin b/src/common/util_windows.odin index 5724275..194bd4d 100644 --- a/src/common/util_windows.odin +++ b/src/common/util_windows.odin @@ -28,7 +28,8 @@ foreign kernel32 { } get_case_sensitive_path :: proc(path: string, allocator := context.temp_allocator) -> string { - file := win32.CreateFileW(&win32.utf8_to_utf16(path)[0], 0, win32.FILE_SHARE_READ, nil, win32.OPEN_EXISTING, win32.FILE_FLAG_BACKUP_SEMANTICS, nil) + wide := win32.utf8_to_utf16(path) + file := win32.CreateFileW(&wide[0], 0, win32.FILE_SHARE_READ, nil, win32.OPEN_EXISTING, win32.FILE_FLAG_BACKUP_SEMANTICS, nil) if(file == win32.INVALID_HANDLE) { @@ -40,7 +41,8 @@ get_case_sensitive_path :: proc(path: string, allocator := context.temp_allocato ret := win32.GetFinalPathNameByHandleW(file, &buffer[0], cast(u32)len(buffer), 0) - res, _ := win32.utf16_to_utf8(buffer, allocator) + res, _ := win32.utf16_to_utf8(buffer[4:], allocator) + return res } |