Can I set the function names colors?

Can I set the function names colors?

51
NewbieNewbie
51

    Nov 03, 2012#1

    Is it possible at all?

    6,686585
    Grand MasterGrand Master
    6,686585

      Nov 05, 2012#2

      Yes, if you add the name of your functions to a color group in the used wordfile.

      But why should you do that? If the used wordfile highlights all brackets and braces, all operators, all strings, all comments and all functions and preprocessor macros defined in a common library - in other words everything fixed, the only symbols highlighted as normal text are your functions, your variables and your preprocessor macros - in other words the symbols you add. And then there is no need anymore for highlighting the symbols defined by your code.

      Syntax highlighting based on regular expressions as needed to identify function names automatically is not supported by UltraEdit.

      51
      NewbieNewbie
      51

        Nov 07, 2012#3

        Mofi, thank you for the answer

        1) Why - i hope it is obvious (MS VS has it etc...)

        2) Thought it is easy, because UE knows already function names, so it is just a matter of assigning colors to them
        (Function List)

        3) It is something for the future release I guess

        6,686585
        Grand MasterGrand Master
        6,686585

          Nov 07, 2012#4

          Well, syntax highlighting of MS Visual Studio highlights by default only comments, strings and language keywords. That makes code harder to read and highlighting function names is very welcome.

          But syntax highlighting can be easy configured for fixed strings in UltraEdit. Therefore the wordfiles (plural!) I use for various C/C++ compilers highlight:
          • comments
          • strings
          • numbers
          • all types of brackets
          • all types of operators
          • language and compiler specific keywords
          • function names of common libraries
          • preprocessor definitions and macros of common include files
          Therefore the only strings not already highlighted are the names of my functions, variables, type definitions, enum values and preprocessor definitions and macros.

          I write function names in my C/C++ files always completely lower case, use camelcase spelling for variables, type definitions and enums (with appropriate prefix), and preprocessor definitions and macros are written completely in upper case. So no further distinction by color necessary for the symbols defined by me in my source files. The spelling rules I use for symbol names are also very good for auto-completion feature.

          51
          NewbieNewbie
          51

            Nov 08, 2012#5

            Mofi

            thank you, I guess you know better

            PS
            In VS you can right click and go there, I do not need that here, too much; but if all my calls to my function, were in "pink" for me with my old eyes that would be convenient

            6,686585
            Grand MasterGrand Master
            6,686585

              Nov 08, 2012#6

              krisk1958 wrote:thank you, I guess you know better
              No, I don't know it better. I have just described how syntax highlighting of UltraEdit works and how I use it. This is the best syntax highlighting for me, but that does not mean it is the best syntax highlighting for all programmers.

              You can right click on function list, copy all function names to clipboard and paste them into the wordfile used for syntax highlighting your wordfiles into a color group. Next you would need to sort them using for example SortLanguage or my slower SortLanguage macro, except the function list is set to list the functions already alphabetically in which case an extra sort of the function names is not necessary.

              But the problem here is that whenever you define a new function, its name must be added also to the wordfile on right line. That could be done with a script. Once you have entered the function, an UltraEdit script could be executed which takes the function name at current caret position, opens the wordfile, goes to correct color group, adds the word at correct line within this color group, saves and closes the wordfile.

              An automatic adding of entered function names to the wordfile by UltraEdit would be better, but is hard to implement as UltraEdit would need to know to which color group the function name should be added. A syntax highlighting feature of UltraEdit to highlight function names by default would be better for you. But please take into account that UltraEdit as general text editor by default searches for function names only in active file. There is the possibility to let UltraEdit search all files of a project for function names, but that takes long on larger projects.

              It is possible in UltraEdit to enable Ctags support for a project to be able to execute Search - Find Symbol which is a third-party symbol parser installed with UltraEdit. Ctags builds on execution a tags file for all symbols found in files of a project or just active file if no project used. Read in help more about Ctags support.

              Better support for C/C++ programmers on symbols like functions offers UEStudio. This application of IDM is UltraEdit extended by features like an integrated symbol parser, intellisense, class browser, integrated debugging support, etc. to get an IDE. UEStudio offers function tips and many other useful features for C/C++ programmers working on small or large projects. But automatic syntax highlighting of function names defined in the files of a project and not in library files is also not supported by UEStudio.

              I hope, this post motivates you to spend some time on discovering what UltraEdit respectively UEStudio offers. Perhaps you find some of those features useful and learn alternate methods on making the coding work. It's sometimes useful to take a look on alternate working methods to find out for yourself, if the one used in the last years was not the best for you. Visual Studio is a very, very good IDE for C/C++ with many very useful features for C/C++ programmers. But it could be that a different philosophy on how to efficiently write code is better for you after taking a learning period. Nevertheless, the operation concept of Visual Studio could be the best for you.

              And feel free to write and send a feature request email to IDM support regarding syntax highlighting of function names according to function list. The more users request such a feature, the higher is the probability to see such a feature in a future version. Development of IDM is driven by user requests and wishes.