Syntax hints?

Syntax hints?

3
NewbieNewbie
3

    Sep 08, 2004#1

    Not sure if the developer has ever considered this, but how about adding in Syntax Hints, just like in a real IDE ? Like when you start typing in some code you can press a hotkey to bring up a list of what text it thinks you are trying to type, similar to autocomplete, and then once a valid command is typed and the cursur is in the word somewhere, you can press another hotkey to have some sort of tooltip pop up that displays all the valid syntax options for that command. And perhaps another hotkey that would actually paste in all the valid syntax options into the code, so you can freely edit it to your hearts content. What do you guys think about this?

    Jake

    80
    Advanced UserAdvanced User
    80

      Sep 09, 2004#2

      I also miss this from an IDE like Visual Studio. To me this is more useful than the current autocomplete.

      6
      NewbieNewbie
      6

        Sep 13, 2004#3

        It's a nice idea in principle, but of little obvious value in practice. Plus, surely it's rather hard to implement in a general-purpose editor? Either it would have to be hardcoded into UltraEdit, like it is in most IDEs, or it would require a pretty complicated scripting language to define the syntax of each language used.

        If the former, it would only be able to support the handful of languages that it was implemented for. It's easy for Visual Studio - support VB, C++, and C#, and you're done. But people use UltraEdit for all sorts of languages. I use it to code in OCaml; I wouldn't be particularly pleased if Ian spent months working on a feature that would only help VB programmers!

        If the latter, it would take a lot of effort to make it possible for people to create information like this for arbitrary languages. Emacs can do it -- but only by containing a full Lisp interpreter! Do you really want to learn a new programming language, and spend weeks hacking away in it, just to save yourself a few seconds looking something up every once in a while?

        58
        Advanced UserAdvanced User
        58

          Sep 13, 2004#4

          Haeleth! This was an excellent summary of why we might rather miss such a feature than actually have it.

          I totally agree.


          Manni

          80
          Advanced UserAdvanced User
          80

            Sep 14, 2004#5

            Haeleth's post shows some of the decisions that IDM must make when they determine what new features to add. They can't please everyone. I personally would like to see UE add scripting support and this sort of thing would work well through scripting. I actually would like scripting support more than this IDE feature. It's what I miss most from Nedit (linux only). Currently to implement scripts I have to use tools, but only 10 are allowed. 20 if you use a project. Previously I've asked IDM to add support for more tools and hopefully they will do so.

            3
            NewbieNewbie
            3

              Sep 14, 2004#6

              Haeleth wrote:It's a nice idea in principle, but of little obvious value in practice. Plus, surely it's rather hard to implement in a general-purpose editor? Either it would have to be hardcoded into UltraEdit, like it is in most IDEs, or it would require a pretty complicated scripting language to define the syntax of each language used.
              Nice idea but little obvious value in practice??? What? Um okay you are coding for some project and you need to know what the syntax is for a certain function you are typing in. What do you do? You go and look in the documentation for it.... OR you just hit a freaking hotkey and it tells you what the proper syntax is. Hello?? Is that obvious enough value for you? I can't think that any real programmers out there would not think this would be a great benefit.

              And regarding implementation, it certainly does not have to be hard coded at all into Ultraedit. It can use some sort of text file just like the WORDFILE does for syntax highlighting. Check it out:

              The user is doing some coding. He types in some function command like...

              functionName

              and then he wonders "hmm now what was the proper flag syntax for this?" Then all he does is hit the hotkey. Ultraedit checks out the external text doc that contains the syntax definitions and it parses through it until it finds the right command "functionName". Ultraedit sees the syntax for it in this file. So it takes that syntax and creates a tooltip popup that says this:

              functionName -option1 string -option2 string -option3 int

              and the user says "oh yeah! I want to use option 2!" So he continues typing out his function and the proper option he needed....

              Syntax hints are a totally helpful thing. And I wouldn't worry about the support side of this. Yes there are a million different programming languages out there. I primarily mess with MEL and HSL (no one here probably even knows what those are) for my profression in 3d graphics and motion capture. I certainly would not expect the Ultraedit developers to determine what all the proper code syntax is for MEL or HSL and then add that. That is something I can do on my own if I want to. And I would certainly take the time to do it too, because it would save SO much time in the long run.

              You see, all the Ultraedit dev's need to do is make this idea work similar to the Syntax Highlighting. The syntax code is not hard coded at all. It just works off of some external text document that anyone can add to and remove whatever they want. This keeps the developer's support for this to a minimum...

              Is this more clear why this is a good idea now?

              6,675585
              Grand MasterGrand Master
              6,675585

                Sep 15, 2004#7

                To get the arguments of a function, you can use the hopefully available help of the language. Add this help (chm or hlp) to UltraEdit's help system and assign a hotkey for it. Now you can select the function name and press the help key to see the full help about this function.

                Of course, this is not so comfortable than syntax hints, because you have to select the word (with a hotkey), must press a (second) hotkey and have to close the help (with Alt+F4) to continue writing.

                Visual Studio actually use the same method. The difference is, simplified, there exists two help files, one with the full help of the function and one with a quick help shown as tool tip.

                I prefer always the full help, so I'm totally happy with UE.

                Edit: UEStudio is an IDE and not only a text editor like UltraEdit and supports this now for some type of programming languages. This feature is named IntelliTip in UEStudio.
                Best regards from an UC/UE/UES for Windows user from Austria

                58
                Advanced UserAdvanced User
                58

                  Sep 15, 2004#8

                  Jakobud wrote:You see, all the Ultraedit dev's need to do is make this idea work similar to the Syntax Highlighting.
                  ...
                  Is this more clear why this is a good idea now?
                  Well, you convinced _me_. UEdit already has CTags integration that I use extensively for my C/C++/Perl programming. For C and C++ ctags stores the function arguments in its list of tags. So, indeed, carrying this one step further wouldn't be that hard.


                  Manni

                  8
                  NewbieNewbie
                  8

                    Sep 16, 2004#9

                    Where might one find a nice help file for C or C++ that one could use with Uedit for function semantics or description as described above?

                      Sep 21, 2004#10

                      Well, I will answer my own question. If you own a copy of the Microsoft MSDN library then you can install the visual C part of the help and then add VCCORE.HLP as a help file to UltraEdit. Then it is as simple as double-clicking the reserved word or standard function in your source file and hitting F1.

                      This works great. Thanks to those above for pointing out this feature in UE that I was unaware of.