Author Topic: SlickEdit tagging broken for Visual Studio projects  (Read 808 times)

Johnco3

  • Community Member
  • Posts: 53
  • Hero Points: 1
SlickEdit tagging broken for Visual Studio projects
« on: September 04, 2022, 03:37:31 AM »
I think I found a bug in the tagging for Visual Studio C++ projects.  If the visual studio project does not have the header file containing a struct or some other symbol in its list of source files, these symbols cannot be resolved.

Visual Studio on the other hand can see these definitions as they are in the project setting's include path.  In order to get SlickEdit to find these external definitions, I needed to add the headers (located in the same directory as the source) to the project, then SlickEdit was able to find the definitions.  Looks like this is a bug in the current version of SlickEdit (2021) also.

An example of such a project can be found in https://github.com/irtlab/rtptools.  Open the rtptools.sln and go to (for example rtpdump.c) and attempt to find the definition of several typedefs defined in header file.  There are many.


Dennis

  • Senior Community Member
  • Posts: 3989
  • Hero Points: 519
Re: SlickEdit tagging broken for Visual Studio projects
« Reply #1 on: September 06, 2022, 11:29:27 AM »
This is a bit of a long-standing limitation.  Is there a reason that you would not want the header files in your project?

Johnco3

  • Community Member
  • Posts: 53
  • Hero Points: 1
Re: SlickEdit tagging broken for Visual Studio projects
« Reply #2 on: September 10, 2022, 06:32:32 PM »
Dennis, sorry for the late response. 

The issue I have is that the solution and corresponding projects are not authored by me - The example repository is a 3rd party git repository.  Many times these repositories do not have the header files included correctly with the working project/solutions. I believe this happens quite a bit when tools like CMake generate the projects.  These tools are more focused on getting the C/C++ source files included and not the headers; however these tools do tend to get the INCLUDEs environment paths setup correctly.  I was hoping to take advantage of SlickEdit's excellent tagging facilities to analyze the project files, however, instead I ended up using Visual Studio to do so instead, as it understands when the headers are not included in the project filters as long as the INCLUDE paths are set correctly. 

It would be nice to have equivalent functionality in SlickEdit without having to resort to manually adding the include files to the existing folder filters in Visual Studio and then updating in the project before opening it up again in SlickEdit.

John

guth

  • Senior Community Member
  • Posts: 104
  • Hero Points: 7
Re: SlickEdit tagging broken for Visual Studio projects
« Reply #3 on: September 10, 2022, 07:46:33 PM »
If the project is a cmake project, you can run cmake with -DCMAKE_EXPORT_COMPILE_COMMANDS=ON and parse that file outputted file compile_commands.json. I have provided a small Python script in the regular Slickedit forum a couple weeks ago that creates soft links in a directory pointing to all include paths. One can easily tag this new directory and get a tag file of all the includes. I think it is possible to create links on Windows as well, but I don't know on the top of my head how to do that in a Python script.