Skip to content
Discussion options

You must be logged in to vote

I do not think this is currently configurable.

const a = @ This(); is just a normal top-level declaration from ZLS’s point of view. The organize-imports action mainly tries to collect/sort top-level @ import and related alias declarations, so it will tend to keep the import block together and move non-import declarations such as @ This() outside that block.

So if you start with something like:

const Self = @This();
const std = @import("std");
const foo = @import("foo.zig");

organize imports may rewrite it toward the more conventional import-first layout:

const std = @import("std");
const foo = @import("foo.zig");
const Self = @This();

As far as I know, there is currently no per-declaratio…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@boningmaple
Comment options

Answer selected by boningmaple
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants