Community
    • Login

    TagsView is back! :)

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    26 Posts 4 Posters 3.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Vitalii DovganV
      Vitalii Dovgan
      last edited by Vitalii Dovgan

      Somewhere in 2010, there was a plugin TagsView that used ctags to parse a source file and to show the result in a docked window.
      Now, just 12 years later, TagsView is back! :)

      The latest source code is hosted on GitHub:
      https://github.com/d0vgan/TagsView/

      Here is what has already been implemented:

      • 32-bit and 64-bit versions
      • updated to AkelPad 4.9.8+ and Notepad++ 8.3+
      • applying editor’s colors
      • settings dialog
      • ability to scan all files in a folder
      • win32++ updated to 8.9.1+
      • uses the latest ctags from https://github.com/universal-ctags/ctags-win32
      • a lot of internal improvements

      More changes/improvements are planned.

      Michael VincentM 1 Reply Last reply Reply Quote 5
      • Vitalii DovganV
        Vitalii Dovgan
        last edited by

        The latest dev build (development build, i.e. work-in-progress build) is available here:
        https://sourceforge.net/projects/tagsview/files/TagsView (dev builds)/

        1 Reply Last reply Reply Quote 1
        • Michael VincentM
          Michael Vincent @Vitalii Dovgan
          last edited by

          @vitalii-dovgan said in TagsView is back! :):

          TagsView is back! :)

          I had the same idea a while back: https://github.com/vinsworldcom/nppTagsView

          I was trying to get SourceCookifier to compile on 64-bit but it’s written in C# and I have no idea what I was doing and found TagsView as an OK replacement - not perfect, but it worked. I added some things like:

          • updating the tags database on file save
          • using Notepad++ background colors in the dockable panel to avoid the large white listview if I had a dark background theme
          • pressing ESC key in the dockable sets focus back to the Notepad++ editor window
          • fixed the scroll-into-view when going to a tag

          Feel free to incorporate any of those changes into your version - copy or improve the code changes I did. Alternatively, if you’d like me to create some pull requests for you to incorporate some of those changes, I can do that too.

          I never made my releases “real” - just pre-release on GitHub since I didn’t know what the original author’s intent was - to keep it or abandon. I had asked for some changes a while back when I started and when unresponsive, I create the copy I’ve been working on - linked above.

          Cheers.

          Michael VincentM 1 Reply Last reply Reply Quote 0
          • Michael VincentM
            Michael Vincent @Michael Vincent
            last edited by

            @michael-vincent said in TagsView is back! :):

            TagsView is back! :)

            I had the same idea a while back

            WOW - looks like you covered everything! I’m playing with it now. Real nice.

            The only thing “missing” is the ESC key in dockable switching focus to the Notepad++ editor component.

            If using temp files instead of STDOUT for the tags files - where are those temp tags files stored? Are they “cleaned” (read: deleted) when closed?

            Cheers.

            1 Reply Last reply Reply Quote 0
            • Vitalii DovganV
              Vitalii Dovgan
              last edited by

              A temporary file is created in the %TEMP% folder and its file name starts with “npptags_”. Refer to createUniqueTempFilesIfNeeded in “src/TagsViewBase/TagsDlg.cpp”.
              In “src/TagsViewBase/TagsDlg.cpp”, there are two manual options for dealing with temporary files (I forgot to describe them in the Readme file):

              // Debug section
                  m_opt.AddInt(OPT_DEBUG_DELETETEMPINPUTFILE, cszDebug, _T("DeleteTempInputFiles"), DTF_ALWAYSDELETE);
                  m_opt.AddInt(OPT_DEBUG_DELETETEMPOUTPUTFILE, cszDebug, _T("DeleteTempOutputFiles"), DTF_ALWAYSDELETE);
              

              where

              enum eDeleteTempFile {
                          DTF_NEVERDELETE  = 0,  // don't delete (for debug purpose)
                          DTF_ALWAYSDELETE = 1,  // delete once no more needed
                          DTF_PRESERVELAST = 2   // preserve the last temp file until the next Parse() or exiting
                      };
              

              Also I’m currently introducing a “cache” of parsed tags to keep them in memory instead of invoking ctags each time you switch to another file.

              Vitalii DovganV 1 Reply Last reply Reply Quote 1
              • Vitalii DovganV
                Vitalii Dovgan @Vitalii Dovgan
                last edited by

                The Esc key clears the filter in TagsView’s panel, so a different key is needed to switch the focus. Maybe Ctrl+Tab?
                Anyway, what is the code for this? Is it a simple call to ::SetFocus or something more complicated?

                Vitalii DovganV Michael VincentM 2 Replies Last reply Reply Quote 0
                • Vitalii DovganV
                  Vitalii Dovgan @Vitalii Dovgan
                  last edited by

                  Volunteers are welcome to make the TagsView’s icon/bitmap transparent and to introduce dark versions of the icons/bitmaps for Notepad++'es Dark Mode. I’m not good with images.

                  1 Reply Last reply Reply Quote 1
                  • Michael VincentM
                    Michael Vincent @Vitalii Dovgan
                    last edited by

                    @vitalii-dovgan said in TagsView is back! :):

                    The Esc key clears the filter in TagsView’s panel, so a different key is needed to switch the focus. Maybe Ctrl+Tab?
                    Anyway, what is the code for this? Is it a simple call to ::SetFocus or something more complicated?

                    I thought it would operate like the Notepad++ Function List where:

                    • ESC in the list view box switches focus to Notepad++ editor component
                    • ESC in the filter text box clears it
                    • TAB switches between filter text box and list view

                    Seems like the last 2 work and the first one is “combined” with the second - as in ESC in either filter text box or list view clears the filter text.

                    In any case, the code for ESC to switch focus is simple: https://github.com/vinsworldcom/nppTagsView/commit/e42fe1f2a0f148a5a5b67cc3cf0f88a003e678ca

                    I think if you were to implement something like the bullet list above that mimics Notepad++ Function List behavior, you’d need some nuance to it, but where ever the “SetFocus” call would go, the linked commit shows the one-line method I was calling to make it happen.

                    Cheers.

                    Vitalii DovganV 1 Reply Last reply Reply Quote 1
                    • pnedevP
                      pnedev
                      last edited by

                      @Vitalii-Dovgan ,

                      Great news, thank you very much for the update!

                      I tried your dev-build and it works perfectly (64-bit build) but I noticed a slight problem when visiting location on tag double-click.
                      I have described it here several years ago and also have fixed it in my temporary build back then - you can find the source in the same link.
                      Briefly described, when some lines are folded and you double-click on a tag the location opened might not be scrolled into view or (if folded) will not be visible (will remain folded).

                      Good work anyway, thanks again!

                      1 Reply Last reply Reply Quote 3
                      • Vitalii DovganV
                        Vitalii Dovgan @Michael Vincent
                        last edited by

                        @michael-vincent
                        Any idea why I may be getting this? –
                        alt text

                        Michael VincentM 1 Reply Last reply Reply Quote 0
                        • Michael VincentM
                          Michael Vincent @Vitalii Dovgan
                          last edited by

                          @vitalii-dovgan said in TagsView is back! :):

                          Any idea why I may be getting this? –

                          Premature delete? Try again now …

                          Cheers.

                          Vitalii DovganV Michael VincentM 2 Replies Last reply Reply Quote 1
                          • Vitalii DovganV
                            Vitalii Dovgan @Michael Vincent
                            last edited by

                            Next iteration :)
                            https://sourceforge.net/projects/tagsview/files/TagsView (dev builds)/
                            TagsView_dll_dev_220515.zip

                            The most interesting changes:

                            • using in-memory “cache” of tags to invoke ctags only when necessary
                            • new setting “Esc sets the focus to Editor”
                            1 Reply Last reply Reply Quote 4
                            • Michael VincentM
                              Michael Vincent @Michael Vincent
                              last edited by

                              @michael-vincent said in TagsView is back! :):

                              @vitalii-dovgan said in TagsView is back! :):

                              Any idea why I may be getting this? –

                              Premature delete? Try again now …

                              @Vitalii-Dovgan I’ve been compiling and using your incremental commits and so far so good. I see the “context menu” one, but not sure what that was supposed to do - I don’t see a right-click context menu when trying.

                              In any case, I think you may have extracted what ever little bit of my minor updates that could possibly be useful. Any objections to me deleting my https://github.com/vinsworldcom/nppTagsView repo?

                              Cheers.

                              Vitalii DovganV 2 Replies Last reply Reply Quote 1
                              • Vitalii DovganV
                                Vitalii Dovgan @Michael Vincent
                                last edited by

                                @michael-vincent
                                The “context menu, part 1” was incomplete, I was going to finish it in the “part 2”. However, I noticed some stability issues together with some ideas of refactoring and decided these were more important :)
                                I think I’ll complete these things and upload a new build next week. Anyway, the plugin becomes better and better, so most likely the official version 0.5 will be released in June.

                                1 Reply Last reply Reply Quote 2
                                • Vitalii DovganV
                                  Vitalii Dovgan @Michael Vincent
                                  last edited by

                                  @michael-vincent
                                  If you don’t need your repo, feel free to delete it.

                                  Vitalii DovganV 1 Reply Last reply Reply Quote 1
                                  • Vitalii DovganV
                                    Vitalii Dovgan @Vitalii Dovgan
                                    last edited by

                                    Next iteration:
                                    https://sourceforge.net/projects/tagsview/files/TagsView (dev builds)/
                                    TagsView_dll_dev_220530.zip

                                    The most important changes:

                                    • stability improvements
                                    • some refactoring
                                    • context (popup) menu
                                    Vitalii DovganV 1 Reply Last reply Reply Quote 2
                                    • Vitalii DovganV
                                      Vitalii Dovgan @Vitalii Dovgan
                                      last edited by

                                      TagsView_dll_dev_220603.zip

                                      The most important changes:

                                      • transparent icon (thanks to AlexeyB)
                                      • stability improvements
                                      • ctags.exe updated
                                      Vitalii DovganV 1 Reply Last reply Reply Quote 1
                                      • Vitalii DovganV
                                        Vitalii Dovgan @Vitalii Dovgan
                                        last edited by

                                        Next iteration:
                                        https://sourceforge.net/projects/tagsview/files/TagsView (dev builds)/
                                        TagsView_dll_dev_220608.zip

                                        The most important changes:

                                        • NppTags: improving switching between docked dialogs
                                        • AkelTags: improving the docked dialog
                                        Vitalii DovganV 1 Reply Last reply Reply Quote 2
                                        • Vitalii DovganV
                                          Vitalii Dovgan @Vitalii Dovgan
                                          last edited by

                                          Finally, it happened!!!

                                          TagsView 0.5 beta

                                          • back again!
                                          • TagsView on GitHub: https://github.com/d0vgan/TagsView
                                          • 32-bit and 64-bit versions
                                          • updated to AkelPad 4.9.8+ and Notepad++ 8.4+
                                          • applying editor’s colors
                                          • settings dialog
                                          • context (popup) menu
                                          • ability to scan all files in a folder
                                          • using in-memory “cache” of tags to invoke ctags only when necessary
                                          • transparent icon (thanks to AlexeyB)
                                          • win32++ updated to 9.0
                                          • uses the latest ctags from https://github.com/universal-ctags/ctags-win32
                                          • a lot of internal improvements
                                          • Glory to Ukraine! Glory to the heroes!

                                          https://github.com/d0vgan/TagsView/releases/tag/tagsview_v05
                                          https://sourceforge.net/projects/tagsview/files/TagsView v0.5 beta/

                                          Vitalii DovganV 1 Reply Last reply Reply Quote 1
                                          • Vitalii DovganV
                                            Vitalii Dovgan @Vitalii Dovgan
                                            last edited by

                                            So, what’s next?

                                            I think, the most important is to add a “Go to tag” functionality to be able to go to a function/class/variable under the cursor.

                                            Next, I may steal the images from the Function List (or from some other source) to use them for different entities such as:

                                            • function/method
                                            • variable/member
                                            • class/structure
                                            • namespace

                                            Next, as WinAPI’s TreeView and ListView are not good with really large collections of items, I need to find a way to overcome that. For example, there can be a virtual ListView (where the items are not stored by the WinAPI’s ListView itself), but there is no virtual TreeView.
                                            So what I’m thinking is the following: once there will be the “Go to tag” functionality implemented, there will be no need to have all the items for all the associated files to be shown in the TreeView and ListView right after the parsing. I mean, the TreeView/ListView will show the items (tags) only for the current file, however all the tags for all the files will be present in the memory. And once another associated file is opened either manually or as a result of the “Go to tag”, the corresponding items (tags) for this file will be added to the TreeView/ListView. I.e. the items (tags) will be shown by demand, but the information about these tags will already be present in the memory.

                                            Vitalii DovganV 1 Reply Last reply Reply Quote 2
                                            • First post
                                              Last post
                                            The Community of users of the Notepad++ text editor.
                                            Powered by NodeBB | Contributors