Add support for lowercase identifiers

Issue #73 open
Juan Francisco Cantero Hurtado created an issue

The autocompletion uses the pascal style for the identifiers, e.g. "IntToStr". I would prefer lowercase for everything: "inttostr".

Can you add an option to make the capitalization style configurable?. Lazarus has a identifier policy in Tools/Options/Codetools/Words:

  • None (pascal)
  • lowercase
  • UPPERCASE
  • Lowercase, first letter up

2015-03-30 11_27_49-IDE Options.png

Comments (5)

  1. Christopher Wosinski repo owner

    Hi Juan,

    all keyword suggestions ("procedure", "function", "class", "while", "for" etc.) do currently come from snippets and are already lowercase. If you want to configure them differently then take a look here: https://code.visualstudio.com/docs/editor/userdefinedsnippets

    IntToStr is not a keyword but a function name. It appears in code completion only when SysUtils is listed in one of the uses sections. It appears in exactly the same capitalization as its definition. If you asked for my personal opinion on this topic I'd say that changing capitalization of identifiers only leads to confusion. But you didn't ask for it and my opinion shouldn't stay over other developers' opinions ;-) So I leave this topic open. But for now, the priority to implement a settings that controls automatic captilization adjustments is very low.

  2. Juan Francisco Cantero Hurtado reporter

    You're right, I changed the description from keyword to identifier.

    I know this is something personal but I use lowercase for everything (functions, procedures, etc), so the weird part of the code are the identifiers added using the autocompletion. Anyway, the "very low priority" is fine with me :)

  3. Bee Jay

    Although it's a personal preference, I think it's considered as bad practice in Pascal to name methods (function and procedure) using all lowercases. Pascal is known to use lowercase for keywords and reserved words, CamelCase for identifiers, and CAPITAL_CASE for constants.

    However, I found many new Pascal programmers today also use camelCase (first letter as lowercase) for identifiers and variables, especially for internal or local scope. I think it's a good practice, it helps distinguish which locals from globals.

  4. Log in to comment