-
-
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
Adds a 'format to camelCase' codeaction for function names #679
Adds a 'format to camelCase' codeaction for function names #679
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for you PR! It's great to see more code actions getting integrated. There are "a few" issues though.
If you are interested you can also add code actions for Type functions should be PascalCase
or A ./ is not needed in imports
.
src/code_actions.zig
Outdated
@@ -159,7 +188,7 @@ fn handleUnusedVariableOrConstant(builder: *Builder, actions: *std.ArrayListUnma | |||
|
|||
try actions.append(builder.arena.allocator(), .{ | |||
.title = "discard value", | |||
.kind = .SourceFixAll, | |||
.kind = .QuickFix, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be keep at SourceFixAll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has to be resolved before i can approve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, i'm not too familiar with git and i missed this. fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your latest commit touched the wrong place.
Set this location https://github.com/NuclearPhone/zls/blob/39ea5869a377eeec71fe333f2ee264fac7cf2bbb/src/code_actions.zig#L85 to .QuickFix
.
And set this location https://github.com/NuclearPhone/zls/blob/39ea5869a377eeec71fe333f2ee264fac7cf2bbb/src/code_actions.zig#L176 to .SourceFixAll
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
Thanks for the feedback; I'll get to fixing my error-ridden code. In the future i'll pay more attention to proof-reading. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
Does as the title says, this PR adds a code action that reformats non-camelCase function names to be camelCase.