-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
nimsuggest: Set a case style preference #16772
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
Comments
I implemented something like this once, but from the side of the VSC addon: pragmagic/vscode-nim#82 |
Is there any advancement on this? How about not having to configure anything at all but just nimSuggest infering your coding style from your input ? I have a module A more advanced flavor would be for nimsuggest to look backward and check wether I used snake_case for other identifiers and suggest straight away Seems simple enough, I'm pretty new to Nim though maybe there is something I'm overlooking. |
Not planned. PRs acceptable. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
A new flag
--case
or--case-style
that can take one of the following values:snake
for lower_underscore_casecamel
for camelCasepascal
for PascalCaselower
for lowercasewithnoseparatorsA function to convert from any style to the chosen one is ran on all variable/types/functions suggestions nimsuggest makes so that developers can choose their preferred style (which I believe is one of the reasons why Nim is case-insensitive)
Description
Currently, if a library uses a different case style, you have two competing options:
Both have disadvantages. The proposed feature only keeps the best of both worlds.
Alternatives
Not exactly an alternative, but rather an extension of the configuration that I think might be a bit too extreme: specify different types for different things, like how functions are snake_case while classes are PascalCase in some languages. This requirement could be specified by making
--case-style
accept a space-separated list of<kind>s:<style>
pairs, where<kind>
isfunction
,variable
,constant
, etc. and<style>
is a case style to be associated with that kind of "object".The simpler format and this more advanced one could coexist: if no
:
appears in--case-style
, use the simpler format (just one case style), otherwise, use the more extensive one.Examples
--case-style snake
will autocomplete with snake_case'd functions--case-style "constants:pascal functions:lower"
will autocomplete with PascalCase'd constant names and lowercased function namesThe text was updated successfully, but these errors were encountered: