From 28d540bb5f838815e23622d97cd5d3a55776414d Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Mon, 22 Sep 2025 22:04:24 +0200 Subject: Add new code action: remove unused imports --- src/server/documents.odin | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/server/documents.odin') diff --git a/src/server/documents.odin b/src/server/documents.odin index dee90d5..cf8a344 100644 --- a/src/server/documents.odin +++ b/src/server/documents.odin @@ -29,6 +29,7 @@ Package :: struct { base: string, base_original: string, original: string, + import_decl: ^ast.Import_Decl, } Document :: struct { @@ -446,6 +447,7 @@ parse_imports :: proc(document: ^Document, config: ^common.Config) { import_: Package import_.original = imp.fullpath import_.name = strings.clone(path.join(elems = {dir, p}, allocator = context.temp_allocator)) + import_.import_decl = imp if imp.name.text != "" { import_.base = imp.name.text @@ -468,6 +470,7 @@ parse_imports :: proc(document: ^Document, config: ^common.Config) { allocator = context.temp_allocator, ) import_.name = path.clean(import_.name) + import_.import_decl = imp if imp.name.text != "" { import_.base = imp.name.text -- cgit v1.2.3