-
-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code Actions & Autofix #689
Comments
|
Add support for const-var autofix. var a = 1;
_ = a;
const a = 1;
a = 10;
Mentioned that this feature already implemented in https://www.reddit.com/r/Zig/comments/1debk2j/, but turns out that "no". |
This code action has been implemented in #1607 but removed as an "autofix" in #1652 because it is not reversible. There is no error in |
May Zig in near future start emitting this error? |
This issue contains a collection of possible code actions that can be integrated into zls.
Some of them may not be easily implementable without #551 or #552.
Feel free to make suggestions if you have some ideas.
Unused Parameter
Unused Variable/Constant
Capture
Unreachable code
This can be part of autofix if this step is also reversible.
Formatting
Sort Imports
How imports get ordered should be discussed in more detail.
A ./ is not needed in imports
Functions should be camelCase
Type functions should be PascalCase
Refactor
Extract Variable/Constant
Extract type specififer
Sema
Create init/deinit function
Explicitly specify error union
Specify missing switch cases
Expand else switch cases
Fix all bugs
The text was updated successfully, but these errors were encountered: