diff options
Diffstat (limited to 'src/server/check.odin')
| -rw-r--r-- | src/server/check.odin | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/server/check.odin b/src/server/check.odin index fed3a3f..1280b76 100644 --- a/src/server/check.odin +++ b/src/server/check.odin @@ -1,6 +1,5 @@ package server -import "base:intrinsics" import "base:runtime" import "core:encoding/json" @@ -11,11 +10,7 @@ import "core:os" import "core:path/filepath" import path "core:path/slashpath" import "core:slice" -import "core:strconv" import "core:strings" -import "core:sync" -import "core:text/scanner" -import "core:thread" import "src:common" @@ -41,24 +36,11 @@ Json_Errors :: struct { //If the user does not specify where to call odin check, it'll just find all directory with odin, and call them seperately. fallback_find_odin_directories :: proc(config: ^common.Config) -> []string { - walk_proc :: proc(info: os.File_Info, in_err: os.Errno, user_data: rawptr) -> (err: os.Errno, skip_dir: bool) { - data := cast(^[dynamic]string)user_data - - if !info.is_dir && filepath.ext(info.name) == ".odin" { - dir := filepath.dir(info.fullpath, context.temp_allocator) - if !slice.contains(data[:], dir) { - append(data, dir) - } - } - - return in_err, false - } - data := make([dynamic]string, context.temp_allocator) if len(config.workspace_folders) > 0 { if uri, ok := common.parse_uri(config.workspace_folders[0].uri, context.temp_allocator); ok { - filepath.walk(uri.path, walk_proc, &data) + append_packages(uri.path, &data, context.temp_allocator) } } @@ -148,7 +130,7 @@ check :: proc(paths: []string, uri: common.Uri, config: ^common.Config) { entry_point_opt, config.checker_args, "-json-errors", - ODIN_OS == .Linux || ODIN_OS == .Darwin ? "2>&1" : "", + ODIN_OS in runtime.Odin_OS_Types{.Linux, .Darwin, .FreeBSD, .OpenBSD, .NetBSD} ? "2>&1" : "", ), &data, ); !ok { |