Recent

Author Topic: Maintaining identifier capitalization in the IDE  (Read 1763 times)

tfurnivall

  • Jr. Member
  • **
  • Posts: 88
Maintaining identifier capitalization in the IDE
« on: August 24, 2025, 11:13:39 pm »
I wonder if it would be useful for the IDE to maintain the canonic form of capitalization of an identifier when it recurs. The canonic form would be the form when the identifier is first defined (as a const, type, var, procedure or function). From the point of view of the correctness of the source program, of course, it makes no difference, but it does seem to make the program easier to read.

At the risk of offending any Emerson fans, this is the sort of thing that would (I imagine) be fairly easy to implement, and the consistency would have a beneficial cosmetic effect. Perhaps as Yet Another Option?

Tony

 

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12429
  • Debugger - SynEdit - and more
    • wiki
Re: Maintaining identifier capitalization in the IDE
« Reply #1 on: August 24, 2025, 11:40:19 pm »
I don't know if anyone currently plans to implement that. (Even if it is certainly may be useful to some)

But a couple of things are already there. Depending on what suits you.

1) code completion

If you hit ctrl-space you get a list of declared identifiers => afaik they come in the case in which they were declared. 

And in the options you can enable fully automatic ident-completion. Not just after "dot", but all the time, whenever you start typing any word. So you always get the dropdown with the declared idents.

2) syncro edit
If you have code that needs identifiers to be "corrected". Syncro edit works well for local vars.

Select the entire procedure, press ctrl-j

Now any word (up to the first iirc 50) that has multiple occurrence, will be connected with all its occurrences. Edit any one, and the other follow.
Even if you just rewrite one of them exactly as it already is there, then the others get the same upper/lower case.

3) Rename Identifier
Can be used to correct spelling on a wider scope

tfurnivall

  • Jr. Member
  • **
  • Posts: 88
Re: Maintaining identifier capitalization in the IDE
« Reply #2 on: August 24, 2025, 11:49:11 pm »
Thanks, Martin_fr

I'll explore these options.

Tony

DomingoGP

  • Full Member
  • ***
  • Posts: 115
Re: Maintaining identifier capitalization in the IDE
« Reply #3 on: August 25, 2025, 09:55:17 am »
The ide Jedi code format has this option.

See Options->JCF Format settings -> Capitalisation -> Normalization of capitalisation.

Although it only takes into account identifiers within the same unit (i.e., it does not take into account the original definition in a unit used in the uses clause).
It uses the first use of the identifier in the source file as canonic form.

 

TinyPortal © 2005-2018