Case transformation configuration #400
Replies: 5 comments
-
|
Here are some thoughts of mine after using this great lsp for a while. I feel like a way to to this is by using those groups (or something similar):
However I have some more proposals for the case handling: Instead of completing names (variables, functions, etc) with the case as defined in the config, there should be a option to use the case as defined in the declaration (with a config like "keep"), while not required for vhdl this feels more natural to me. In addition to lower, upper and pascal case ther should also be camel case. Specifying every keyword is probably not needed (at lest for me). |
Beta Was this translation helpful? Give feedback.
-
|
Thanks a lot for the great input!
You can already have the "keep" option if you just omit the I have also thought about implementing |
Beta Was this translation helpful? Give feedback.
-
|
Hello,
Overall, my preference is to stay as close as possible to the LRM terminology. |
Beta Was this translation helpful? Give feedback.
-
|
I have created a PR in #426 that enables more elaborate overrides with input from this discussion. Any feedback is appreciated!
This is a very good point. In my PR I have added them as a custom category, but one should think about enabling a "dynamic case" where the casing is forwarded to what the alias actually represents. |
Beta Was this translation helpful? Give feedback.
-
|
I think the CamelCase question is less about supporting a new preferred style and more about defining deterministic behaviour for mixed inputs. Even if Personally, I would be cautious about introducing One possible policy could be:
This keeps behaviour predictable and avoids heuristics that might surprise users during completion or renaming. P.S. One last point regarding aliases: I think they should be treated as a distinct category, since they introduce a new identifier in the local scope, even if they ultimately refer to an existing signal, constant, or type. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As of 4f20cbd it is possible to enable case transformations for completions. So instead of completing
STD_LOGIC_VECTOR, the user can now choose between lower case (std_logic_vector), upper case (STD_LOGIC_VECTOR) or pascal case (Std_Logic_Vector). Yet, for productive use, not all completions should be transformed in the same manner. For example:constant FOO_BAR : std_logic_vectorI would like to discuss the most suitable configuration option. As an example:
There is also the question as to how granular these options should be. I.e., should it be possible to modify every single keyword? How are multiple categories (i.e.,
signalsandvariables) aggregated?Beta Was this translation helpful? Give feedback.
All reactions