diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2025-09-22 22:04:24 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2025-09-22 22:04:24 +0200 |
| commit | 28d540bb5f838815e23622d97cd5d3a55776414d (patch) | |
| tree | 6fbe43699e08753379a2ab00982f0946321ec798 /src/server/documents.odin | |
| parent | 1009de179a717c8b355acb8b1268fedc9b2d089c (diff) | |
Add new code action: remove unused imports
Diffstat (limited to 'src/server/documents.odin')
| -rw-r--r-- | src/server/documents.odin | 3 |
1 files changed, 3 insertions, 0 deletions
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 |