How do I Ctrl+click to go to a Java method in a Java file?

How do I Ctrl+click to go to a Java method in a Java file?

131
Basic UserBasic User
131

    Apr 26, 2022#1

    Hi!

    I have a Java file open in UltraEdit. It is syntax highlighted correctly. In Eclipse, and likely most other IDEs, when I hover over a method name and hold down the Ctrl key, it becomes a dynamic hyperlink that, when clicked, brings the cursor to that method in the code.

    Is there an equivalent keystroke/mouse combination in UE to do the same?

    What I've been doing as a workaround is highlighting the method name, finding all occurrences of it, and then double clicking the method declaration within the search results list. This works, but is very cumbersome. I do 95% of my work in Eclipse, but it is sometimes convenient to have a Java file open in UE, too.
    UE-Ctrl-Click-1.jpg (18.59KiB)
    Hovering with Ctrl key held down.
    UE-Ctrl-Click-2.jpg (33.8KiB)
    Brought to the method after clicking the dynamic hyperlink.

    6,602547
    Grand MasterGrand Master
    6,602547

      Apr 26, 2022#2

      UltraEdit is a general text editor and not an IDE with special support for a small set of programming languages. UltraEdit can be used for any text file editing purposes. UltraEdit´s syntax highlighting is based on words and not on symbols found by a symbol parser written for a specific language. The syntax highlighting of UltraEdit can be defined for any language and even for text files which do not contain programming or scripting language code at all.

      Ctrl+click is used by default for multi-caret editing in UltraEdit as described on the help page with the title Multi-Caret Editing.
      Ctrl+double click is for opening a file or url under cursor respectively current caret position depending on the configuration settings Editor - Delimiters and described by me at How to open a selected file name or file name under cursor via right click?

      However, UltraEdit is a very powerful general text editor. It is not an IDE, but there is built-in since v28.00 of UltraEdit for Windows a symbol parser as it was before available only for UEStudio which is an IDE with UltraEdit as core text editor. So first determine the used version of UltraEdit.

      Do you use v28.00 or a newer version of UltraEdit for Windows?

      Yes, open Advanced - Settings or Configuration - Auto-complete and look on configuration options under this list item in configuration, especially all the IntelliTips settings.

      I don't want to describe more without knowing the version of UltraEdit used by you and which user interface mode is used by you - ribbon mode, toolbar/menu mode with contemporary menus, or toolbar/menu mode with traditional menus. Please let me also know if you edit Java files in UltraEdit without or with using an UltraEdit project as this make also a difference regarding to the information you want.

      There is the command Find symbol which works with all versions of UltraEdit, but only on using a project with Ctags support enabled and configured right for the project. There are several forum topics containing information about usage of Find symbol to jump to the definition of a symbol with a button click or by key and how to jump back by button click or by key to previous file/caret position.
      Best regards from an UC/UE/UES for Windows user from Austria

      131
      Basic UserBasic User
      131

        Apr 26, 2022#3

        Mofi,
        I use UE version 2022.0.0.102 64-bit.
        I use traditional menu (no ribbon).
        I do not use a UE project.
        I tried turning on all IntelliTip items, but that didn't help -- you didn't claim it would help, I'm just reporting my finding thus far.

        6,602547
        Grand MasterGrand Master
        6,602547

          Apr 27, 2022#4

          I use for real coding work UEStudio with projects since many years which has built-in full InteliiTips support for several programming and scripting languages. So I needed to discover which of the IntelliTip features are now available also in UltraEdit v2022.0.0.102 and which of them work on having just opened a single source code file without using a project.

          UEStudio has a Class viewer view filled with data found by the IntelliTips symbol parser and working even for a source code file not being part of a project because of UEStudio parses all *.c and *.h files in same directory as the opened *.c file which I used for testing. I don't code Java and so don't have Java source code files. I was surprised by this behavior of parsing all *.c and *.h files in same directory as the opened *.c file as I have not expect that. It was really the first time opening a source code file not being part of one of my C, C++ and HTML projects  where I always open the project first on wanting to use IntelliTips commands on the opened source code file.

          UEStudio has also an IntelliTips toolbar with related commands. It was also interesting for me to see a disabled UEStudio only command Find symbol definition in project files (executed by me always by hotkey) because of no project opened while the Class Viewer displayed all functions in active file (and all other source code files in same directory) and has the context menu option Go To Definition working fine even on not using a project.

          Conclusion: It looks like the extension to use IntelliTips parser also for non-project files is not fully finished yet respectively the UE/UES developers overlooked some useful features for this use case. In my opinion the UEStudio only command Find symbol definition in project files should be renamed to just Find symbol definition, added also to UltraEdit and being available also on not having opened a project, but the IntelliTips symbol parser has nevertheless parsed the opened file (and others in same directory) according to the configuration. Find symbol definition should be only disabled on no project opened and the active file is not parsed by the IntelliTips symbol parser on having configured that in the configuration settings.

          UltraEdit v2022.0.0.102 has also the IntelliTips parser built-in which parses opened files like UEStudio with the same IntelliTips configuration, but there is no Class Viewer view and no IntelliTips toolbar (toolbar/menu mode with traditional menus) respectively the IntelliTip commands on ribbon tab Project.

          I could not find any command working as expected by you on having opened a source code file not being a project file of an opened project which is nevertheless parsed by the IntelliTips symbol parser. It looks like this is a feature currently missing in UltraEdit v2022.0.0.102 and also in UEStudio v2022.0.0.102 which would be useful for users working with source code files without using a project. In UEStudio the IntelliTips command Find symbol definition in project files works fine on having a project opened and the opened source code file is one of the project files. The command Find symbol works fine in UltraEdit and in UEStudio on using a project with enabled Ctags support and the opened source code file is a project file of the opened project.

          I will send some enhancement requests by email for UEStudio and for UltraEdit regarding to usage of the IntelliTips parser database for opened files without using a project like adding a command to go to the definition of a symbol (function, macro, class, ...) which is in the IntelliTips parser database. I suggest to request also the wanted feature with an email sent to UltraEdit support. The more users request a feature the higher becomes the priority for implementation.

          I can only suggest at the moment to make use of the Function List view in UltraEdit (and UEStudio) on a function to go to its definition is in same file. The function list contains in this case also the function name and a double click on the function name in the function list results in a jump to the definition of the function. The function can be found in the function list by either using the search box at top of the Function List view or quickly typing the beginning of the function name on function list view has the input focus. It is possible to jump back to the initial position by using in traditional menu Search the command Back (last position) at bottom. I execute this command always with Alt+Shift+LEFT ARROW which I assigned as hotkey to this command in the key mapping configuration dialog and the command Forward (next position) with Alt+Shift+RIGHT ARROW. The two commands are named Go to previous position and Go to next position in the commands list in key mapping configuration

          It would be also possible to use a macro or a script which searches in active file for the definition of the function at current position of the caret. But such a macro or script is of no help if the function at current caret position is a method of a class and the active source code file contains multiple classes with identical name for a method in more than one class. A regular expression search cannot be made language intellisense. Well, a script could be coded smart enough, but re-coding a symbol parser with language intellisense in an UE/UES script does not really make sense.

          I have one more question for my personal interest: Some of my colleagues using Eclipse on Linux told me that when they open a C++ source code file in Eclipse not being part of the currently opened project(s) by using command File Open, they cannot even save the modified source code file with Ctrl+S. They have to use the command Save All and most of the language intellisense features do not work. Is that true also with Eclipse on Windows as used by you or do you think my colleagues have Eclipse no correct configured in their Linux machines?
          Best regards from an UC/UE/UES for Windows user from Austria

          131
          Basic UserBasic User
          131

            Apr 27, 2022#5

            Mofi,
            I only use Eclipse with Java, so I cannot comment on C++ behavior. 

            Thank you for pointing out the Function List view.  It is far superior to the method I had been employing of finding all and then searching for the method declaration.